Skip to content

Commit

Permalink
Merge pull request #21938 from stefan-wolfsheimer/wrf-4.6.1
Browse files Browse the repository at this point in the history
{geo}[foss/2024a] WRF 4.6.1, WPS 4.6.0
  • Loading branch information
boegel authored Dec 17, 2024
2 parents 658047b + a535132 commit 13db95b
Show file tree
Hide file tree
Showing 4 changed files with 168 additions and 0 deletions.
41 changes: 41 additions & 0 deletions easybuild/easyconfigs/w/WPS/WPS-4.6.0-foss-2024a-dmpar.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name = 'WPS'
version = '4.6.0'

homepage = 'https://www.mmm.ucar.edu/models/wrf'
description = """WRF Preprocessing System (WPS) for WRF. The Weather Research and Forecasting (WRF) Model is
a next-generation mesoscale numerical weather prediction system designed to serve both operational
forecasting and atmospheric research needs."""

toolchain = {'name': 'foss', 'version': '2024a'}
toolchainopts = {'opt': True}

source_urls = ['https://github.com/wrf-model/WPS/archive/']
sources = ['v%(version)s.tar.gz']
patches = [
'WPS-%(version)s_netCDF-Fortran_separate_path.patch',
'WPS-4.6.0_fix_jasper_decode.patch',
]

checksums = [
'ca7bbfc6c28a107c6eb00ded70e693f5c9a3926ecde7656f49e306c9eb9a309b', # v4.6.1.tar.gz
'ed49d5af4e6c80d9ddd9954b968c514cf888c3b35dce64744d1ac1eaa38b7042', # WPS-4.4_netCDF-Fortran_separate_path.patch
'f4ea3c77c42c3474d582e311b8bd0d80c67243f45922e85ee3ff52df61d6c77e', # WPS-4.6.0_fix_jasper_decode.patch
]

buildtype = "dmpar"
versionsuffix = '-%s' % buildtype

builddependencies = [
('Perl', '5.38.2'),
]

dependencies = [
('WRF', '4.6.1', versionsuffix),
('JasPer', '4.2.4'),
('netCDF', '4.9.2'),
('netCDF-Fortran', '4.6.1'),
('zlib', '1.3.1'),
('libpng', '1.6.43'),
]

moduleclass = 'geo'
31 changes: 31 additions & 0 deletions easybuild/easyconfigs/w/WPS/WPS-4.6.0_fix_jasper_decode.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Using correct JasPer functions
# ==============================
# WPS uses depreceated version of JasPer interface.
# See https://github.com/wrf-model/WPS/issues/207
# @author Stefan Wolfsheimer (SURF)


diff -Nru WPS-4.6.0.orig/ungrib/src/ngl/g2/dec_jpeg2000.c WPS-4.6.0/ungrib/src/ngl/g2/dec_jpeg2000.c
--- WPS-4.6.0.orig/ungrib/src/ngl/g2/dec_jpeg2000.c 2024-06-13 00:06:55.000000000 +0200
+++ WPS-4.6.0/ungrib/src/ngl/g2/dec_jpeg2000.c 2024-11-29 10:58:34.322941000 +0100
@@ -80,7 +80,7 @@
/*
* Decode JPEG200 codestream into jas_image_t structure.
*/
- image=jpc_decode(jpcstream,opts);
+ image=jas_image_decode(jpcstream,jas_image_getfmt(jpcstream),opts);
if ( image == 0 ) {
printf(" jpc_decode return = %d \n",ier);
return -3;
diff -Nru WPS-4.6.0.orig/ungrib/src/ngl/g2/enc_jpeg2000.c WPS-4.6.0/ungrib/src/ngl/g2/enc_jpeg2000.c
--- WPS-4.6.0.orig/ungrib/src/ngl/g2/enc_jpeg2000.c 2024-06-13 00:06:55.000000000 +0200
+++ WPS-4.6.0/ungrib/src/ngl/g2/enc_jpeg2000.c 2024-11-29 10:58:40.467583000 +0100
@@ -178,7 +178,7 @@
/*
* Encode image.
*/
- ier=jpc_encode(&image,jpcstream,opts);
+ ier=jas_image_encode(&image,jpcstream,opts);
if ( ier != 0 ) {
printf(" jpc_encode return = %d \n",ier);
return -3;
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Allow netCDF library with separate directories for C and Fortran
# ============================================================================
# This patch has been around in EasyBuild since 2013; it was committed by
# @boegel then. Adapted by @andreas-h to accomodate WPSv4 and foss toolchain
# updated for WPS v4.6.0 by Stefan Wolfsheimer (SURF)


diff -Nru WPS-4.6.0.orig/arch/preamble WPS-4.6.0/arch/preamble
--- WPS-4.6.0.orig/arch/preamble 2024-06-13 00:06:55.000000000 +0200
+++ WPS-4.6.0/arch/preamble 2024-11-29 09:25:27.634254674 +0100
@@ -39,13 +39,14 @@
-I$(WRF_DIR)/external/io_grib1 \
-I$(WRF_DIR)/external/io_int \
-I$(WRF_DIR)/inc \
- -I$(NETCDF)/include
+ -I$(NETCDF)/include \
+ -I$(NETCDFF_DIR)/include

WRF_LIB = -L$(WRF_DIR)/external/io_grib1 -lio_grib1 \
-L$(WRF_DIR)/external/io_grib_share -lio_grib_share \
-L$(WRF_DIR)/external/io_int -lwrfio_int \
-L$(WRF_DIR)/external/io_netcdf -lwrfio_nf \
- -L$(NETCDF)/lib CONFIGURE_NETCDFF_LIB -lnetcdf
+ -L$(NETCDF)/lib -L$(NETCDFF_DIR)/lib -lnetcdff -lnetcdf

#### Architecture specific settings ####

diff -Nru WPS-4.6.0.orig/configure WPS-4.6.0/configure
--- WPS-4.6.0.orig/configure 2024-06-13 00:06:55.000000000 +0200
+++ WPS-4.6.0/configure 2024-11-29 09:17:10.196985634 +0100
@@ -161,7 +161,7 @@
# 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
+ if [ -f "$NETCDFF_DIR/lib/libnetcdff.a" ] ; then
NETCDFF="-lnetcdff"
fi
else
@@ -429,9 +429,9 @@
FFLAGS=`grep ^FFLAGS configure.wps | cut -d"=" -f2-`
FORMAT_FREE=`grep ^FORMAT_FREE configure.wps | cut -d"=" -f2-`
FFLAGS=`printf "%s" "${FFLAGS}" | sed -e "s/\\$(FORMAT_FREE)/${FORMAT_FREE}/g"`
- cp $NETCDF/include/netcdf.inc .
+ cp $NETCDFF_DIR/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_DIR}/lib $NETCDFF -lnetcdf > /dev/null 2>&1
if [ -f "fort_netcdf" ] ; then
./fort_netcdf > /dev/null 2>&1
if [ $? = 0 ]; then
45 changes: 45 additions & 0 deletions easybuild/easyconfigs/w/WRF/WRF-4.6.1-foss-2024a-dmpar.eb
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name = 'WRF'
version = '4.6.1'
buildtype = 'dmpar'
versionsuffix = '-%s' % buildtype

homepage = 'https://www.mmm.ucar.edu/models/wrf'
description = """The Weather Research and Forecasting (WRF) Model is a next-generation mesoscale
numerical weather prediction system designed to serve both operational forecasting and atmospheric
research needs."""

toolchain = {'name': 'foss', 'version': '2024a'}
toolchainopts = {'opt': False} # don't use agressive optimization, stick to -O2

github_account = 'wrf-model'
source_urls = [GITHUB_RELEASE]
sources = ['v%(version)s.tar.gz']

# WRF-4.5.1_netCDF-Fortran_separate_path.patch no longer required for version 4.5.2

checksums = [
{'v4.6.1.tar.gz': 'b8ec11b240a3cf1274b2bd609700191c6ec84628e4c991d3ab562ce9dc50b5f2'},
]

# csh is used by WRF install scripts
builddependencies = [
('Autotools', '20231222'),
('tcsh', '6.24.13'),
('time', '1.9'),
('Perl', '5.38.2'),
]

dependencies = [
('JasPer', '4.2.4'),
('netCDF', '4.9.2'),
('netCDF-Fortran', '4.6.1'),
]

preconfigopts = "export NETCDF=$EBROOTNETCDFMINFORTRAN && export NETCDF_C=$EBROOTNETCDF &&"

runtest = True

# limit parallel build to 20
maxparallel = 20

moduleclass = 'geo'

0 comments on commit 13db95b

Please sign in to comment.