Skip to content

Commit 0330062

Browse files
Add fre-nctools package
Only includes versions that build successfully --------- Co-authored-by: Micael Oliveira <[email protected]>
1 parent db2fd8c commit 0330062

File tree

1 file changed

+63
-0
lines changed

1 file changed

+63
-0
lines changed

packages/fre-nctools/package.py

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Copyright Spack Project Developers. See COPYRIGHT file for details.
2+
#
3+
# Copyright 2025 ACCESS-NRI
4+
#
5+
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
6+
7+
from spack.package import *
8+
9+
10+
class FreNctools(AutotoolsPackage):
11+
"""FRE-NCtools is a collection of tools for creating grids and mosaics
12+
commonly used in climate and weather models, the remapping of data among
13+
grids, and the creation and manipulation of netCDF files. These tools were
14+
largely written by members of the GFDL Modeling Systems Group primarily for
15+
use in the Flexible Modeling System (FMS) Runtime Environment (FRE)
16+
supporting the work of the Geophysical Fluid Dynamics Laboratory (GFDL)."""
17+
18+
homepage = "https://github.com/NOAA-GFDL/FRE-NCtools"
19+
git = "https://github.com/NOAA-GFDL/FRE-NCtools.git"
20+
21+
maintainers("dougiesquire")
22+
23+
license("LGPL-3.0-only")
24+
25+
# A number of versions are excluded from this spack package due to bugs:
26+
# - 2024.05.01: see https://github.com/NOAA-GFDL/FRE-NCtools/issues/344
27+
# - 2024.03: implicit funcion delcaration in mppncscatter.c; fixed in edcdf78
28+
# - 2024.01: implicit function declaration in make_topog.c; fixed in 6b4d2fb
29+
# - 2023.01.02: implicit function declaration in make_topog.c; fixed in 6b4d2fb
30+
# - 2023.01.01: implicit function declaration in make_topog.c; fixed in 6b4d2fb
31+
# - 2023.01: implicit function declaration in make_topog.c; fixed in 6b4d2fb
32+
33+
version("main", branch="main")
34+
version("2024.05", sha256="61cec52aa03e066b64bed794ef9dc3eb28654c3d1b872aef1b69ce99ef7a9c65")
35+
version("2024.04", sha256="e27346d7ade1b67af163bb7f327a47a288d5e475fe797323bd7cee3a46385de0")
36+
version("2024.02", sha256="90d52abc1b467d635dd648185b0046efcc6d58a232143b0ccaf9a0bff23d2f5d")
37+
version("2022.02", sha256="bd90c9c3becdb19ff408c0915e61141376e81c12651a5c1b054c75ced9a73ad2")
38+
39+
variant("mpi", default=False, description="Builds with MPI support")
40+
41+
depends_on("autoconf", type="build")
42+
depends_on("automake", type="build")
43+
depends_on("libtool", type="build")
44+
depends_on("netcdf-c")
45+
depends_on("netcdf-fortran")
46+
depends_on("mpi", when="+mpi")
47+
depends_on("nco", when="@2024.05:")
48+
49+
def url_for_version(self, version):
50+
return "https://github.com/NOAA-GFDL/FRE-NCtools/archive/{0}.tar.gz".format(version)
51+
52+
def configure_args(self):
53+
spec = self.spec
54+
args = []
55+
56+
# ocean_model_grid_generator subproject removed in 2023.01
57+
if spec.version <= Version("2022.02"):
58+
args.append("--disable-ocean-model-grid-generator")
59+
60+
if "+mpi" in spec:
61+
args.append("--with-mpi")
62+
63+
return args

0 commit comments

Comments
 (0)