cd /path/to/hwrf/wrfrun/sorc/ tar -xvf ../../HWRF_v4.0a_pomtc.tar.gz
export LIB_W3_PATH=$HWRF_DIR/hwrfrun/sorc/hwrf-utilities/libs export LIB_SP_PATH=$HWRF_DIR/hwrfrun/sorc/hwrf-utilities/libs export LIB_SFCIO_PATH=$HWRF_DIR/hwrfrun/sorc/hwrf-utilities/libs export LIB_BACIO_PATH=$HWRF_DIR/hwrfrun/sorc/hwrf-utilities/libs export LIB_NEMSIO_PATH=$HWRF_DIR/hwrfrun/sorc/hwrf-utilities/libs export LIB_G2_PATH=$HWRF_DIR/hwrfrun/sorc/hwrf-utilities/libs export LIB_BLAS_PATH=$HWRF_DIR/hwrfrun/sorc/hwrf-utilities/libs export LIB_JASPER_PATH=$JASPER_LIB export LIB_PNG_PATH=$LIBPNG_LIB export LIB_Z_PATH=$ZLIB_LIB
vim patch-pomtc
输入以下内容并保存。
diff -Nur pomtc/arch/configure.defaults pomtc_ok/arch/configure.defaults --- pomtc/arch/configure.defaults 2017-07-21 02:27:10.219709000 +0800 +++ pomtc_ok/arch/configure.defaults 2023-07-21 15:01:14.011770420 +0800 @@ -1,4 +1,34 @@ ########################################################## +#ARCH Linux aarch64, Kunpeng Bisheng compiler HyperMPI KML # dmpar +# +NETCDFINC = -I$(NETCDF_INC) +NETCDFLIB = -L$(NETCDF_LIB) -lnetcdf -lnetcdff + +BYTE_ORDER = BIG_ENDIAN +SFC = mpifort +SF90 = mpif90 -ffree-form +SCC = mpicc +OMP_FFLAGS = #-qsmp=omp +FFLAGS = -I$(HMPI_INC) $(NETCDFINC) $(NETCDFLIB) -O3 -fconvert=big-endian -L$(KML_LIB) -lkm_l9 -lkm -lmathlib #-O -g -qnosave -qarch=auto -q64 -qinitauto=0 #$(DEBUG_FFLAGS) +FFLAGS_MPI_POM = #-O -g -qnosave -qarch=auto -q64 -qinitauto=0 #$(DEBUG_FFLAGS) +DEBUG_FFLAGS = #-qsigtrap -qfullpath -C -qflttrap=zerodivide:enable \ + -qinitauto=FF911299 -qtbtable=full -qextchk +CPP = cpp +CPPFLAGS = -P -traditional -D$(BYTE_ORDER) -DWRF -Dibm_sp -I/usr/lpp/ppe.poe/include/thread + +DM_FC = $(SFC) +DM_F90 = $(SF90) +DM_CC = $(SCC) -DMPI2_SUPPORT + +FC = $(DM_FC) +F90 = $(DM_F90) +CC = $(DM_CC) + +CFLAGS = + +ESSLLIB = -lpthread -liomp5 + +########################################################## #ARCH AIX #dmpar # NETCDF = CONFIGURE_NETCDF_PATH diff -Nur pomtc/ocean_main/pom/kpp.f pomtc_ok/ocean_main/pom/kpp.f --- pomtc/ocean_main/pom/kpp.f 2018-07-21 04:57:52.471918000 +0800 +++ pomtc_ok/ocean_main/pom/kpp.f 2023-07-21 14:59:41.571770420 +0800 @@ -1113,8 +1113,8 @@ $ ,KPPh(indi,indj) print*,(1+SIG*Gm),dk_bl,k_bl print*,A1,A2,GM1,A3,DGM1DS - print*,cff,(KHKPP(indi,indj,ksbl), - $ KHKPP(indi,indj,ksbl-1)); + print*,cff,KHKPP(indi,indj,ksbl), + $ KHKPP(indi,indj,ksbl-1); stop endif enddo
patch -p0 < ./patch-pomtc
cd pomtc echo 1 | ./configure
./compile 2>&1 | tee -a build.log
ls -l ocean_exec/*.exe
成功编译后将在目录ocean_exec中生成可执行文件。