| 1 | Although you could just work within the source code distribution |
| 2 | using the Makefile, it's cleaner and will be better for you in the |
| 3 | future if you learn to use the build.sh script that allows you to |
| 4 | leave the source code directory unmodified, and have all the project |
| 5 | specific stuff in project directories. Here's how it works: |
| 6 | |
| 7 | 1. Make a project directory |
| 8 | On our Opteron cluster, I have one directory where I keep the source code |
| 9 | |
| 10 | /home/rsignell/models/roms_rutgers/trunk |
| 11 | |
| 12 | and another where I actually do model runs |
| 13 | |
| 14 | /home/rsignell/projects/ |
| 15 | |
| 16 | So on my system, for a new test, I make a directory called |
| 17 | |
| 18 | /home/rsignell/projects/test1 |
| 19 | |
| 20 | 2. Checkout the source code using SVN (or unpack the source code if |
| 21 | you grabbed my tarfile) and copy the "build.sh" script (which you will |
| 22 | find in ./ROMS/Bin subdirectory) to your project directory. |
| 23 | |
| 24 | 3. Edit "build.sh" |
| 25 | |
| 26 | I edit "build.sh" to specify: |
| 27 | MY_ROMS_APPLICATION=LAKE_SIGNELL |
| 28 | MY_ROMS_SRC=/home/rsignell/models/roms_rutgers/trunk |
| 29 | MY_PROJECT_DIR=/home/rsignell/projects/test1 |
| 30 | |
| 31 | and set which compiler I want to use (e.g. pgi, ifort) and what type |
| 32 | of executable I want (MPI, OpenMP, or Serial) |
| 33 | |
| 34 | Even though I use the pgi compiler on our cluster, I actually build |
| 35 | MPI code using the "mpif90" script, so I set USE_MPIF90 on as well as |
| 36 | pgi. |
| 37 | |
| 38 | 4. Compile. |
| 39 | Run the build.sh script. If you have more than one processor on the |
| 40 | machine you are compiling on you can use the -j option to build |
| 41 | faster. For example, to use 2 cpus: |
| 42 | |
| 43 | ./build.sh -j2 |
| 44 | |
| 45 | 5. Set up the input files for the run |
| 46 | ROMS uses an ASCII input file to specify some of the run parameters, |
| 47 | and we use the ".in" extension by convention to indicate these files. |
| 48 | For the test cases, these are found in the ~/ROMS/External directory. |
| 49 | So to run ROMS from our project directory, we need to copy over the |
| 50 | right input file for the LAKE_SIGNELL case. We also want a copy of |
| 51 | varinfo.dat, which defines NetCDF parameters. |
| 52 | |
| 53 | cp ~/models/ROMS/External/{ocean_lake_signell.in,varinfo.dat} ~/projects/test1 |
| 54 | |
| 55 | 6. Run |
| 56 | ./oceanS < ocean_lake_signell.in (Serial) |
| 57 | ./oceanO < ocean_lake_signell.in (OpenMP) |
| 58 | mpirun -n 16 -hostfile node_file ./oceanM lake_signell.in (MPI) |