mkdir -p /path/to/FVCOM
cp fvcom-4.1.tar.gz /path/to/FVCOM
cd /path/to/FVCOM
tar -xvf fvcom-4.1.tar.gz
cp Examples/Estuary/make.inc_example FVCOM_source/make.inc
ln -sf FVCOM_source/make.inc ./
vi make.inc
LIBDIR = -L$(INSTALLDIR)/lib -L../METIS_source/metis -L./libs/julian INCDIR = -I$(INSTALLDIR)/include -I../METIS_source/metis -I./libs/julian
IOLIBS = -L/path/to/NETCDF/lib -L/path/to/HDF5/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lz -lcurl -lm
IOINCS = -I/path/to/NETCDF/include -I/path/to/HDF5/include
# Intel/MPI Compiler Definitions (SMAST) #-------------------------------------------------------------------------- # CPP = /usr/bin/cpp # COMPILER = -DIFORT # CC = mpicc # CXX = mpicxx # CFLAGS = -O3 # FC = mpif90 # DEBFLGS = -check all traceback # Use 'OPT = -O0 -g' for fast compile to test the make # Use 'OPT = -xP' for fast run on em64t (Hydra and Guppy) # Use 'OPT = -xN' for fast run on ia32 (Salmon and Minke) # OPT = -O0 –g # OPT = -axN –xN # OPT = -O3 # gfortran defs #-------------------------------------------------------------------------- CPP = /usr/bin/cpp COMPILER = -DGFORTRAN CC = mpicc CXX = mpicxx FC = mpif90 DEBFLGS = OPT = -O3 -ffixed-line-length-none -ffree-form -ffree-line-length-none CLIB =
vi env-fvcom.sh
export GCC_HOME=/path/to/GNU export PATH=$GCC_HOME/bin:$PATH export LD_LIBRARY_PATH=$GCC_HOME/lib:$GCC_HOME/lib64:$LD_LIBRARY_PATH export MPI_HOME=/path/to/OPENMPI export PATH=$MPI_HOME/bin:$PATH export LD_LIBRARY_PATH=$MPI_HOME/lib:$LD_LIBRARY_PATH export HDF5=/path/to/HDF5 export PATH=$HDF5/bin:$PATH export LD_LIBRARY_PATH=$HDF5/lib:$LD_LIBRARY_PATH export NETCDF=/path/to/NETCDF export PATH=$NETCDF/bin:$PATH export LD_LIBRARY_PATH=$NETCDF/lib:$LD_LIBRARY_PATH
source env-fvcom.sh
cd ./METIS_source
tar -zxvf metis.tgz
cp /path/to/METIS/metis-4.0.patch ./
cd metis patch -p2 < ../metis-4.0.patch
mkdir -p /path/to/FVCOM/FVCOM4.1/FVCOM_source/libs/install/lib mkdir -p /path/to/FVCOM/FVCOM4.1/FVCOM_source/libs/install/include mkdir -p /path/to/FVCOM/FVCOM4.1/FVCOM_source/libs/install/bin
make -j make install
cd ../../FVCOM_source/libs
tar -zxvf julian.tgz
cd julian
make -j make install
cd /path/to/FVCOM/FVCOM4.1/FVCOM_source
vi mod_newinp.F
!---------------------------------------- ! functions !---------------------------------------- contains Character( Len = 256 ) Function N_Fmt( c , n ) Character( Len = * ) , Intent( IN ) :: c Integer , Intent( IN ) :: n integer :: i , j character( len = 16 ) :: cn i = index( c , '<' ) j = index( c , '>' ) write( cn , '(g0)' ) n N_Fmt = c(:i-1) // Trim(adjustL(cn)) // c(j+1:) End Function N_Fmt
第352行:
write(*,'(A20,<size>F10.4)')trim(argname)//': ',fval(1:SIZE)
write(*,N_Fmt('(A20,<size>F10.4)',SIZE))trim(argname)//': ',fval(1:SIZE)
第421行:
write(*,'(A20,<size>I10)')trim(argname)//': ',ival(1:SIZE)
write(*,N_Fmt('(A20,<size>I10)',SIZE))trim(argname)//': ',ival(1:SIZE)
第494行:
write(*,'(A20,<size>L10)')trim(argname)//': ',cval(1:SIZE)
write(*,N_Fmt('(A20,<size>L10)',SIZE))trim(argname)//': ',cval(1:SIZE)
第567行:
write(*,'(A20,<size>A10)')trim(argname)//': ',sval(1:SIZE)
write(*,N_Fmt('(A20,<size>A10)',SIZE))trim(argname)//': ',sval(1:SIZE)
sed -i 's/\/=\.TRUE\./\.neqv\.\.TRUE\./g' mod_scal.F sed -i 's/==\.TRUE/\.eqv\.\.TRUE/g' internal_step.F sed -i 's/==\.FALSE\./\.eqv\.\.FALSE\./g' adv_t.F sed -i 's/==\.FALSE\./\.eqv\.\.FALSE\./g' adv_s.F
make
安装成功后,可使用ll命令在当前目录查看生成的可执行文件“fvcom”。