-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spack Components for OM3 #171
base: main
Are you sure you want to change the base?
Changes from 32 commits
5d72a48
6e9c3f6
b944115
c984bee
c53d2b9
2001f54
9d856f8
4e4908e
42eb0fc
0aaeca1
7f93dbc
2944f7a
a2d610d
79d34bb
6e6421c
b8b394a
d2dab1f
b167ae5
ed3b028
b72c6e0
bd2bca8
c5f1658
b75b6c9
d3aff02
2a0ad48
f91f2be
f2def26
a8e8a5f
2a4b0f1
07fc321
49bde52
3ac4aea
71561ad
f219d71
30d37f2
be5bfcf
174fcb5
4bede53
94b9cb6
30abf59
957a4c8
9b6c462
2b84afc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other | ||
# Spack Project Developers. See the top-level COPYRIGHT file for details. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# ---------------------------------------------------------------------------- | ||
|
||
from spack.package import * | ||
|
||
|
||
class AccessCice(CMakePackage): | ||
"""CICE is a computationally efficient model for simulating the growth, melting, | ||
and movement of polar sea ice. CICE is maintained and developed by the CICE-Consortium. | ||
This package builds using the Access3Share common libraries for ACCESS 3 models.""" | ||
|
||
homepage = "https://github.com/CICE-Consortium/CICE" | ||
url = "https://github.com/CICE-Consortium/CICE/archive/refs/tags/CICE6.6.0.tar.gz" | ||
version("6.6.0", md5="1c678c0af67bf09f92c0a861344c3a92") | ||
git = "https://github.com/ACCESS-NRI/CICE" | ||
submodules = True | ||
maintainers = ["anton-seaice", "harshula"] | ||
|
||
# see license file in at https://github.com/CICE-Consortium/CICE | ||
license("LicenseRef-CICE", checked_by="anton-seaice") | ||
|
||
# variant("openmp", default=False, description="Enable OpenMP") | ||
variant("cesmcoupled", default=False, description="Set CESMCOUPLED CPP Flag") | ||
variant("access3", default=True, description="Install CICE as library for Access3 models") | ||
|
||
variant("io_type", | ||
default="NetCDF", | ||
values=("NetCDF", "PIO", "Binary"), | ||
description="CICE IO Method" | ||
) | ||
|
||
variant( | ||
"build_type", | ||
default="Release", | ||
description="The build type to build", | ||
values=("Debug", "Release"), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No |
||
) | ||
|
||
depends_on("access3-share", when="+access3") | ||
# depends_on("access3-share+openmp", when="+openmp+access3") | ||
|
||
depends_on("cmake@3.18:", type="build") | ||
depends_on("mpi") | ||
depends_on("netcdf-fortran@4.6.0:", when="io_type=NetCDF") | ||
depends_on("parallelio@2.5.10: build_type==RelWithDebInfo", when="io_type=PIO") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is overriding the global There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I fear this turns off some optimisation which needs to be off for bfb repro, Ill investigate |
||
depends_on("parallelio fflags='-qno-opt-dynamic-align -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs -fp-model source' cflags='-qno-opt-dynamic-align -fp-model precise -std=gnu99'", when="%intel io_type=PIO") | ||
|
||
root_cmakelists_dir = "configurations/scripts/cmake" | ||
anton-seaice marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
def cmake_args(self): | ||
args = [ | ||
self.define_from_variant("CICE_IO", "io_type"), | ||
# self.define_from_variant("OPENMP", "openmp"), | ||
self.define_from_variant("CESMCOUPLED", "cesmcoupled"), | ||
self.define_from_variant("ACCESS3_CICE", "access3") | ||
] | ||
|
||
# we need this for cmake to find MPI_Fortran | ||
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other | ||
# Spack Project Developers. See the top-level COPYRIGHT file for details. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# ---------------------------------------------------------------------------- | ||
|
||
from spack.package import CMakePackage, variant, version, depends_on | ||
|
||
|
||
class AccessMom6(CMakePackage): | ||
"""The Modular Ocean Model (MOM) describes the numerical ocean models originating from NOAA/GFDL. | ||
They are used to simulate ocean currents at both regional and global scales, | ||
enabling scientists to answer fundamental questions about the role of the ocean in the dynamics of the global climate. | ||
This package builds using the Access3Share common libraries for ACCESS 3 models.""" | ||
|
||
homepage = "https://github.com/ACCESS-NRI" | ||
git = "https://github.com/ACCESS-NRI/MOM6.git" | ||
submodules = True | ||
url = "https://github.com/ACCESS-NRI/MOM6.git" | ||
|
||
version("cmake_build", | ||
git="https://github.com/ACCESS-NRI/MOM6.git", | ||
branch="cmake_build", | ||
submodules=True, | ||
preferred=True, | ||
) | ||
anton-seaice marked this conversation as resolved.
Show resolved
Hide resolved
|
||
maintainers = ["minghangli-uni", "harshula"] | ||
|
||
# see license file in https://github.com/ACCESS-NRI/MOM6/blob/e92c971084e185cfd3902f18072320b45d583a54/LICENSE.md | ||
license("LGPL-3.0", checked_by="minghangli-uni") | ||
|
||
root_cmakelists_dir = "cmake" | ||
|
||
variant("openmp", default=False, description="Enable OpenMP") | ||
variant("mom_symmetric", default=True, description="Use symmetric memory in MOM6") | ||
variant("access3", default=True, description="Building MOM6 library with Access3share") | ||
variant("cesmcoupled", default=False, description="Enable parameters with cesm coupled") | ||
|
||
depends_on("access3-share", when="+access3") | ||
depends_on("cmake@3.18:", type="build") | ||
depends_on("mpi") | ||
depends_on("netcdf-fortran@4.6.0:") | ||
depends_on("fms@2021.03: build_type==RelWithDebInfo precision=64 +large_file ~gfs_phys ~quad_precision") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hard codes |
||
depends_on("fms +openmp", when="+openmp") | ||
depends_on("fms ~openmp", when="~openmp") | ||
|
||
|
||
root_cmakelists_dir = "cmake" | ||
|
||
def cmake_args(self): | ||
args = [ | ||
self.define_from_variant("OPENMP", "openmp"), | ||
self.define_from_variant("ENABLE_MOM_SYMMETRIC", "mom_symmetric"), | ||
self.define_from_variant("ENABLE_ACCESS_MOM6", "access3"), | ||
self.define_from_variant("ENABLE_CESMCOUPLED", "cesmcoupled"), | ||
anton-seaice marked this conversation as resolved.
Show resolved
Hide resolved
|
||
] | ||
|
||
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)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These should no longer be necessary. |
||
|
||
return args |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,4 +25,4 @@ class AccessOm3(BundlePackage): | |
|
||
version("latest") | ||
|
||
depends_on("access-om3-nuopc") | ||
depends_on("access3-exe") |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there a reason to have this separate package? Couldn't all this be just be put in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That is the extent of my high-level feedback. The rest is pretty low level I'm afraid. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you leave this comment on the correct file ?
We will at some point build models which don't include MOM6 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, I make a mistake in my comment:
Does that make more sense? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't understand how versioning and CD would work if we did this. i.e. the version on the access-om3 deployment, is the version of a git tag in the access-nri/access-om3 release the version on access3-exe is the version from the source code, i.e. the access-nri/access3-share repo So I think we need a bundle package so we have something to version ? (ping @CodeGat ) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other | ||
# Spack Project Developers. See the top-level COPYRIGHT file for details. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from spack.package import * | ||
|
||
|
||
class Access3Exe(CMakePackage): | ||
"""Executable build for ACCESS version 3 climate models. The exectuable is defined in Community Mediator for Earth Prediction | ||
Systems (CMEPS). Currently implemented for ACCESS-OM3, and in the future may support ACCESS-CM3 and ACCESS-ESM3. This is a | ||
companion pacakge to Access3Share which builds the shared libraries.""" | ||
|
||
homepage = "https://github.com/ACCESS-NRI/access3-share" | ||
git = "https://github.com/ACCESS-NRI/access3-share" | ||
submodules = True | ||
maintainers = ["anton-seaice", "harshula", "micaeljtoliveira"] | ||
|
||
license("Apache-2.0", checked_by="anton-seaice") | ||
|
||
variant( | ||
"build_type", | ||
default="Release", | ||
description="The build type to build", | ||
values=("Debug", "Release"), | ||
anton-seaice marked this conversation as resolved.
Show resolved
Hide resolved
|
||
) | ||
|
||
# To-DO: confirm if we want a MOM6 only for regional modelling | ||
anton-seaice marked this conversation as resolved.
Show resolved
Hide resolved
|
||
variant( | ||
"configurations", | ||
# default="MOM6-CICE6, CICE6-WW3, MOM6-CICE6-WW3", if we set these defaults there is no way to unset them in the deployment | ||
default="CICE6", | ||
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") | ||
|
||
depends_on("cmake@3.18:", type="build") | ||
depends_on("mpi") | ||
depends_on("access-cice+cesmcoupled+access3") | ||
depends_on("access-mom6+cesmcoupled+access3") | ||
anton-seaice marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# depends_on("access-ww3 driver=nuopc/cmeps +cesmcoupled") | ||
|
||
flag_handler = CMakePackage.build_system_flags | ||
|
||
def cmake_args(self): | ||
|
||
args = [ | ||
self.define_from_variant("OPENMP", "openmp"), | ||
self.define( | ||
"ENABLE_MOM6", "configurations=MOM6" in self.spec | ||
), | ||
self.define( | ||
"ENABLE_CICE6", "configurations=CICE6" in self.spec | ||
), | ||
self.define( | ||
"ENABLE_WW3", "configurations=WW3" in self.spec | ||
), | ||
self.define( | ||
"ENABLE_MOM6-WW3", "configurations=MOM6-WW3" in self.spec | ||
), | ||
self.define( | ||
"ENABLE_MOM6-CICE6", "configurations=MOM6-CICE6" in self.spec | ||
), | ||
self.define( | ||
"ENABLE_CICE6-WW3", "configurations=CICE6-WW3" in self.spec | ||
), | ||
self.define( | ||
"ENABLE_MOM6-CICE6-WW3", "configurations=MOM6-CICE6-WW3" in self.spec | ||
), | ||
] | ||
|
||
# we need this for cmake to find MPI_Fortran | ||
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)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should no longer be needed I believe. |
||
|
||
return args |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other | ||
# Spack Project Developers. See the top-level COPYRIGHT file for details. | ||
# | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
from spack.package import * | ||
|
||
|
||
class Access3Share(CMakePackage): | ||
"""Shared coupler/mediator libraries used by the ACCESS version 3 climate models. This | ||
package includes the Community Mediator for Earth Prediction Systems (CMEPS) and Community | ||
Data models for Earth Prediction Systems (CDEPS) as used in ACCESS-OM3 (and the future | ||
ACCESS-CM3 and ACCESS-ESM3 etc). See Access3Exe package to produce executable programs.""" | ||
|
||
homepage = "https://github.com/ACCESS-NRI/access3-share" | ||
git = "https://github.com/ACCESS-NRI/access3-share" | ||
submodules = True | ||
maintainers = ["anton-seaice", "harshula", "micaeljtoliveira"] | ||
|
||
license("Apache-2.0", checked_by="anton-seaice") | ||
|
||
# variant("openmp", default=False, description="Enable OpenMP") | ||
|
||
variant( | ||
"build_type", | ||
default="Release", | ||
description="The build type to build", | ||
values=("Debug", "Release"), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No option for |
||
) | ||
|
||
depends_on("cmake@3.18:", type="build") | ||
depends_on("mpi") | ||
depends_on("netcdf-fortran@4.6.0:") | ||
depends_on("esmf@8.3.0:") | ||
depends_on("esmf cflags='-fp-model precise' fflags='-fp-model precise'", when="%intel") | ||
depends_on("fortranxml@4.1.2:") | ||
|
||
depends_on("parallelio@2.5.10: build_type==RelWithDebInfo") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
depends_on("parallelio fflags='-qno-opt-dynamic-align -convert big_endian -assume byterecl -ftz -traceback -assume realloc_lhs -fp-model source' cflags='-qno-opt-dynamic-align -fp-model precise -std=gnu99'", when="%intel") | ||
|
||
flag_handler = CMakePackage.build_system_flags | ||
|
||
def cmake_args(self): | ||
|
||
args = [ | ||
self.define("ACCESS3_LIB_INSTALL", True), | ||
# self.define_from_variant("OPENMP", "openmp"), | ||
] | ||
|
||
# we need this for cmake to find MPI_Fortran | ||
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shall we pre-emptively create a
version("access-om3", branch="main")
here ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does this interact with the
access3
variant?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The CMake build will pick the correct "driver" code to work with dependencies built in access3-share
a.k.a the customisation in our fork are not essential for the model to build, but misses some nice to have customisation in our fork
I am not sure thats the question ?