tar -zxvf WRF-3.9.tar.gz
cd WRF-3.9
export WRFIO_NCD_LARGE_FILE_SUPPORT=1 export NETCDF=/path/to/install/NETCDF export HDF5=/path/to/install/HDF5 export PNETCDF=/path/to/install/PNETCDF export CPPFLAGS="-I$HDF5/include -I$PNETCDF/include -I$NETCDF/include" export LDFLAGS="-L$HDF5/lib -L$PNETCDF/lib -L$NETCDF/lib -lnetcdf -lnetcdff -lpnetcdf -lhdf5_hl -lhdf5 -lz"
vim arch/configure_new.defaults
在文件#insert new stanza here下面添加:
################################################## ######### #ARCH Linux aarch64,clang HYPERMPI#serial smpar dmpar dm+sm DESCRIPTION = CLANG ($SFC/$SCC) DMPARALLEL = 1 OMPCPP = -D_OPENMP OMP = -fopenmp OMPCC = -fopenmp SFC = flang SCC = clang CCOMP = clang DM_FC = mpif90 DM_CC = mpicc -DMPI2_SUPPORT FC = CONFIGURE_FC CC = CONFIGURE_CC LD = $(FC) RWORDSIZE = CONFIGURE_RWORDSIZE PROMOTION = #-fdefault-real-8 ARCH_LOCAL = -DNONSTANDARD_SYSTEM_SUBR -DWRF_USE_CLM CFLAGS_LOCAL = -mcpu=native -w -O3 -c -march=armv8.2-a -I/usr/include/tirpc/ LDFLAGS_LOCAL = -ltirpc CPLUSPLUSLIB = ESMF_LDFLAG = $(CPLUSPLUSLIB) FCOPTIM = -O3 -funroll-loops -march=armv8.2-a FCREDUCEDOPT = $(FCOPTIM) FCNOOPT = -O0 FCDEBUG = -g # -fbacktrace -ggdb-fcheck=bounds,do,mem,pointer -ffpe-trap=invalid,zero,overflow FORMAT_FIXED = -ffixed-form FORMAT_FREE = -ffree-form -ffree-line-length-0 FCSUFFIX = BYTESWAPIO = -fconvert=big-endian FCBASEOPTS_NO_G = -w $(FORMAT_FREE) $(BYTESWAPIO) FCBASEOPTS = -mcpu=native $(OMP) $(FCBASEOPTS_NO_G) MODULE_SRCH_FLAG = TRADFLAG = -traditional CPP = /lib/cpp -P AR = ar ARFLAGS = ru M4 = m4 -G RANLIB = ranlib RLFLAGS = CC_TOOLS = $(SCC) ###########################################################
./configure
输入“4”,再按“enter”键。
输入“1”,再按“enter”键。
./compile em_real 2>&1 | tee -a compile.log
ls main
回显生成了“wrf.exe”等可执行文件,表明编译成功。