WRF installation using intel compiler on HPC
export CC=icc
export CXX='icpc -E'
export CPP='icpc -E'
export FC=ifort
export F77=ifort
export F90=ifort
export DIR=/home/user # Replace bold path with your computer path.
cd $DIR
mkdir wrf_lib_install
cd $DIR
wget https://support.hdfgroup.org/ftp/lib-external/szip/2.1.1/src/szip-2.1.1.tar.gz
tar -zxvf szip-2.1.1.tar.gz
cd szip-2.1.1
./configure --prefix=${DIR}/wrf_lib_install
make
make check
make install
cd ../
wget https://zlib.net/zlib-1.3.tar.gz
tar -zxvf zlib-1.3.tar.gz
cd zlib-1.3
./configure --prefix=${DIR}/wrf_lib_install
make
make check
make install
cd ../
wget https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.14/hdf5-1.14.2/src/hdf5-1.14.2.tar.gz
tar -zxvf hdf5-1.14.2.tar.gz
cd hdf5-1.14.2
./configure --prefix=${DIR}/wrf_lib_install --enable-fortran --enable-hl --enable-shared --with-szlib=${DIR}/wrf_lib_install --with-zlib=${DIR}/wrf_lib_install
make
make -j 4 check
make -j 4 install
cd ../
export PATH=${DIR}/wrf_lib_install/bin:$PATH
export LD_LIBRARY_PATH=${DIR}/wrf_lib_install/lib:$LD_LIBRARY_PATH
export HDF5=${DIR}/wrf_lib_install
export LDFLAGS=-L${DIR}/wrf_lib_install/lib
export CPPFLAGS=-I${DIR}/wrf_lib_install/include
wget https://downloads.unidata.ucar.edu/netcdf-c/4.9.2/netcdf-c-4.9.2.tar.gz
tar -zxvf netcdf-c-4.9.2.tar.gz
cd netcdf-c-4.9.2
./configure --prefix=${DIR}/wrf_lib_install --disable-libxml2 --disable-byterange
make
make -j 4 check
make -j 4 install
cd ../
wget https://downloads.unidata.ucar.edu/netcdf-fortran/4.6.1/netcdf-fortran-4.6.1.tar.gz
tar -zxvf netcdf-fortran-4.6.1.tar.gz
cd netcdf-fortran-4.6.1
./configure --prefix=${DIR}/wrf_lib_install
make
make -j 4 check
make -j 4 install
cd ../
wget https://excellmedia.dl.sourceforge.net/project/libpng/libpng16/1.6.40/libpng-1.6.40.tar.gz
tar -zxvf libpng-1.6.40.tar.gz
cd libpng-1.6.40
./configure --prefix=${DIR}/wrf_lib_install
make
make check
make install
cd ../
wget https://www.ece.uvic.ca/~frodo/jasper/software/jasper-1.900.29.tar.gz
tar -zxvf jasper-1.900.29.tar.gz
cd jasper-1.900.29
./configure --prefix=${DIR}/wrf_lib_install
make
make check
make install
echo "export CC=icc" >> ~/.bashrc
echo "export CXX='icpc -E'" >> ~/.bashrc
echo "export CPP='icpc -E'" >> ~/.bashrc
echo "export FC=ifort" >> ~/.bashrc
echo "export F77=ifort" >> ~/.bashrc
echo "export F90=ifort" >> ~/.bashrc
echo "" >> ~/.bashrc
echo "export MPICC=mpiicc" >> ~/.bashrc
echo "export MPICXX=mpiicxx" >> ~/.bashrc
echo "export MPIF77=mpiifort" >> ~/.bashrc
echo "export MPIF90=mpiifort" >> ~/.bashrc
echo "" >> ~/.bashrc
echo "export PATH="${DIR}"/wrf_lib_install/bin:$""PATH" >> ~/.bashrc
echo "export LD_LIBRARY_PATH="${DIR}"/wrf_lib_install/lib:$""LD_LIBRARY_PATH" >> ~/.bashrc
echo "" >> ~/.bashrc
echo "export HDF5="${DIR}"/wrf_lib_install" >> ~/.bashrc
echo "" >> ~/.bashrc
echo "export LDFLAGS=-L"${DIR}"/wrf_lib_install/lib" >> ~/.bashrc
echo "export CPPFLAGS=-I"${DIR}"/wrf_lib_install/include" >> ~/.bashrc
echo "" >> ~/.bashrc
echo "export NETCDF="${DIR}"/wrf_lib_install" >> ~/.bashrc
echo "" >> ~/.bashrc
echo "" >> ~/.bashrc
echo "export JASPERLIB="${DIR}"/wrf_lib_install/lib" >> ~/.bashrc
echo "export JASPERINC="${DIR}"/wrf_lib_install/include" >> ~/.bashrc
cd $DIR
wget https://github.com/wrf-model/WRF/releases/download/v4.5.1/v4.5.1.tar.gz
tar -zxvf v4.5.1.tar.gz
cd WRFV4.5.1
./configure
DM_FC
= mpiifort
DM_CC
= mpiicc
./compile -j 4 em_real
cd $DIR
wget https://github.com/wrf-model/WPS/archive/refs/tags/v4.5.tar.gz
tar -zxvf v4.5.tar.gz
cd WPS-4.5
export WRF_DIR=$DIR/WRFV4.5.1
./configure
DM_FC
= mpiifort
DM_CC
= mpiicc
./compile