【0】官方說明:
https://ccht.ccee.ncsu.edu/how-to-compile-and-run-swanadcirc/
【1】設置環(huán)境機器差別大
例如:intel機器的mpif90提示沒有卖陵,要設置一下:
source ./mpi_openmpi-3.1.2-intel.sh
./mpi_openmpi-3.1.2-intel.sh
【2】一個小的warning其實沒有關系
makefile:49: (WARNING) Intel compiler has been specified. The flag "--heap-arrays 10240" should be set
makefile:50: (WARNING) in both ADCIRC cmplrflags.mk FFLAGS1 and when compiling the netcdf-fortran library
makefile:51: (WARNING) using FCFLAGS to avoid potential issues with stack allocation of large implicit arrays.
在文件cmplrflags.mk
FFLAGS1? ? ? :=? $(INCDIRS) -O2 -FI -assume byterecl -132 -xSSE4.2 -assume buffered_io
后方添加:
-heap-arrays 10240
【3】NETCDF設置還是直接在cmplrflags.mk文件中改好
***? ifeq ($(NETCDF),enable) ***
在這句話下方添加:
? ? ? ? FLIBS? ? ? :=$(FLIBS) -L$(NETCDFHOME)/lib -lnetcdff -lnetcdf
? ? ? ? FFLAGS1? ? :=$(FFLAGS1) -I$(NETCDFHOME)/include
【4】進行編譯padcirc
使用以下語句編譯:
make padcirc compiler=intel NETCDF=enable NETCDFHOME=/wind1/home/chenjq93/adcirc/netcdf_forAdcirc/netcdf
【5】測試swan的情況
cd ../thirdparty/swan
make clean
make clobber
make config
編輯macros.inc
O_DIR = ../../work/odir4/
#!!!不需要編輯NETCDF庫的事情###
#并且,在makefile中編輯
MSG_OBJS = \
$(O_DIR)mkdir.$(EXTO) \
$(O_DIR)sizes.$(EXTO) \
$(O_DIR)boundaries.$(EXTO) \? <===添加這句話
make punswan
make clean
make clobber
【6】進行編譯padcswan
使用以下語句編譯:
make padcswan compiler=intel NETCDF=enable NETCDFHOME=/wind1/home/chenjq93/adcirc/netcdf_forAdcirc/netcdf