Rate This Document
Findability
Accuracy
Completeness
Readability

Compilation and Installation

Procedure

  1. Use PuTTY to log in to the server as the root user.
  2. Use SVN to check out and obtain the ROMS source code.

    Create a folder and check out the ROMS source code to the folder. To obtain the source code, you need to register an account.

    cd /path/to/ROMS
    mkdir ROMS_3.6
    svn checkout --username Account --password Password https://www.myroms.org/svn/src/trunk ROMS_3.6

    Example:

    Run the following command to check out the source code using HPC/Huawei12#$:

    svn checkout --username HPC --password Huawei12#$ https://www.myroms.org/svn/src/trunk ROMS_3.6

    The source code file structure is as follows:

  3. Customize the build script.
    1. To keep the source code unchanged, run the following command to create a ROMSProjects folder for compiling and running the ROMS. upwelling is the default example in the source code package.
      cd /path/to/ROMS
      mkdir ROMSProjects
      cd ROMSProjects
      mkdir upwelling
      cd upwelling
    2. Run the following command to copy the .bash file to the upwelling directory in the current environment. The build.sh and build.bash files exist in the ROMS/Bin directory of the source code.
      cp /path/to/ROMS/ROMS_3.6/ROMS/Bin/build.bash .
    3. Run the following command to edit the build.bash file:
      1. Open build.bash.
        vi build.bash
      2. Press i to enter the insert mode and modify the file as follows:
        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
      3. Press Esc, type :wq!, and press Enter to save the file and exit.
  4. Run the following commands to copy the input and configuration files:
    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 .
  5. Run the following command to edit the ocean_upwelling.in file:
    1. Open ocean_upwelling.in.
      vi ocean_upwelling.in
    2. Press i to enter the insert mode and modify the ocean_upwelling.in file.
      Change the path whose VARNAME is varinfo.dat. Pay attention to the information in bold.
      VARNAME = /path/to/ROMS/ROMSProjects/upwelling/varinfo.dat
      Set NtileI and NtileJ. The product of NtileI and NtileJ must be equal to the value of np. For example, if np is set to 96, you can set NtileI and NtileJ as follows (pay attention to the information in bold):
      NtileI == 6
      NtileJ == 16

      For details about how to set NtileI and NtileJ, see Troubleshooting.

    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  6. Compile ROMS.
    ./build.bash -j 8

    When MPI is used, the executable file OceanM is generated after successful compilation. You can run the ls command to view the file.

    ll /path/to/ROMS/ROMSProjects/upwelling
    -rwxr-xr-x 1 root root 1671056 Aug 15 18:41 oceanM