建立一个新文件夹,将ROMS源码检出到文件夹中,获取源码需要注册帐户。
cd /path/to/ROMS mkdir ROMS_3.6 svn checkout --username 帐户名 --password 密码 https://www.myroms.org/svn/src/trunk ROMS_3.6
例如:
使用HPC/Huawei12#$的帐户及密码进行源码检出,命令如下:
svn checkout --username HPC --password Huawei12#$ https://www.myroms.org/svn/src/trunk ROMS_3.6
源码文件结构如下:
cd /path/to/ROMS mkdir ROMSProjects cd ROMSProjects mkdir upwelling cd upwelling
cp /path/to/ROMS/ROMS_3.6/ROMS/Bin/build.bash .
vi build.bash
export ROMS_APPLICATION=UPWELLING
export MY_ROOT_DIR=/path/to/ROMS export MY_PROJECT_DIR=${MY_ROOT_DIR}/ROMSProjects/upwelling
export MY_ROMS_SRC=/path/to/ROMS/ROMS_3.6
export USE_MPI=on export USE_MPIF90=on export which_MPI=openmpi
export FORT=gfortran
export USE_LARGE=on export USE_NETCDF4=on export USE_PARALLEL_IO=on
export PATH=/path/to/OPENMPI/bin:$PATH
export NF_CONFIG=/path/to/NETCDF/bin/nf-config export NETCDF_INCDIR=/path/to/NETCDF/include export NETCDF_LIBDIR=/path/to/NETCDF/lib
cp /path/to/ROMS/ROMS_3.6/ROMS/External/ocean_upwelling.in . cp /path/to/ROMS/ROMS_3.6/ROMS/External/varinfo.dat cp /path/to/ROMS/ROMS_3.6/ROMS/Include/upwelling.h .
vi ocean_upwelling.in
VARNAME = /path/to/ROMS/ROMSProjects/upwelling/varinfo.dat
NtileI == 6 NtileJ == 16
NtileI、NtileJ的设置规则参考故障排除。
./build.bash -j 8
在使用MPI的情况下,编译成功将生成可执行文件“OceanM”,可使用ls命令进行查看。
ll /path/to/ROMS/ROMSProjects/upwelling
-rwxr-xr-x 1 root root 1671056 Aug 15 18:41 oceanM