From f9dfd5fcb88a22c2a686409fa15b3724de52c4cc Mon Sep 17 00:00:00 2001 From: Jakub Krajniak <563684+jkrajniak@users.noreply.github.com> Date: Thu, 2 Jun 2022 18:11:45 +0200 Subject: [PATCH] Add flag to enable WRF-Chem module (#30950) * Add flag to enable WRF-Chem module * Update var/spack/repos/builtin/packages/wrf/package.py Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com> * Set chem variant only for v4+ Co-authored-by: Tamara Dahlgren <35777542+tldahlgren@users.noreply.github.com> --- var/spack/repos/builtin/packages/wrf/package.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/var/spack/repos/builtin/packages/wrf/package.py b/var/spack/repos/builtin/packages/wrf/package.py index cf051f85bb..0f2663033c 100644 --- a/var/spack/repos/builtin/packages/wrf/package.py +++ b/var/spack/repos/builtin/packages/wrf/package.py @@ -110,6 +110,12 @@ class Wrf(Package): default=True, description="Parallel IO support through Pnetcdf library", ) + variant( + "chem", + default=False, + description="Enable WRF-Chem", + when="@4:" + ) patch("patches/3.9/netcdf_backport.patch", when="@3.9.1.1") patch("patches/3.9/tirpc_detect.patch", when="@3.9.1.1") @@ -195,6 +201,9 @@ def setup_build_environment(self, env): env.set("NETCDF", self.spec["netcdf-c"].prefix) if "+pnetcdf" in self.spec: env.set("PNETCDF", self.spec["parallel-netcdf"].prefix) + # Add WRF-Chem module + if "+chem" in self.spec: + env.set("WRF_CHEM", 1) # This gets used via the applied patch files env.set("NETCDFF", self.spec["netcdf-fortran"].prefix) env.set("PHDF5", self.spec["hdf5"].prefix)