# Copyright (c) 2019 Dave Love, University of Manchester # MIT licence, per Fedora policy %global wpsver 4.1 Name: wrf Version: 4.1.2 Release: 2%{?dist} Summary: The Weather Research and Forecasting Model License: Public Domain URL: http://www2.mmm.ucar.edu/wrf/ Source0: https://github.com/wrf-model/WRF/archive/v%version/wrf-%version.tar.gz # Concocted by painful iterations of configure. (Had to be done # against the static netcdf package, but the dynamic one works for # building.) Source1: configure.wrf Source2: https://github.com/wrf-model/WPS/archive/v%wpsver/wps-%wpsver.tar.gz Source3: configure.wps BuildRequires: perl csh netcdf-fortran-devel m4 jasper-devel BuildRequires: libpng-devel %global desc \ The Weather Research and Forecasting (WRF) Model is a next-generation\ mesoscale numerical weather prediction system designed for both\ atmospheric research and operational forecasting applications. It\ features two dynamical cores, a data assimilation system, and a\ software architecture supporting parallel computation and system\ extensibility. The model serves a wide range of meteorological\ applications across scales from tens of meters to thousands of kilometers. %description %desc %package openmpi%{?el7:3} Summary: The Weather Research and Forecasting Model - openmpi%{?el7:3} BuildRequires: openmpi%{?el7:3}-devel Requires: openmpi%{?el7:3}%{?_isa} Requires: %name-common = %version-%release %description openmpi%{?el7:3} %desc This is the openmpi%{?el7:3} version. %package common Summary: Data for %name BuildArch: noarch %description common Data (the "run" directory) for %name. %package -n wps-openmpi%{?el7:3} Summary: WRF Pre-Processing System - openmpi%{?el7:3} BuildRequires: openmpi%{?el7:3}-devel Requires: openmpi%{?el7:3}%{?_isa} %description -n wps-openmpi%{?el7:3} The WRF Pre-Processing System (WPS) is a collection of Fortran and C programs that provides data used as input to the real.exe and real_nmm.exe programs. There are three main programs and a number of auxiliary programs that are part of WPS. Both the ARW and NMM dynamical cores in WRF are supported by WPS. %prep %setup -q -c tar fx %SOURCE0 cd WRF* cp %SOURCE1 . %if 0%{?fedora} || 0%{?rhel} > 7 # With gcc8, -O3 does unroll-and-jam, but the alternative is probably # better with 4.8 sed -i -e 's/ -DNO_IEEE_MODULE//g' -e 's/-O3/-O2 -ftree-vectorize -funroll-loops/g' configure.wrf %endif # Try to make failures more obvious find -name Makefile | xargs sed -i 's/make -i/make/' # Fixme: This actually breaks the build, believe it or not, failing to # find a .mod, but might help diagnose failed builds. # sed -i 's/make -i/make/' configure.wrf cd .. tar fx %SOURCE2 cd WPS* cp %SOURCE3 . cd .. # Account for even the make files assuming netcdf libs are in a "lib" # subdir, and headers have to be in a sibling include. mkdir ncdf4 ln -s %_bindir %_includedir ncdf4 ln -s %_libdir ncdf4/lib %build cd WRF* module load mpi/openmpi%{?el7:3}-%{_arch} srcdir=$(pwd) ./compile em_real cd ..; cd WPS* srcdir=$(pwd) ./compile %install mkdir -p %buildroot%_libdir/openmpi%{?el7:3}/bin %buildroot%_datadir/wrf cd WRF* cp -p main/*.exe %buildroot%_libdir/openmpi%{?el7:3}/bin rm run/*.exe cp -a run %buildroot%_datadir/wrf cd ../WPS* cp -a */src/*.exe %buildroot%_libdir/openmpi%{?el7:3}/bin %files openmpi%{?el7:3} %_libdir/openmpi%{?el7:3}/bin/wrf.exe %files common %doc WRF*/README %_datadir/wrf %files -n wps-openmpi%{?el7:3} %doc WPS*/README %exclude %_libdir/openmpi%{?el7:3}/bin/wrf.exe %_libdir/openmpi%{?el7:3}/bin/* %changelog * Fri Jul 26 2019 Dave Love - 4.1.2-2 - Add WPS * Wed Jul 3 2019 Dave Love - 4.1.1-1 - New version - Drop patch * Mon Jun 10 2019 Dave Love - 4.1-4 - Make it a pure MPI version * Fri Jun 7 2019 Dave Love - 4.1-3 - Build em_real - Make common package * Wed Jun 5 2019 Dave Love - 4.1-2 - Modify f2003 conditionals * Tue Jun 4 2019 Dave love - 4.1-1 - New version with fixes to build with gfortran 4.8 * Fri May 31 2019 Dave Love - 4.0.3-2 - Use openmpi3 on el7 * Fri Apr 26 2019 Dave Love - 4.0.3-1 - Initial packaging