mkdir -p /path/to/CMAQ
tar -xvf ioapi-3.2-2020111.tar.gz mv ioapi-3.2-2020111 ioapi-3.2
cd ioapi-3.2 cp ioapi/Makeinclude.Linux2_ia64gfort ioapi/Makeinclude.Linux4_aarch64
cp ioapi/Makefile.nocpl ioapi/Makefile export HOME=/path/to/CMAQ
cp m3tools/Makefile.nocpl m3tools/Makefile
vi m3tools/Makefile
LIBS = -L${OBJDIR} -lioapi -L/path/to/NETCDF/lib -lnetcdff -lnetcdf -L/path/to /HDF5/lib -lhdf5_hl -lhdf5 -lz $(OMPLIBS) $(ARCHLIB) $(ARCHLIBS)
cp Makefile.template Makefile
vi Makefile
BIN = Linux4_aarch64 BASEDIR = ${PWD} INSTALL = ${HOME} LIBINST = $(INSTALL)/$(BIN) BININST = $(INSTALL)/$(BIN) CPLMODE = nocpl IOAPIDEFS = "-DIOAPI_NCF4"
分别在第146和193行修改NCFLIBS参数项。
NCFLIBS = -L/path/to/NETCDF/lib -lnetcdff -lnetcdf -L/path/to/HDF5/lib -lhdf5_hl -lhdf5 -lz
执行10.a之后,按“Esc”键,输入“:set nu”,按“Enter”即可显示出行号。
make BIN=Linux4_aarch64
csh setenv HOME /path/to/CMAQ
setenv PATH /path/to/Bisheng131/bin:$PATH setenv INCLUDE /path/to/Bisheng131/include setenv LD_LIBRARY_PATH /path/to/Bisheng131/lib setenv PATH /path/to/HMPI_1.0.2_aarch64/source/hmpi/bin:$PATH setenv INCLUDE /path/to/HMPI_1.0.2_aarch64/source/hmpi/include:$INCLUDE setenv LD_LIBRARY_PATH /path/to/HMPI_1.0.2_aarch64/source/hmpi/lib:$LD_LIBRARY_PATH
cd /path/to/CMAQ tar -xzvf CMAQ-CMAQv5.3.1_19Dec2019.tar.gz cd CMAQ-CMAQv5.3.1_19Dec2019
vi bldit_project.csh
set CMAQ_HOME = /path/to/CMAQ/CMAQ_Project
./bldit_project.csh
cd ../CMAQ_Project/
vi config_cmaq.csh
在“case gcc”段落区域修改相关信息,并将“case gcc”修改为“case bisheng”。
setenv IOAPI_INCL_DIR /path/to/CMAQ/ioapi-3.2/ioapi/ setenv IOAPI_LIB_DIR /path/to/CMAQ/ioapi-3.2/Linux4_aarch64/ setenv NETCDF_LIB_DIR /path/to/NETCDF/lib/ setenv NETCDF_INCL_DIR /path/to/NETCDF/include/ setenv MPI_LIB_DIR /path/to/HMPI/ setenv NETCDFF_LIB_DIR /path/to/NETCDF/lib/ setenv NETCDFF_INCL_DIR /path/to/NETCDF/include/
修改编译器相关参数,如下图所示(编译过程可能出现“warning”,但不影响最后编译,也可根据“warning”去掉对应的参数)。
注释如下内容。
#if ( ! -e $NETCDFF_DIR/lib/libnetcdff.a ) then # echo "ERROR: $NETCDFF_DIR/lib/libnetcdff.a does not exist in your CMAQ_LIB directory!!! Check your installation before proceeding with CMAQ build." # exit # endif
./config_cmaq.csh bisheng 1.3.1
cd CCTM/scripts/ cp /path/to/HMPI/include/mpif.h /path/to/CMAQ/CMAQ_Project/CCTM/scripts/BLD_CCTM_v531_bisheng1.3.1 ./bldit_cctm.csh bisheng 1.3.1
编译完成后,将在“BLD_CCTM_v531_bisheng1.3.1”目录下生成CMAQ的可执行程序“CCTM_v531.exe”。