wps: adding version 4.4 (#35358)

This commit is contained in:
snehring 2023-02-06 21:22:41 -06:00 committed by GitHub
parent 1bb119dbd7
commit 8e49bf0c5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 45 additions and 1 deletions

View file

@ -16,6 +16,7 @@ class Wps(Package):
url = "https://github.com/wrf-model/WPS/archive/v4.2.tar.gz"
maintainers("MichaelLaufer")
version("4.4", sha256="fe9c8d8a9a4abbf800b30e6cbb378604c6040e4536f5594b8e2dae43e942e2b3")
version("4.3.1", sha256="db6da44a2ca68cc289e98ab388a53c27283eb4ed8e92edee268466543fdedb0e")
version("4.3", sha256="1913cb24de549f029d65635feea27f3304a8f42ec025954a0887651fc89d1e9e")
version("4.2", sha256="3e175d033355d3e7638be75bc7c0bc0de6da299ebd175a9bbc1b7a121acd0168")
@ -30,10 +31,11 @@ class Wps(Package):
# These patches deal with netcdf & netcdf-fortran being two diff things
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/configure.patch", when="@4.2:")
patch("patches/4.2/configure.patch", when="@4.2:4.3.1")
patch("patches/4.2/preamble.patch", when="@4.2:")
patch("patches/4.3/arch.configure.defaults.patch", when="@4.3:4.3.0")
patch("patches/4.3.1/arch.configure.defaults.patch", when="@4.3.1")
patch("patches/4.4/configure.patch", when="@4.4:")
# According to:
# http://www2.mmm.ucar.edu/wrf/users/docs/user_guide_v4/v4.0/users_guide_chap2.html#_Required_Compilers_and_1

View file

@ -0,0 +1,42 @@
diff --git a/configure b/configure
index d95c5b6..e299dc2 100755
--- a/configure
+++ b/configure
@@ -117,11 +117,13 @@ fi
if [ -n "$NETCDF" ] ; then
echo "Will use NETCDF in dir: $NETCDF"
+ echo "Will use NETCDFF in dir: $NETCDFF"
# for 3.6.2 and greater there might be a second library, libnetcdff.a . Check for this and use
# if available
- NETCDFF=" "
- if [ -f "$NETCDF/lib/libnetcdff.a" ] ; then
- NETCDFF="-lnetcdff"
+ NETCDFF="$NETCDFF"
+ export NETCDFF
+ if [ -f "$NETCDFF/lib/libnetcdff.a" ] ; then
+ NETCDFF_LIB="-lnetcdff"
fi
else
echo "Will configure for use without NetCDF"
@@ -190,7 +192,7 @@ if [ $wrf_dir = "none" ]; then
fi
# Found perl, so proceed with configuration
-perl arch/Config.pl -perl=$PERL -netcdf=$NETCDF -netcdff=$NETCDFF -os=$os -mach=$mach -wrfdir=$wrf_dir -grib2dir=$grib2dir
+perl arch/Config.pl -perl=$PERL -netcdf=$NETCDF -netcdff=$NETCDFF -netcdfflib=$NETCDFF_LIB -os=$os -mach=$mach -wrfdir=$wrf_dir
#Checking cross-compiling capability for some particular environment
@@ -356,9 +358,9 @@ cat > fort_netcdf.f <<EOF
end program
EOF
FFLAGS=`grep ^FFLAGS configure.wps | cut -d"=" -f2-`
- cp $NETCDF/include/netcdf.inc .
+ cp $NETCDFF/include/netcdf.inc .
FC=`grep ^SFC configure.wps | cut -d"=" -f2-`
- $FC ${FFLAGS} fort_netcdf.f -o fort_netcdf -L${NETCDF}/lib $NETCDFF -lnetcdf > /dev/null 2>&1
+ $FC ${FFLAGS} fort_netcdf.f -o fort_netcdf -L${NETCDF}/lib -L${NETCDFF}/lib ${NETCDFF_LIB} -lnetcdf > /dev/null 2>&1
if [ -f "fort_netcdf" ] ; then
./fort_netcdf > /dev/null 2>&1
if [ $? = 0 ]; then