参考https://forum.mmm.ucar.edu/threads/full-wrf-and-wps-installation-example-gnu.12385/
intel编译器设置如下,个别参数设置会提示warning,问题不大:
export PATH=/public/home/chenjq93/software/Cmake/bin/bin:$PATH
export PATH=/public/home/chenjq93/software/Make/bin/bin:$PATH
source mpi_intelmpi-2021.3.0.sh
source compiler_intel-2021.3.0.sh
export DIR=/public/home/chenjq93/models/SWAN/netcdf_forswan
export NETCDF=$DIR/netcdf
export LD_LIBRARY_PATH=$NETCDF/lib:$DIR/grib2/lib
export PATH=$NETCDF/bin:$DIR/mpich/bin:${PATH}
export JASPERLIB=$DIR/grib2/lib
export JASPERINC=$DIR/grib2/include
export CC=icc
export CXX=icpc
export FC=ifort
export FCFLAGS="-m64 -fallow-argument-mismatch"
export F77=ifort
export FFLAGS="-m64 -fallow-argument-mismatch"
export LDFLAGS="-L$NETCDF/lib -L$DIR/grib2/lib"
export CPPFLAGS="-I$NETCDF/include -I$DIR/grib2/include -fcommon"
tar xzvf zlib-1.2.11.tar.gz
cd zlib-1.2.11
./configure --prefix=$DIR/grib2
make -j 4
make install
cd ..
rm -rf zlib*
export LD_LIBRARY_PATH=/opt/intel/mkl/lib/intel64:$LD_LIBRARY_PATH
tar xzvf hdf5-1.10.5.tar.gz
cd hdf5-1.10.5
./configure --prefix=$DIR/netcdf --with-zlib=$DIR/grib2 --enable-fortran --enable-shared
make -j 4
make install
cd ..
rm -rf hdf5*
tar xzvf v4.7.2.tar.gz
cd netcdf-c-4.7.2
./configure --prefix=$DIR/netcdf --disable-dap --enable-netcdf4 --enable-hdf5 --enable-shared
make -j 4
make install
cd ..
rm -rf v4.7.2.tar.gz netcdf-c*
export LIBS="-lnetcdf -lz"
tar xzvf v4.5.2.tar.gz
cd netcdf-fortran-4.5.2
./configure --prefix=$DIR/netcdf --disable-hdf5 --enable-shared
make -j 4
make install
cd ..
rm -rf netcdf-fortran* v4.5.2.tar.gz