编译和安装
操作步骤
- 使用PuTTY工具,以root用户登录服务器。
- 执行以下命令进入安装目录并解压软件包。
cd /path/to/SWAN tar -zxvf swan4131.tar.gz cd swan4131
- 执行以下命令修改“platform.pl”文件。
- 打开“platform.pl”文件。
vim platform.pl
- 按“i”进入编辑模式。
修改第414行:
print OUTFILE "NETCDFROOT =/path/to/NETCDF\n";
将第788行修改为“$compiler = "gfortran";”:782 sub getcmpl { 783 784 my $compiler = $ENV{'FC'}; 785 786 unless ( $compiler ) { 787 foreach ('ifort','gfortran','f90','ifc','efc','pgf90','xlf90', 'lf95','g95') { 788 $compiler = "gfortran"; 789 my $path = `which $compiler`; 790 last if $path; 791 } 792 } 793 794 return $compiler; 795 }
- 按“Esc”键,输入:wq!,按“Enter”保存并退出编辑。
- 打开“platform.pl”文件。
- 执行以下命令生成配置文件。
make config
- 执行以下命令生成“swan.exe”可执行文件。
make mpi