Difference between revisions of "Talk:build roms"

From WikiROMS
Jump to navigationJump to search
(New page: Here is an example of using the <span class="red">build.sh</span> script to build the LAKE_SIGNELL test case, one of my favorites! # Make a project directory. On o...)   (change visibility)
(No difference)

Revision as of 16:33, 16 June 2007

Here is an example of using the build.sh script to build the LAKE_SIGNELL test case, one of my favorites!

  1. Make a project directory. On our Opteron cluster, I have one directory where I keep the source code:
    /home/rsignell/models/roms_rutgers/trunk
    and another where I actually do model runs
    /home/rsignell/projects
    So on my system, for a new test, I make a directory called
    /home/rsignell/projects/test1
  2. Checkout the source code using svn (or unpack the source code if you got a tarfile or zipfile somewhere) and copy the build.sh script (which you will find in ROMS/Bin sub-directory) to your project directory.
  3. Edit build.sh to specify:
    MY_ROMS_APPLICATION LAKE_SIGNELL
    MY_ROMS_SRC /home/rsignell/models/roms_rutgers/trunk
    MY_PROJECT_DIR /home/rsignell/projects/test1
    and set which compiler I want to use (e.g. pgi, ifort) and what type of executable I want (MPI, OpenMP, or Serial). Even though I use the pgi compiler on our cluster, I actually build MPI code using the mpif90 script, so I set USE_MPIF90 on as well as pgi.
  4. Compile. Run the build.sh script. If you have more than one processor on the machine you are compiling on you can use the -j option to build faster. For example, to use 2 CPUs:
    <./build.sh -j 2
  5. Set up the input files for the run. ROMS uses an ASCII input file to specify some of the run parameters, and we use the .in extension by convention to indicate these files. For the test cases, these are found in the ROMS/External directory. So to run ROMS from our project directory, we need to copy over the right input files for the LAKE_SIGNELL case. We also want a copy of varinfo.dat, which defines NetCDF parameters.
    cp ~/models/roms_rutgers/trunk/ROMS/External/{*lake_signell*.in,varinfo.dat} ~/projects/test1
    I then need to modify ocean_lake_signell.in to point to the local directory to find varinfo.dat, floats_lake_signell.in and sediment_lake_signell.in.
    I can also edit ocean_lake_signell.in to specify how many tiles I want to have. If I want to run with Serial or OpenMP, I can specify the tiling however I want, but I want to run on 4 CPUs with MPI, the CPUs and number of tiles has to be the same. I want to run on 4 CPUS with MPI, so I leave the default 2x2 tiling.

    If you are lazy and don't want to make all these edits and just want to try it out, you can getand just edit these two lines (and perhaps the compiler options) in the build.sh script
    MY_ROMS_SRC /home/rsignell/models/roms_rutgers/trunk
    MY_PROJECT_DIR /home/rsignell/projects/test1
  6. Run
    ./oceanS < ocean_lake_signell.in > & log & (Serial)
    ./oceanO < ocean_lake_signell.in > & log & (OpenMP)
    mpirun -n 4 -hostfile node_file ./oceanM ocean_lake_signell.in & log & (MPI)
  7. Check out the results
    ncview ocean_his.nc