wrf: add v4.5.0 (#37618)

This commit is contained in:
MichaelLaufer 2023-06-12 16:48:54 +03:00 committed by GitHub
parent a681111a23
commit b4ad883b0d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 78 additions and 2 deletions

View File

@ -69,6 +69,11 @@ class Wrf(Package):
maintainers("MichaelLaufer", "ptooley") maintainers("MichaelLaufer", "ptooley")
tags = ["windows"] tags = ["windows"]
version(
"4.5.0",
sha256="14fd78abd4e32c1d99e2e97df0370030a5c58ec84c343591bdc5e74f163c5525",
url="https://github.com/wrf-model/WRF/releases/download/v4.5/v4.5.tar.gz",
)
version( version(
"4.4.2", "4.4.2",
sha256="488b992e8e994637c58e3c69e869ad05acfe79419c01fbef6ade1f624e50dc3a", sha256="488b992e8e994637c58e3c69e869ad05acfe79419c01fbef6ade1f624e50dc3a",
@ -118,6 +123,7 @@ class Wrf(Package):
variant("pnetcdf", default=True, description="Parallel IO support through Pnetcdf library") variant("pnetcdf", default=True, description="Parallel IO support through Pnetcdf library")
variant("chem", default=False, description="Enable WRF-Chem", when="@4:") variant("chem", default=False, description="Enable WRF-Chem", when="@4:")
variant("netcdf_classic", default=False, description="Use NetCDF without HDF5 compression") variant("netcdf_classic", default=False, description="Use NetCDF without HDF5 compression")
variant("adios2", default=False, description="Enable IO support through ADIOS2 library")
patch("patches/3.9/netcdf_backport.patch", when="@3.9.1.1") patch("patches/3.9/netcdf_backport.patch", when="@3.9.1.1")
patch("patches/3.9/tirpc_detect.patch", when="@3.9.1.1") patch("patches/3.9/tirpc_detect.patch", when="@3.9.1.1")
@ -157,7 +163,13 @@ class Wrf(Package):
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.4/arch.postamble.patch", when="@4.4:") patch("patches/4.4/arch.postamble.patch", when="@4.4:")
patch("patches/4.4/configure.patch", when="@4.4:") patch("patches/4.4/configure.patch", when="@4.4:4.4.2")
patch("patches/4.5/configure.patch", when="@4.5:")
# Fix WRF to remove deprecated ADIOS2 functions
# https://github.com/wrf-model/WRF/pull/1860
patch("patches/4.5/adios2-remove-deprecated-functions.patch", when="@4.5: ^adios2@2.9:")
# Various syntax fixes found by FPT tool # Various syntax fixes found by FPT tool
patch( patch(
"https://github.com/wrf-model/WRF/commit/6502d5d9c15f5f9a652dec244cc12434af737c3c.patch?full_index=1", "https://github.com/wrf-model/WRF/commit/6502d5d9c15f5f9a652dec244cc12434af737c3c.patch?full_index=1",
@ -205,6 +217,7 @@ class Wrf(Package):
depends_on("time", type=("build")) depends_on("time", type=("build"))
depends_on("m4", type="build") depends_on("m4", type="build")
depends_on("libtool", type="build") depends_on("libtool", type="build")
depends_on("adios2", when="@4.5: +adios2")
phases = ["configure", "build", "install"] phases = ["configure", "build", "install"]
def setup_run_environment(self, env): def setup_run_environment(self, env):
@ -240,6 +253,9 @@ def setup_build_environment(self, env):
env.set("HDF5", self.spec["hdf5"].prefix) env.set("HDF5", self.spec["hdf5"].prefix)
env.prepend_path("PATH", ancestor(self.compiler.cc)) env.prepend_path("PATH", ancestor(self.compiler.cc))
if "+adios2" in self.spec:
env.set("ADIOS2", self.spec["adios2"].prefix)
def flag_handler(self, name, flags): def flag_handler(self, name, flags):
# Same flags as FCFLAGS/FFLAGS above, but forced through the compiler # Same flags as FCFLAGS/FFLAGS above, but forced through the compiler
# wrapper when compiling v3.9.1.1. # wrapper when compiling v3.9.1.1.
@ -379,7 +395,7 @@ def run_compile_script(self):
csh = Executable(csh_bin) csh = Executable(csh_bin)
# num of compile jobs capped at 20 in wrf # num of compile jobs capped at 20 in wrf
num_jobs = str(min(int(make_jobs), 10)) num_jobs = str(min(int(make_jobs), 20))
# Now run the compile script and track the output to check for # Now run the compile script and track the output to check for
# failure/success We need to do this because upstream use `make -i -k` # failure/success We need to do this because upstream use `make -i -k`

View File

@ -0,0 +1,16 @@
diff --git a/external/io_adios2/wrf_io.F90 b/external/io_adios2/wrf_io.F90
index 99e9bfe2..3d5fdd68 100644
--- a/external/io_adios2/wrf_io.F90
+++ b/external/io_adios2/wrf_io.F90
@@ -1599,9 +1599,9 @@ subroutine ext_adios2_ioinit(SysDepInfo, Status)
!look for adios2 xml runtime configuration
INQUIRE(FILE="adios2.xml", EXIST=file_exists)
if(file_exists) then
- call adios2_init(adios, 'adios2.xml', MPI_COMM_WORLD, adios2_debug_mode_on, stat)
+ call adios2_init(adios, 'adios2.xml', MPI_COMM_WORLD, stat)
else
- call adios2_init(adios, MPI_COMM_WORLD, adios2_debug_mode_on, stat)
+ call adios2_init(adios, MPI_COMM_WORLD, stat)
endif
call adios2_err(stat,Status)
if(Status /= WRF_NO_ERR) then

View File

@ -0,0 +1,44 @@
diff --git a/configure b/configure
index eaf4a1aa..d478a450 100755
--- a/configure
+++ b/configure
@@ -217,9 +217,9 @@ fi
USENETCDFF=""
USENETCDF=""
if [ -n "$NETCDF" ] ; then
- echo "Will use NETCDF in dir: $NETCDF"
+ echo "Will use NETCDFF in dir: $NETCDFF"
# Oh UNIDATA, why make it so hard ...
- if [ -f "$NETCDF/lib/libnetcdff.a" -o -f "$NETCDF/lib/libnetcdff.so" -o -f "$NETCDF/lib/libnetcdff.dll.a" ] ; then
+ if [ -f "$NETCDFF/lib/libnetcdff.a" -o -f "$NETCDFF/lib/libnetcdff.so" -o -f "$NETCDFF/lib/libnetcdff.dll.a" ] ; then
USENETCDFF="-lnetcdff"
else
USENETCDFF=" "
@@ -572,7 +572,7 @@ if test -n "$PERL" ; then
srch=`grep -i "^#ARCH.*$os" arch/configure.defaults | grep -i "$mach"`
if [ -n "$srch" ] ; then
$PERL arch/Config.pl -dmparallel=$COMMLIB -ompparallel=$OMP -perl=$PERL \
- -netcdf=$NETCDF -pnetcdf=$PNETCDF -netcdfpar=$NETCDFPAR -adios2=$ADIOS2 -hdf5=$HDF5 -phdf5=$PHDF5 -os=$os -mach=$mach -ldflags=$ldflags \
+ -netcdf=$NETCDF -netcdff=$NETCDFF -pnetcdf=$PNETCDF -netcdfpar=$NETCDFPAR -adios2=$ADIOS2 -hdf5=$HDF5 -phdf5=$PHDF5 -os=$os -mach=$mach -ldflags=$ldflags \
-compileflags=$compileflags -opt_level=$opt_level -USENETCDFF=$USENETCDFF -USENETCDF=$USENETCDF \
-time=$FORTRAN_COMPILER_TIMER -tfl="$TFL" -cfl="$CFL" -config_line="$config_line" \
-wrf_core=$wrf_core -gpfs=$GPFS_PATH -curl=$CURL_PATH -dep_lib_path="$DEP_LIB_PATH"
@@ -654,14 +654,14 @@ echo "If you wish to change settings, please edit that file."
echo "If you wish to change the default options, edit the file:"
echo " arch/configure.defaults"
-if test -n "$NETCDF" ; then
- if [ ! -f $NETCDF/include/netcdf.inc ] ; then
+if test -n "$NETCDFF" ; then
+ if [ ! -f $NETCDFF/include/netcdf.inc ] ; then
echo
- echo "Error : Not found $NETCDF/include/netcdf.inc"
+ echo "Error : Not found $NETCDFF/include/netcdf.inc"
echo " Please check this installation of NetCDF and re-run this configure script"
exit -1
fi
- grep nf_format_64bit $NETCDF/include/netcdf.inc > /dev/null
+ grep nf_format_64bit $NETCDFF/include/netcdf.inc > /dev/null
configure_aaaa=$? ; export configure_aaaa
if [ $configure_aaaa -a -z "$WRFIO_NCD_NO_LARGE_FILE_SUPPORT" ] ; then
echo "NetCDF users note:"