summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/wrf/package.py134
-rw-r--r--var/spack/repos/builtin/packages/wrf/patches/3.9/fujitsu.patch73
-rw-r--r--var/spack/repos/builtin/packages/wrf/patches/3.9/netcdf_backport.patch14
-rw-r--r--var/spack/repos/builtin/packages/wrf/patches/4.0/Makefile.patch6
-rw-r--r--var/spack/repos/builtin/packages/wrf/patches/4.0/external.io_netcdf.makefile.patch4
-rw-r--r--var/spack/repos/builtin/packages/wrf/patches/4.2/arch.Config.pl.patch37
-rw-r--r--var/spack/repos/builtin/packages/wrf/patches/4.2/configure_fujitsu.patch52
-rw-r--r--var/spack/repos/builtin/packages/wrf/patches/4.3/Makefile.patch41
-rw-r--r--var/spack/repos/builtin/packages/wrf/patches/4.3/arch.postamble.patch34
-rw-r--r--var/spack/repos/builtin/packages/wrf/patches/4.3/fujitsu.patch10
10 files changed, 303 insertions, 102 deletions
diff --git a/var/spack/repos/builtin/packages/wrf/package.py b/var/spack/repos/builtin/packages/wrf/package.py
index 0e6ad8bc22..cd433c1ac2 100644
--- a/var/spack/repos/builtin/packages/wrf/package.py
+++ b/var/spack/repos/builtin/packages/wrf/package.py
@@ -7,7 +7,7 @@ import glob
import re
import time
from fcntl import F_GETFL, F_SETFL, fcntl
-from os import O_NONBLOCK, rename
+from os import O_NONBLOCK
from os.path import basename
from subprocess import PIPE, Popen
from sys import stdout
@@ -65,6 +65,9 @@ class Wrf(Package):
url = "https://github.com/wrf-model/WRF/archive/v4.2.tar.gz"
maintainers = ["MichaelLaufer", "ptooley"]
+ version("4.3.3", sha256='1b98b8673513f95716c7fc54e950dfebdb582516e22758cd94bc442bccfc0b86')
+ version("4.3.2", sha256='2c682da0cd0fd13f57d5125eef331f9871ec6a43d860d13b0c94a07fa64348ec')
+ version("4.3.1", sha256='6c9a69d05ee17d2c80b3699da173cfe6fdf65487db7587c8cc96bfa9ceafce87')
version("4.2", sha256="c39a1464fd5c439134bbd39be632f7ce1afd9a82ad726737e37228c6a3d74706")
version("4.0", sha256="9718f26ee48e6c348d8e28b8bc5e8ff20eafee151334b3959a11b7320999cf65")
version("3.9.1.1", sha256="a04f5c425bedd262413ec88192a0f0896572cc38549de85ca120863c43df047a", url="https://github.com/wrf-model/WRF/archive/V3.9.1.1.tar.gz")
@@ -109,6 +112,7 @@ class Wrf(Package):
patch("patches/3.9/configure_aocc_2.3.patch", when="@3.9.1.1 %aocc@:2.4.0")
patch("patches/3.9/configure_aocc_3.0.patch", when="@3.9.1.1 %aocc@3.0.0")
patch("patches/3.9/configure_aocc_3.1.patch", when="@3.9.1.1 %aocc@3.1.0")
+ patch("patches/3.9/fujitsu.patch", when="@3.9.1.1 %fj")
# These patches deal with netcdf & netcdf-fortran being two diff things
# Patches are based on:
@@ -123,20 +127,33 @@ class Wrf(Package):
patch("patches/4.0/tirpc_detect.patch", when="@4.0")
patch("patches/4.0/add_aarch64.patch", when="@4.0")
- patch("patches/4.2/arch.Config.pl.patch", when="@4.2")
+ patch("patches/4.2/arch.Config.pl.patch", when="@4.2:")
patch("patches/4.2/arch.configure.defaults.patch", when="@4.2")
- patch("patches/4.2/arch.conf_tokens.patch", when="@4.2")
+ patch("patches/4.2/arch.conf_tokens.patch", when="@4.2:")
patch("patches/4.2/arch.postamble.patch", when="@4.2")
- patch("patches/4.2/configure.patch", when="@4.2")
- patch("patches/4.2/external.io_netcdf.makefile.patch", when="@4.2")
- patch("patches/4.2/var.gen_be.Makefile.patch", when="@4.2")
+ patch("patches/4.2/configure.patch", when="@4.2:")
+ patch("patches/4.2/external.io_netcdf.makefile.patch", when="@4.2:")
+ patch("patches/4.2/var.gen_be.Makefile.patch", when="@4.2:")
patch("patches/4.2/Makefile.patch", when="@4.2")
patch("patches/4.2/tirpc_detect.patch", when="@4.2")
- patch("patches/4.2/add_aarch64.patch", when="@4.2")
+ patch("patches/4.2/add_aarch64.patch", when="@4.2:")
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/hdf5_fix.patch", when="@4.2 %aocc")
patch("patches/4.2/derf_fix.patch", when="@4.2 %aocc")
+ # Various syntax fixes found by FPT tool
+ patch("https://github.com/wrf-model/WRF/commit/6502d5d9c15f5f9a652dec244cc12434af737c3c.patch",
+ sha256="d685a77c82d770f2af4e66711effa0cb115e2bc6e601de4cb92f15b138c6c85b", when="@4.2 %fj")
+ patch("patches/4.2/configure_fujitsu.patch", when="@4 %fj")
+
+ patch("patches/4.3/Makefile.patch", when="@4.3:")
+ patch("patches/4.3/arch.postamble.patch", when="@4.3:")
+ patch("patches/4.3/fujitsu.patch", when="@4.3: %fj")
+ # Syntax errors in physics routines
+ patch("https://github.com/wrf-model/WRF/commit/7c6fd575b7a8fe5715b07b38db160e606c302956.patch",
+ sha256="bc24b6c8a073837404dbd33b0a4402843bd4771441dd766899d9274583db683f", when="@4.3.1")
+ patch("https://github.com/wrf-model/WRF/commit/238a7d219b7c8e285db28fe4f0c96ebe5068d91c.patch",
+ sha256="d3fe347fd57c0f989744113c0bc8faf98bab2dd4e88867efa4b154c2b4265636", when="@4.3.1")
depends_on("pkgconfig", type=("build"))
depends_on("libtirpc")
@@ -164,6 +181,11 @@ class Wrf(Package):
depends_on("libtool", type="build")
phases = ["configure", "build", "install"]
+ def setup_run_environment(self, env):
+ env.set("WRF_HOME", self.prefix)
+ env.append_path("PATH", self.prefix.main)
+ env.append_path("PATH", self.prefix.tools)
+
def setup_build_environment(self, env):
env.set("NETCDF", self.spec["netcdf-c"].prefix)
if "+pnetcdf" in self.spec:
@@ -229,86 +251,43 @@ class Wrf(Package):
def do_configure_fixup(self):
# Fix mpi compiler wrapper aliases
+
+ # In version 4.2 the file to be patched is called
+ # configure.defaults, while in earlier versions
+ # it's configure_new.defaults
+ if self.spec.satisfies("@3.9.1.1"):
+ config = FileFilter(join_path('arch', 'configure_new.defaults'))
+ else:
+ config = FileFilter(join_path('arch', 'configure.defaults'))
+
if self.spec.satisfies("@3.9.1.1 %gcc"):
- rename(
- "./arch/configure_new.defaults",
- "./arch/configure_new.defaults.bak",
- )
- with open("./arch/configure_new.defaults.bak", "rt") as ifh:
- with open("./arch/configure_new.defaults", "wt") as ofh:
- for line in ifh:
- if line.startswith("DM_"):
- line = line.replace(
- "mpif90 -f90=$(SFC)", self.spec['mpi'].mpifc
- )
- line = line.replace(
- "mpicc -cc=$(SCC)", self.spec['mpi'].mpicc
- )
- ofh.write(line)
+ config.filter('^DM_FC.*mpif90 -f90=$(SFC)',
+ 'DM_FC = {0}'.format(self.spec['mpi'].mpifc))
+ config.filter('^DM_CC.*mpicc -cc=$(SCC))',
+ 'DM_CC = {0}'.format(self.spec['mpi'].mpicc))
- if self.spec.satisfies("@3.9.1.1 %aocc"):
- rename(
- "./arch/configure_new.defaults",
- "./arch/configure_new.defaults.bak",
- )
- with open("./arch/configure_new.defaults.bak", "rt") as ifh:
- with open("./arch/configure_new.defaults", "wt") as ofh:
- for line in ifh:
- if line.startswith("DM_"):
- line = line.replace(
- "mpif90 -DMPI2_SUPPORT",
- self.spec['mpi'].mpifc + " -DMPI2_SUPPORT"
- )
- line = line.replace(
- "mpicc -DMPI2_SUPPORT",
- self.spec['mpi'].mpicc + " -DMPI2_SUPPORT"
- )
- ofh.write(line)
-
- if self.spec.satisfies("@4.2 %aocc"):
- # In version 4.2 the file to be patched is called
- # configure.defaults, while in earlier versions
- # it's configure_new.defaults
- rename(
- "./arch/configure.defaults",
- "./arch/configure.defaults.bak",
+ if self.spec.satisfies("%aocc"):
+ config.filter(
+ '^DM_FC.*mpif90 -DMPI2SUPPORT',
+ 'DM_FC = {0}'.format(self.spec['mpi'].mpifc + ' -DMPI2_SUPPORT')
)
- with open("./arch/configure.defaults.bak", "rt") as ifh:
- with open("./arch/configure.defaults", "wt") as ofh:
- for line in ifh:
- if line.startswith("DM_"):
- line = line.replace(
- "mpif90 -DMPI2_SUPPORT",
- self.spec['mpi'].mpifc + " -DMPI2_SUPPORT"
- )
- line = line.replace(
- "mpicc -DMPI2_SUPPORT",
- self.spec['mpi'].mpicc + " -DMPI2_SUPPORT"
- )
- ofh.write(line)
-
- if self.spec.satisfies("@4.2 %intel"):
- # In version 4.2 the file to be patched is called
- # configure.defaults, while in earlier versions
- # it's configure_new.defaults
- rename(
- "./arch/configure.defaults",
- "./arch/configure.defaults.bak",
+ config.filter(
+ '^DM_.CC*mpicc -DMPI2SUPPORT',
+ 'DM_CC = {0}'.format(self.spec['mpi'].mpicc) + ' -DMPI2_SUPPORT'
)
- with open("./arch/configure.defaults.bak", "rt") as ifh:
- with open("./arch/configure.defaults", "wt") as ofh:
- for line in ifh:
- if line.startswith("DM_"):
- line = line.replace("mpif90", self.spec['mpi'].mpifc)
- line = line.replace("mpicc", self.spec['mpi'].mpicc)
- ofh.write(line)
+
+ if self.spec.satisfies("@4.2: %intel"):
+ config.filter('^DM_FC.*mpif90',
+ 'DM_FC = {0}'.format(self.spec['mpi'].mpifc))
+ config.filter('^DM_CC.*mpicc',
+ 'DM_CC = {0}'.format(self.spec['mpi'].mpicc))
def configure(self, spec, prefix):
# Remove broken default options...
self.do_configure_fixup()
- if self.spec.compiler.name not in ["intel", "gcc", "aocc"]:
+ if self.spec.compiler.name not in ["intel", "gcc", "aocc", "fj"]:
raise InstallError(
"Compiler %s not currently supported for WRF build."
% self.spec.compiler.name
@@ -381,6 +360,7 @@ class Wrf(Package):
error=str
)
+ print(result_buf)
if "Executables successfully built" in result_buf:
return True
diff --git a/var/spack/repos/builtin/packages/wrf/patches/3.9/fujitsu.patch b/var/spack/repos/builtin/packages/wrf/patches/3.9/fujitsu.patch
new file mode 100644
index 0000000000..e4ab53b55a
--- /dev/null
+++ b/var/spack/repos/builtin/packages/wrf/patches/3.9/fujitsu.patch
@@ -0,0 +1,73 @@
+--- WRF-3.9.1.1.orig/arch/Config_new.pl 2021-09-29 14:14:23.000000000 +0900
++++ WRF-3.9.1.1/arch/Config_new.pl 2021-10-04 19:25:57.000000000 +0900
+@@ -516,7 +516,7 @@ while ( <CONFIGURE_DEFAULTS> )
+ }
+
+ if ( $sw_hdf5_path )
+- { $_ =~ s:CONFIGURE_HDF5_LIB_PATH:-L$sw_hdf5_path/lib -lhdf5_fortran -lhdf5 -lm -lz: ;
++ { $_ =~ s:CONFIGURE_HDF5_LIB_PATH:-L$sw_hdf5_path/lib -ltirpc -lhdf5_fortran -lhdf5 -lm -lz: ;
+ $_ =~ s:CONFIGURE_HDF5_FLAG:-DHDF5: ;
+ }
+ else
+--- WRF-3.9.1.1.orig/external/RSL_LITE/module_dm.F 2021-09-29 14:14:21.000000000 +0900
++++ WRF-3.9.1.1/external/RSL_LITE/module_dm.F 2021-09-29 14:43:17.000000000 +0900
+@@ -1313,7 +1313,7 @@ CONTAINS
+ REAL FUNCTION wrf_dm_max_int ( inval )
+ IMPLICIT NONE
+ #ifndef STUBMPI
+- INCLUDE 'mpif.h'
++! INCLUDE 'mpif.h'
+ INTEGER, intent(in) :: inval
+ INTEGER :: ierr, retval
+ CALL mpi_allreduce ( inval, retval , 1, MPI_INT, MPI_MAX, local_communicator, ierr )
+--- WRF-3.9.1.1.orig/arch/configure_new.defaults 2021-09-30 09:18:18.000000000 +0900
++++ WRF-3.9.1.1/arch/configure_new.defaults 2021-09-30 09:25:42.000000000 +0900
+@@ -1961,6 +1961,48 @@ RANLIB = ranlib
+ RLFLAGS =
+ CC_TOOLS = /usr/bin/gcc -Wall
+
++###########################################################
++#ARCH Fujitsu FX1000/FX700 Linux aarch64 A64FX, mpifrt and mpifcc compilers #serial smpar dmpar dm+sm
++#
++DESCRIPTION = FUJITSU ($SFC/$SCC): FX1000/FX700 A64FX
++DMPARALLEL = # 1
++OMPCPP = # -D_OPENMP
++OMP = # -Kopenmp
++OMPCC = # -Kopenmp
++SFC = frt
++SCC = fcc
++CCOMP = fcc
++DM_FC = mpifrt
++DM_CC = mpifcc -DMPI2_SUPPORT -DMPI2_THREAD_SUPPORT
++FC = CONFIGURE_FC
++CC = CONFIGURE_CC
++LD = $(FC)
++RWORDSIZE = CONFIGURE_RWORDSIZE
++PROMOTION = -CcdRR$(RWORDSIZE)
++ARCH_LOCAL = -DNONSTANDARD_SYSTEM_SUBR -DWRF_USE_CLM
++CFLAGS_LOCAL = -Kfast -DSUN -I/usr/include/tirpc
++LDFLAGS_LOCAL =
++CPLUSPLUSLIB =
++ESMF_LDFLAG = $(CPLUSPLUSLIB)
++FCOPTIM = -Kfast
++FCREDUCEDOPT = $(FCOPTIM)
++FCNOOPT = -O0
++FCDEBUG = # -g $(FCNOOPT)
++FORMAT_FIXED = -Fixed
++FORMAT_FREE = -Free
++FCSUFFIX =
++BYTESWAPIO =
++FCBASEOPTS_NO_G = -Kautoobjstack,ocl -fw $(FORMAT_FREE) $(BYTESWAPIO) $(OMP)
++FCBASEOPTS = $(FCBASEOPTS_NO_G) $(FCDEBUG)
++MODULE_SRCH_FLAG =
++TRADFLAG = -traditional
++CPP = /lib/cpp -P
++AR = ar
++ARFLAGS = ru
++M4 = m4
++RANLIB = ranlib
++RLFLAGS =
++CC_TOOLS = /usr/bin/gcc -Wall
+ #insert new stanza before the Fujitsu block, keep Fujitsu at the end of the list
+ ###########################################################
+ #ARCH NULL
diff --git a/var/spack/repos/builtin/packages/wrf/patches/3.9/netcdf_backport.patch b/var/spack/repos/builtin/packages/wrf/patches/3.9/netcdf_backport.patch
index ca0c5067c8..fe82b6e6d3 100644
--- a/var/spack/repos/builtin/packages/wrf/patches/3.9/netcdf_backport.patch
+++ b/var/spack/repos/builtin/packages/wrf/patches/3.9/netcdf_backport.patch
@@ -7,16 +7,16 @@ diff -Naur a/Makefile b/Makefile
cd ../external/io_netcdf ; \
- $(MAKE) NETCDFPATH="$(NETCDFPATH)" \
- FC="$(FC) $(FCBASEOPTS) $(PROMOTION) $(FCDEBUG) $(OMP)" RANLIB="$(RANLIB)" \
-+ $(MAKE) NETCDFPATH="$(NETCDFPATH)" FNETCDFFPATH="$(NETCDFFPATH)" \
-+ C="$(FC) $(FCBASEOPTS) $(PROMOTION) $(FCDEBUG) $(OMP)" RANLIB="$(RANLIB)" \
++ $(MAKE) NETCDFPATH="$(NETCDFPATH)" NETCDFFPATH="$(NETCDFFPATH)" \
++ FC="$(FC) $(FCBASEOPTS) $(PROMOTION) $(FCDEBUG) $(OMP)" RANLIB="$(RANLIB)" \
CPP="$(CPP)" LDFLAGS="$(LDFLAGS)" TRADFLAG="$(TRADFLAG)" ESMF_IO_LIB_EXT="$(ESMF_IO_LIB_EXT)" \
LIB_LOCAL="$(LIB_LOCAL)" \
ESMF_MOD_DEPENDENCE="$(ESMF_MOD_DEPENDENCE)" AR="INTERNAL_BUILD_ERROR_SHOULD_NOT_NEED_AR" diffwrf; \
cd ../io_netcdf ; \
- $(MAKE) NETCDFPATH="$(NETCDFPATH)" \
- FC="$(SFC) $(FCBASEOPTS) $(PROMOTION) $(FCDEBUG) $(OMP)" RANLIB="$(RANLIB)" \
-+ $(MAKE) NETCDFPATH="$(NETCDFPATH)" FNETCDFFPATH="$(NETCDFFPATH)"\
-+ C="$(SFC) $(FCBASEOPTS) $(PROMOTION) $(FCDEBUG) $(OMP)" RANLIB="$(RANLIB)" \
++ $(MAKE) NETCDFPATH="$(NETCDFPATH)" NETCDFFPATH="$(NETCDFFPATH)"\
++ FC="$(SFC) $(FCBASEOPTS) $(PROMOTION) $(FCDEBUG) $(OMP)" RANLIB="$(RANLIB)" \
CPP="$(CPP)" LDFLAGS="$(LDFLAGS)" TRADFLAG="$(TRADFLAG)" ESMF_IO_LIB_EXT="$(ESMF_IO_LIB_EXT)" \
LIB_LOCAL="$(LIB_LOCAL)" \
ESMF_MOD_DEPENDENCE="$(ESMF_MOD_DEPENDENCE)" AR="INTERNAL_BUILD_ERROR_SHOULD_NOT_NEED_AR"; \
@@ -226,8 +226,8 @@ diff -Naur a/external/io_netcdf/makefile b/external/io_netcdf/makefile
-LIBS = $(LIB_LOCAL) -L$(NETCDFPATH)/lib -lnetcdf
-LIBFFS = $(LIB_LOCAL) -L$(NETCDFPATH)/lib -lnetcdff -lnetcdf $(NETCDF4_DEP_LIB)
+FFLAGS = $(FCFLAGS) -I$(NETCDFFPATH)/include -I../ioapi_share
-+LIBS = $(LIB_LOCAL) -L$(NETCDFFPATH)/lib -lnetcdf
-+LIBFFS = $(LIB_LOCAL) -L$(NETCDFFPATH)/lib -lnetcdff -lnetcdf $(NETCDF4_DEP_LIB)
++LIBS = $(LIB_LOCAL) -L$(NETCDFPATH)/lib -lnetcdf
++LIBFFS = $(LIB_LOCAL) -L$(NETCDFFPATH)/lib -lnetcdff -L$(NETCDFPATH)/lib -lnetcdf $(NETCDF4_DEP_LIB)
CPP1 = $(CPP) -P $(TRADFLAG)
M4 = m4 -Uinclude -Uindex -Ulen
AR = ar
@@ -254,7 +254,7 @@ diff -Naur a/external/io_netcdf/makefile b/external/io_netcdf/makefile
@if [ \( -f ../../frame/wrf_debug.o \) -a \( -f ../../frame/module_wrf_error.o \) -a \( -f $(ESMF_MOD_DEPENDENCE) \) -a \( -f ../../frame/clog.o \) ] ; then \
echo "diffwrf io_netcdf is being built now. " ; \
- if [ \( -f $(NETCDFPATH)/lib/libnetcdff.a -o -f $(NETCDFPATH)/lib/libnetcdff.so \) ] ; then \
-+ if [ \( -f $(NETCDFFPATH)/lib/libnetcdff.a -o -f $(NETCDFPATH)/lib/libnetcdff.so \) ] ; then \
++ if [ \( -f $(NETCDFFPATH)/lib/libnetcdff.a -o -f $(NETCDFFPATH)/lib/libnetcdff.so \) ] ; then \
$(FC) $(FFLAGS) $(LDFLAGS) -o diffwrf diffwrf.o $(OBJSL) ../../frame/wrf_debug.o ../../frame/module_wrf_error.o ../../frame/clog.o $(ESMF_IO_LIB_EXT) $(LIBFFS) ;\
else \
$(FC) $(FFLAGS) $(LDFLAGS) -o diffwrf diffwrf.o $(OBJSL) ../../frame/wrf_debug.o ../../frame/module_wrf_error.o ../../frame/clog.o $(ESMF_IO_LIB_EXT) $(LIBS) ;\
diff --git a/var/spack/repos/builtin/packages/wrf/patches/4.0/Makefile.patch b/var/spack/repos/builtin/packages/wrf/patches/4.0/Makefile.patch
index 5fb99e78ae..e1c29a3178 100644
--- a/var/spack/repos/builtin/packages/wrf/patches/4.0/Makefile.patch
+++ b/var/spack/repos/builtin/packages/wrf/patches/4.0/Makefile.patch
@@ -6,8 +6,8 @@
cd ../external/io_netcdf ; \
- $(MAKE) NETCDFPATH="$(NETCDFPATH)" \
- FC="$(FC) $(FCBASEOPTS) $(PROMOTION) $(FCDEBUG) $(OMP)" RANLIB="$(RANLIB)" \
-+ $(MAKE) NETCDFPATH="$(NETCDFPATH)" FNETCDFFPATH="$(NETCDFFPATH)" \
-+ C="$(FC) $(FCBASEOPTS) $(PROMOTION) $(FCDEBUG) $(OMP)" RANLIB="$(RANLIB)" \
++ $(MAKE) NETCDFPATH="$(NETCDFPATH)" NETCDFFPATH="$(NETCDFFPATH)" \
++ FC="$(FC) $(FCBASEOPTS) $(PROMOTION) $(FCDEBUG) $(OMP)" RANLIB="$(RANLIB)" \
CPP="$(CPP)" LDFLAGS="$(LDFLAGS)" TRADFLAG="$(TRADFLAG)" ESMF_IO_LIB_EXT="$(ESMF_IO_LIB_EXT)" \
LIB_LOCAL="$(LIB_LOCAL)" \
ESMF_MOD_DEPENDENCE="$(ESMF_MOD_DEPENDENCE)" AR="INTERNAL_BUILD_ERROR_SHOULD_NOT_NEED_AR" diffwrf; \
@@ -15,7 +15,7 @@
- $(MAKE) NETCDFPATH="$(NETCDFPATH)" \
- FC="$(SFC) $(FCBASEOPTS) $(PROMOTION) $(FCDEBUG) $(OMP)" RANLIB="$(RANLIB)" \
+ $(MAKE) NETCDFPATH="$(NETCDFPATH)" FNETCDFFPATH="$(NETCDFFPATH)" \
-+ C="$(SFC) $(FCBASEOPTS) $(PROMOTION) $(FCDEBUG) $(OMP)" RANLIB="$(RANLIB)" \
++ FC="$(SFC) $(FCBASEOPTS) $(PROMOTION) $(FCDEBUG) $(OMP)" RANLIB="$(RANLIB)" \
CPP="$(CPP)" LDFLAGS="$(LDFLAGS)" TRADFLAG="$(TRADFLAG)" ESMF_IO_LIB_EXT="$(ESMF_IO_LIB_EXT)" \
LIB_LOCAL="$(LIB_LOCAL)" \
ESMF_MOD_DEPENDENCE="$(ESMF_MOD_DEPENDENCE)" AR="INTERNAL_BUILD_ERROR_SHOULD_NOT_NEED_AR"; \
diff --git a/var/spack/repos/builtin/packages/wrf/patches/4.0/external.io_netcdf.makefile.patch b/var/spack/repos/builtin/packages/wrf/patches/4.0/external.io_netcdf.makefile.patch
index 5572f63860..8b37f603d1 100644
--- a/var/spack/repos/builtin/packages/wrf/patches/4.0/external.io_netcdf.makefile.patch
+++ b/var/spack/repos/builtin/packages/wrf/patches/4.0/external.io_netcdf.makefile.patch
@@ -8,8 +8,8 @@
-LIBS = $(LIB_LOCAL) -L$(NETCDFPATH)/lib -lnetcdf
-LIBFFS = $(LIB_LOCAL) -L$(NETCDFPATH)/lib -lnetcdff -lnetcdf $(NETCDF4_DEP_LIB)
+FFLAGS = $(FCFLAGS) -I$(NETCDFFPATH)/include -I../ioapi_share
-+LIBS = $(LIB_LOCAL) -L$(NETCDFFPATH)/lib -lnetcdf
-+LIBFFS = $(LIB_LOCAL) -L$(NETCDFFPATH)/lib -lnetcdff -lnetcdf $(NETCDF4_DEP_LIB)
++LIBS = $(LIB_LOCAL) -L$(NETCDFPATH)/lib -lnetcdf
++LIBFFS = $(LIB_LOCAL) -L$(NETCDFPATH)/lib -lnetcdff -L$(NETCDFFPATH)/lib -lnetcdf $(NETCDF4_DEP_LIB)
CPP1 = $(CPP) -P $(TRADFLAG)
M4 = m4 -Uinclude -Uindex -Ulen
AR = ar
diff --git a/var/spack/repos/builtin/packages/wrf/patches/4.2/arch.Config.pl.patch b/var/spack/repos/builtin/packages/wrf/patches/4.2/arch.Config.pl.patch
index ca3840ac55..81a1a5e56d 100644
--- a/var/spack/repos/builtin/packages/wrf/patches/4.2/arch.Config.pl.patch
+++ b/var/spack/repos/builtin/packages/wrf/patches/4.2/arch.Config.pl.patch
@@ -1,16 +1,15 @@
-diff --git a/arch/Config.pl b/arch/Config.pl
-index b6f45db..75fad32 100644
---- a/arch/Config.pl
-+++ b/arch/Config.pl
-@@ -8,6 +8,7 @@
- select((select(STDOUT), $|=1)[0]);
- $sw_perl_path = perl ;
+diff -ru a/arch/Config.pl b/arch/Config.pl
+--- a/arch/Config.pl 2021-10-28 17:42:41.000000000 +0900
++++ b/arch/Config.pl 2021-10-28 17:48:01.000000000 +0900
+@@ -11,6 +11,7 @@
+ $sw_tirpc_lib = "";
+ $sw_tirpc_libdir = "";
$sw_netcdf_path = "" ;
+$sw_netcdff_path = "" ;
$sw_pnetcdf_path = "" ;
$sw_hdf5_path="";
$sw_phdf5_path="";
-@@ -63,6 +64,10 @@ while ( substr( $ARGV[0], 0, 1 ) eq "-" )
+@@ -75,6 +76,10 @@
{
$sw_netcdf_path = substr( $ARGV[0], 8 ) ;
}
@@ -21,7 +20,7 @@ index b6f45db..75fad32 100644
if ( substr( $ARGV[0], 1, 13 ) eq "dep_lib_path=" )
{
$sw_dep_lib_path = substr( $ARGV[0], 14 ) ;
-@@ -117,6 +122,7 @@ while ( substr( $ARGV[0], 0, 1 ) eq "-" )
+@@ -129,6 +134,7 @@
if ( substr( $ARGV[0], 1, 11 ) eq "USENETCDFF=" )
{
$sw_usenetcdff = substr( $ARGV[0], 12 ) ;
@@ -29,15 +28,15 @@ index b6f45db..75fad32 100644
}
if ( substr( $ARGV[0], 1, 10 ) eq "USENETCDF=" )
{
-@@ -443,6 +449,7 @@ while ( <CONFIGURE_DEFAULTS> )
- {
- $_ =~ s/CONFIGURE_PERL_PATH/$sw_perl_path/g ;
+@@ -457,6 +463,7 @@
+ $_ =~ s/CONFIGURE_TIRPC_INC/$sw_tirpc_inc/g ;
+ $_ =~ s/CONFIGURE_TIRPC_LIB/$sw_tirpc_libdir $sw_tirpc_lib/g ;
$_ =~ s/CONFIGURE_NETCDF_PATH/$sw_netcdf_path/g ;
+ $_ =~ s/CONFIGURE_NETCDFF_PATH/$sw_netcdff_path/g ;
$_ =~ s/CONFIGURE_PNETCDF_PATH/$sw_pnetcdf_path/g ;
$_ =~ s/CONFIGURE_HDF5_PATH/$sw_hdf5_path/g ;
$_ =~ s/CONFIGURE_PHDF5_PATH/$sw_phdf5_path/g ;
-@@ -484,17 +491,19 @@ while ( <CONFIGURE_DEFAULTS> )
+@@ -498,17 +505,19 @@
if ( $sw_netcdf_path )
{ $_ =~ s/CONFIGURE_WRFIO_NF/wrfio_nf/g ;
$_ =~ s:CONFIGURE_NETCDF_FLAG:-DNETCDF: ;
@@ -60,3 +59,15 @@ index b6f45db..75fad32 100644
$_ =~ s:CONFIGURE_NETCDF_LIB_PATH::g ;
}
+@@ -823,9 +832,9 @@
+ if ( $ENV{NETCDF_LDFLAGS} ) {
+ $_ =~ s:CONFIGURE_NETCDF_LIB_PATH:\$\(WRF_SRC_ROOT_DIR\)/external/io_netcdf/libwrfio_nf.a $ENV{NETCDF_LDFLAGS} : ;
+ } elsif ( $sw_os eq "Interix" ) {
+- $_ =~ s:CONFIGURE_NETCDF_LIB_PATH:\$\(WRF_SRC_ROOT_DIR\)/external/io_netcdf/libwrfio_nf.a -L$sw_netcdf_path/lib $sw_usenetcdff $sw_usenetcdf : ;
++ $_ =~ s:CONFIGURE_NETCDF_LIB_PATH:\$\(WRF_SRC_ROOT_DIR\)/external/io_netcdf/libwrfio_nf.a -L$sw_netcdf_path/lib -L$sw_netcdff_path/lib $sw_usenetcdff $sw_usenetcdf : ;
+ } else {
+- $_ =~ s:CONFIGURE_NETCDF_LIB_PATH:-L\$\(WRF_SRC_ROOT_DIR\)/external/io_netcdf -lwrfio_nf -L$sw_netcdf_path/lib $sw_usenetcdff $sw_usenetcdf : ;
++ $_ =~ s:CONFIGURE_NETCDF_LIB_PATH:-L\$\(WRF_SRC_ROOT_DIR\)/external/io_netcdf -lwrfio_nf -L$sw_netcdf_path/lib -L$sw_netcdff_path/lib $sw_usenetcdff $sw_usenetcdf : ;
+ }
+ }
+ else
diff --git a/var/spack/repos/builtin/packages/wrf/patches/4.2/configure_fujitsu.patch b/var/spack/repos/builtin/packages/wrf/patches/4.2/configure_fujitsu.patch
new file mode 100644
index 0000000000..b781b786c1
--- /dev/null
+++ b/var/spack/repos/builtin/packages/wrf/patches/4.2/configure_fujitsu.patch
@@ -0,0 +1,52 @@
+--- spack-src/arch/configure.defaults.org 2021-10-26 13:21:41.000000000 +0900
++++ spack-src/arch/configure.defaults 2021-10-26 13:24:04.000000000 +0900
+@@ -2019,6 +2019,49 @@
+ RLFLAGS =
+ CC_TOOLS = /usr/bin/gcc -Wall
+
++###########################################################
++#ARCH Fujitsu FX1000/FX700 Linux aarch64 A64FX, mpifrt and mpifcc compilers #serial smpar dmpar dm+sm
++#
++DESCRIPTION = FUJITSU ($SFC/$SCC): FX1000/FX700 A64FX
++DMPARALLEL = # 1
++OMPCPP = # -D_OPENMP
++OMP = # -Kopenmp
++OMPCC = # -Kopenmp
++SFC = frt
++SCC = fcc
++CCOMP = fcc
++DM_FC = mpifrt
++DM_CC = mpifcc -DMPI2_SUPPORT -DMPI2_THREAD_SUPPORT
++FC = CONFIGURE_FC
++CC = CONFIGURE_CC
++LD = $(FC)
++RWORDSIZE = CONFIGURE_RWORDSIZE
++PROMOTION = -CcdRR$(RWORDSIZE)
++ARCH_LOCAL = -DNONSTANDARD_SYSTEM_SUBR -DWRF_USE_CLM
++CFLAGS_LOCAL = -Kfast -DSUN -I/usr/include/tirpc
++LDFLAGS_LOCAL =
++CPLUSPLUSLIB =
++ESMF_LDFLAG = $(CPLUSPLUSLIB)
++FCOPTIM = -Kfast
++FCREDUCEDOPT = $(FCOPTIM)
++FCNOOPT = -O0
++FCDEBUG = # -g $(FCNOOPT)
++FORMAT_FIXED = -Fixed
++FORMAT_FREE = -Free
++FCSUFFIX =
++BYTESWAPIO =
++FCBASEOPTS_NO_G = -Kautoobjstack,ocl -fw $(FORMAT_FREE) $(BYTESWAPIO) $(OMP)
++FCBASEOPTS = $(FCBASEOPTS_NO_G) $(FCDEBUG)
++MODULE_SRCH_FLAG =
++TRADFLAG = -traditional
++CPP = /lib/cpp -P
++AR = ar
++ARFLAGS = ru
++M4 = m4
++RANLIB = ranlib
++RLFLAGS =
++CC_TOOLS = /usr/bin/gcc -Wall
++
+ #insert new stanza before the Fujitsu block, keep Fujitsu at the end of the list
+ ###########################################################
+ #ARCH NULL
diff --git a/var/spack/repos/builtin/packages/wrf/patches/4.3/Makefile.patch b/var/spack/repos/builtin/packages/wrf/patches/4.3/Makefile.patch
new file mode 100644
index 0000000000..00a172b931
--- /dev/null
+++ b/var/spack/repos/builtin/packages/wrf/patches/4.3/Makefile.patch
@@ -0,0 +1,41 @@
+--- a/Makefile 2021-11-01 15:24:26.000000000 +0900
++++ b/Makefile 2021-11-01 15:30:08.000000000 +0900
+@@ -1003,13 +1003,13 @@
+ @ echo '--------------------------------------'
+ ( cd frame ; $(MAKE) $(J) LLIST="$(LINKLIST)" framework ; \
+ cd ../external/io_netcdf ; \
+- $(MAKE) NETCDFPATH="$(NETCDFPATH)" \
++ $(MAKE) NETCDFPATH="$(NETCDFPATH)" NETCDFFPATH="$(NETCDFFPATH)" \
+ FC="$(FC) $(FCBASEOPTS) $(PROMOTION) $(FCDEBUG) $(OMP)" RANLIB="$(RANLIB)" \
+ CPP="$(CPP)" LDFLAGS="$(LDFLAGS)" TRADFLAG="$(TRADFLAG)" ESMF_IO_LIB_EXT="$(ESMF_IO_LIB_EXT)" \
+ LIB_LOCAL="$(LIB_LOCAL)" \
+ ESMF_MOD_DEPENDENCE="$(ESMF_MOD_DEPENDENCE)" AR="INTERNAL_BUILD_ERROR_SHOULD_NOT_NEED_AR" diffwrf; \
+ cd ../io_netcdf ; \
+- $(MAKE) NETCDFPATH="$(NETCDFPATH)" \
++ $(MAKE) NETCDFPATH="$(NETCDFPATH)" NETCDFFPATH="$(NETCDFFPATH)" \
+ FC="$(SFC) $(FCBASEOPTS) $(PROMOTION) $(FCDEBUG) $(OMP)" RANLIB="$(RANLIB)" \
+ CPP="$(CPP)" LDFLAGS="$(LDFLAGS)" TRADFLAG="$(TRADFLAG)" ESMF_IO_LIB_EXT="$(ESMF_IO_LIB_EXT)" \
+ LIB_LOCAL="$(LIB_LOCAL)" \
+@@ -1032,19 +1032,19 @@
+ @ echo '--------------------------------------'
+ ( cd frame ; $(MAKE) $(J) LLIST="$(MODLL)" framework ; \
+ cd ../external/io_netcdf ; \
+- $(MAKE) NETCDFPATH="$(NETCDFPATH)" \
++ $(MAKE) NETCDFPATH="$(NETCDFPATH)" NETCDFFPATH="$(NETCDFFPATH)"\
+ FC="$(FC) $(FCBASEOPTS) $(PROMOTION) $(FCDEBUG) $(OMP)" RANLIB="$(RANLIB)" \
+ CPP="$(CPP)" LDFLAGS="$(LDFLAGS)" TRADFLAG="$(TRADFLAG)" ESMF_IO_LIB_EXT="$(ESMF_IO_LIB_EXT)" \
+ LIB_LOCAL="$(LIB_LOCAL)" \
+ ESMF_MOD_DEPENDENCE="$(ESMF_MOD_DEPENDENCE)" AR="INTERNAL_BUILD_ERROR_SHOULD_NOT_NEED_AR" diffwrf; \
+ cd ../io_netcdf ; \
+- $(MAKE) NETCDFPATH="$(NETCDFPATH)" \
++ $(MAKE) NETCDFPATH="$(NETCDFPATH)" NETCDFFPATH="$(NETCDFFPATH)"\
+ FC="$(SFC) $(FCBASEOPTS) $(PROMOTION) $(FCDEBUG) $(OMP)" RANLIB="$(RANLIB)" \
+ CPP="$(CPP)" LDFLAGS="$(LDFLAGS)" TRADFLAG="$(TRADFLAG)" ESMF_IO_LIB_EXT="$(ESMF_IO_LIB_EXT)" \
+ LIB_LOCAL="$(LIB_LOCAL)" \
+ ESMF_MOD_DEPENDENCE="$(ESMF_MOD_DEPENDENCE)" AR="INTERNAL_BUILD_ERROR_SHOULD_NOT_NEED_AR"; \
+ cd ../io_pio ; \
+- echo SKIPPING PIO BUILD $(MAKE) NETCDFPATH="$(PNETCDFPATH)" \
++ echo SKIPPING PIO BUILD $(MAKE) NETCDFPATH="$(PNETCDFPATH)" NETCDFFPATH="$(NETCDFFPATH)"\
+ FC="$(SFC) $(FCBASEOPTS) $(PROMOTION) $(FCDEBUG) $(OMP)" RANLIB="$(RANLIB)" \
+ CPP="$(CPP)" LDFLAGS="$(LDFLAGS)" TRADFLAG="$(TRADFLAG)" ESMF_IO_LIB_EXT="$(ESMF_IO_LIB_EXT)" \
+ LIB_LOCAL="$(LIB_LOCAL)" \
diff --git a/var/spack/repos/builtin/packages/wrf/patches/4.3/arch.postamble.patch b/var/spack/repos/builtin/packages/wrf/patches/4.3/arch.postamble.patch
new file mode 100644
index 0000000000..12df22d9a2
--- /dev/null
+++ b/var/spack/repos/builtin/packages/wrf/patches/4.3/arch.postamble.patch
@@ -0,0 +1,34 @@
+--- a/arch/postamble 2021-11-01 16:51:50.000000000 +0900
++++ b/arch/postamble 2021-11-01 16:54:34.000000000 +0900
+@@ -53,6 +53,7 @@
+ -I$(WRF_SRC_ROOT_DIR)/wrftladj \
+ -I$(WRF_SRC_ROOT_DIR)/chem -I$(WRF_SRC_ROOT_DIR)/inc \
+ -I$(NETCDFPATH)/include \
++ -I$(NETCDFFPATH)/include \
+ CONFIGURE_RTTOV_INC CONFIGURE_CTSM_INC
+ REGISTRY = Registry
+ CC_TOOLS_CFLAGS = CONFIGURE_NMM_CORE
+@@ -62,6 +63,7 @@
+ ENVCOMPDEFS = CONFIGURE_COMPILEFLAGS
+ CPPFLAGS = $(ARCHFLAGS) $(ENVCOMPDEFS) -I$(LIBINCLUDE) $(TRADFLAG) CONFIGURE_COMMS_INCLUDE
+ NETCDFPATH = CONFIGURE_NETCDF_PATH
++NETCDFFPATH = CONFIGURE_NETCDFF_PATH
+ HDF5PATH = CONFIGURE_HDF5_PATH
+ WRFPLUSPATH = CONFIGURE_WRFPLUS_PATH
+ RTTOVPATH = CONFIGURE_RTTOV_PATH
+@@ -93,13 +95,13 @@
+
+ wrfio_nf :
+ ( cd $(WRF_SRC_ROOT_DIR)/external/io_netcdf ; \
+- make $(J) NETCDFPATH="$(NETCDFPATH)" RANLIB="$(RANLIB)" CPP="$(CPP)" \
++ make $(J) NETCDFPATH="$(NETCDFPATH)" NETCDFFPATH="$(NETCDFFPATH)" RANLIB="$(RANLIB)" CPP="$(CPP)" \
+ CC="$(SCC)" CFLAGS="$(CFLAGS)" \
+ FC="$(SFC) $(PROMOTION) $(OMP) $(FCFLAGS)" TRADFLAG="$(TRADFLAG)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" )
+
+ wrfio_pnf :
+ ( cd $(WRF_SRC_ROOT_DIR)/external/io_pnetcdf ; \
+- make $(J) NETCDFPATH="$(PNETCDFPATH)" RANLIB="$(RANLIB)" CPP="$(CPP) $(ARCHFLAGS)" \
++ make $(J) NETCDFPATH="$(PNETCDFPATH)" NETCDFFPATH="$(NETCDFFPATH)" RANLIB="$(RANLIB)" CPP="$(CPP) $(ARCHFLAGS)" \
+ FC="$(FC) $(PROMOTION) $(OMP) $(FCFLAGS)" TRADFLAG="$(TRADFLAG)" AR="$(AR)" ARFLAGS="$(ARFLAGS)" )
+
+ wrfio_grib_share :
diff --git a/var/spack/repos/builtin/packages/wrf/patches/4.3/fujitsu.patch b/var/spack/repos/builtin/packages/wrf/patches/4.3/fujitsu.patch
new file mode 100644
index 0000000000..bcd73a331d
--- /dev/null
+++ b/var/spack/repos/builtin/packages/wrf/patches/4.3/fujitsu.patch
@@ -0,0 +1,10 @@
+--- spack-src/phys/module_mp_ntu.F.org 2021-11-04 09:33:01.000000000 +0900
++++ spack-src/phys/module_mp_ntu.F 2021-11-04 09:41:00.000000000 +0900
+@@ -352,7 +352,7 @@
+ DO I = 1,ITERMAX
+ Y = Y0
+ DY = DYEQU(DRC,DWMAS,DMODE,DSTDV)
+- IF (DY.LE.1.E-50) THEN
++ IF (DY.LE.1.D-50) THEN
+ PRINT *,'IN FIND_RC0.F DY IS',DY
+ PRINT *,I,DX,Y,DY,DEXP(DRC),DRC,XAFRC,X1MAFRC,DMODE,DSTDV, &