summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/wrf/package.py
diff options
context:
space:
mode:
Diffstat (limited to 'var/spack/repos/builtin/packages/wrf/package.py')
-rw-r--r--var/spack/repos/builtin/packages/wrf/package.py25
1 files changed, 23 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/wrf/package.py b/var/spack/repos/builtin/packages/wrf/package.py
index 1fcc8226d7..a12e943fa2 100644
--- a/var/spack/repos/builtin/packages/wrf/package.py
+++ b/var/spack/repos/builtin/packages/wrf/package.py
@@ -8,6 +8,7 @@ import re
import sys
import time
from os.path import basename
+from pathlib import Path
from subprocess import PIPE, Popen
from llnl.util import tty
@@ -171,9 +172,9 @@ class Wrf(Package):
patch("patches/4.2/add_aarch64.patch", when="@4.2:4.3.1 %gcc target=aarch64:")
patch("patches/4.2/add_aarch64_acfl.patch", when="@4.2:4.3.1 %arm target=aarch64:")
patch("patches/4.2/configure_aocc_2.3.patch", when="@4.2 %aocc@:2.4.0")
- patch("patches/4.2/configure_aocc_3.0.patch", when="@4.2: %aocc@3.0.0:3.2.0")
+ patch("patches/4.2/configure_aocc_3.0.patch", when="@4.2 %aocc@3.0.0:3.2.0")
patch("patches/4.2/hdf5_fix.patch", when="@4.2: %aocc")
- patch("patches/4.2/derf_fix.patch", when="@4.2 %aocc")
+ patch("patches/4.2/derf_fix.patch", when="@=4.2 %aocc")
patch(
"patches/4.2/add_tools_flags_acfl2304.patch",
when="@4.2:4.4.2 %arm@23.04.1: target=aarch64:",
@@ -293,6 +294,26 @@ class Wrf(Package):
filter_file("^#!/bin/csh -f", "#!/usr/bin/env csh", *files)
filter_file("^#!/bin/csh", "#!/usr/bin/env csh", *files)
+ @run_before("configure", when="%aocc@4:")
+ def create_aocc_config(self):
+ param = {
+ "MPICC": self.spec["mpi"].mpicc,
+ "MPIFC": self.spec["mpi"].mpifc,
+ "CTSM_SUBST": (
+ "-DWRF_USE_CLM" if self.spec.satisfies("@:4.2.2") else "CONFIGURE_D_CTSM"
+ ),
+ "NETCDFPAR_BUILD": (
+ "CONFIGURE_NETCDFPAR_BUILD" if self.spec.satisfies("@4.4.0:") else ""
+ ),
+ }
+
+ zen_conf = (Path(__file__).parent / "aocc_config.inc").read_text().format(**param)
+
+ if self.spec.satisfies("@4.0:"):
+ filter_file("#insert new stanza here", zen_conf, "arch/configure.defaults")
+ else:
+ filter_file("#insert new stanza here", zen_conf, "arch/configure_new.defaults")
+
def answer_configure_question(self, outputbuf):
# Platform options question:
if "Please select from among the following" in outputbuf: