【0】官方说明:
https://ccht.ccee.ncsu.edu/how-to-compile-and-run-swanadcirc/
【1】设置环境机器差别大
例如: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