Compiling and Installing SWAN
Procedure
- Use PuTTY to log in to the server as the root user.
- Run the following commands to go to the installation directory and decompress the software package:
cd /path/to/SWAN tar -zxvf swan4131.tar.gz cd swan4131
- Run the following commands to modify the platform.pl file:
- Open platform.pl.
vim platform.pl
- Press i to go to the insert mode.Modify line 406:
print OUTFILE "F90_MPI = mpifort\n";
Modify line 414:print OUTFILE "NETCDFROOT =/path/to/NETCDF\n";
Modify line 788 to $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 } - Press Esc, type :wq!, and press Enter to save the file and exit.
- Open platform.pl.
- Run the following command to generate the configuration file:
make config
- Run the following command to generate the swan.exe file:
make mpi
Parent topic: SWAN 41.31 Porting Guide (CentOS 7.6)