Difference between revisions of "Frequently Asked Questions"

From WikiROMS
Jump to navigationJump to search
Line 8: Line 8:


=== What do I have to do to run an application? ===
=== What do I have to do to run an application? ===
There are basically four levels of complexity in running an application:
There are basically two modes to run a ROMS application: serial or parallel
# Mostly all canned [[Test Cases | applications]] that come with the ROMS distribution do not need input NetCDF files. The grid, initial conditions and forcing conditions are specified with analytical expressions in [[analytical.F | ROMS/Functionals/analytical.F]]. Any of these test cases can be run by editing the <span class="red">ROMS_APPLICATION</span> definition in the [[makefile]] with the application flag. A [[cppdefs.h#Options_for_idealized_test_problems | list]] of all pre-defined model applications can be found in header file [[cppdefs.h]]. The next step is to compile and link using the [[gmake | make]] tool and, if you are lucky, the program will build. It is good practice to execute '''make clean''' first. Then, the application should run with the command: <div class="box"><span class="red">oceanS &lt; ocean_*.in &gt; & log & </span></div>  
# Mostly all canned [[Test Cases | applications]] that come with the ROMS distribution do not need input NetCDF files. The grid, initial conditions and forcing conditions are specified with analytical expressions in [[analytical.F | ROMS/Functionals/analytical.F]]. Any of these test cases can be run by editing the <span class="red">ROMS_APPLICATION</span> definition in the [[makefile]] with the application flag. A [[cppdefs.h#Options_for_idealized_test_problems | list]] of all pre-defined model applications can be found in header file [[cppdefs.h]]. The next step is to compile and link using the [[gmake | make]] tool and, if you are lucky, the program will build. It is good practice to execute '''make clean''' first. Then, the application should be run in serial with the command: <div class="box"><span class="red">oceanS &lt; ocean_</span><span class="blue">APPLICATION</span><span class="red">.in &gt; & log & </span></div>where <span class="blue">APPLICATION</span> is the lowercase of any of the CPP option defining a distributed test cases. For example, the upwelling ([[UPWELLING]]) [[UPWELLING_CASE | test case]] uses the input script <span class="red">ocean_upwelling.in</span> which is located in the '''ROMS/External''' directory.
# Canned applications that come with ROMS and require input files. Same as above, but now they have to be run with a command like ./oceanS < External/ocean_some_predefined_app.in. These may also require netCDF input files with names like ocean_some_predefined_app.nc.
# Few canned applications that come with ROMS require input NetCDF files which are located in the '''Data/ROMS''' directories. Same as above, but if you want run in parallel on a distributed-memory computer use: <div class="box"><span class="red">mpirun -np 2 oceanM ocean_test_head.in &gt; & log & </span></div>for the [[TEST_HEAD_CASE | test headland case]], for example. You need to be sure that the product of <span class="red">NtileI</span> and <span class="red">NtileJ</span> in <span class="red">ocean_test_head.in</span> is '''2''' since the above command specifies two processors to run (<span class="red">-np 2</span>). Notice that to compile the model in distribute-memory, you need to edit the [[makefile]] and activate <span class="red">USE_MPI</span> and <span class="red">USE_MPIF90</span> if not native MPI library but the MPICH library which uses the [[mpif90]] script for compiling.
# User-specified applications with no input data. These are the best test beds for new users or new algorithms. They consist of a set of selected cpp options in /Include/cppdefs.h, a user-generated .in file, and usually modifications to /Nonlinear/analytical.F to specify initial, boundary, and forcing conditions internally.
# User applications with input data...the real deal. These require changes to cppdefs.h, some_app.in, and appropriate input files for initialization and forcing.


== Compiling and Linking ==
== Compiling and Linking ==

Revision as of 04:40, 14 June 2007

Frequently Asked Questions

Installation and Configuration

My build finished with no errors. Where is the ROMS executable?

It is either in oceanS (serial), oceanO (shared-memory, OpenMP), oceanM (distributed-memory, MPI), or oceanG (debug). Check the makefile to see which options are on. The makefile definition BINDIR controls where to write the compiled ROMS executable.

What do I have to do to run an application?

There are basically two modes to run a ROMS application: serial or parallel

  1. Mostly all canned applications that come with the ROMS distribution do not need input NetCDF files. The grid, initial conditions and forcing conditions are specified with analytical expressions in ROMS/Functionals/analytical.F. Any of these test cases can be run by editing the ROMS_APPLICATION definition in the makefile with the application flag. A list of all pre-defined model applications can be found in header file cppdefs.h. The next step is to compile and link using the make tool and, if you are lucky, the program will build. It is good practice to execute make clean first. Then, the application should be run in serial with the command:
    oceanS < ocean_APPLICATION.in > & log &
    where APPLICATION is the lowercase of any of the CPP option defining a distributed test cases. For example, the upwelling (UPWELLING) test case uses the input script ocean_upwelling.in which is located in the ROMS/External directory.
  2. Few canned applications that come with ROMS require input NetCDF files which are located in the Data/ROMS directories. Same as above, but if you want run in parallel on a distributed-memory computer use:
    mpirun -np 2 oceanM ocean_test_head.in > & log &
    for the test headland case, for example. You need to be sure that the product of NtileI and NtileJ in ocean_test_head.in is 2 since the above command specifies two processors to run (-np 2). Notice that to compile the model in distribute-memory, you need to edit the makefile and activate USE_MPI and USE_MPIF90 if not native MPI library but the MPICH library which uses the mpif90 script for compiling.

Compiling and Linking

Basic Usage

Algorithm Design

Why the _r8 at the end of real constants?

Some computers use 32 bits for single precision real numbers and 64 bits for double precision, and some use 64 and 128, respectively. For consistent results on various machines, ROMS takes advantage of the intrinsic F90/95 function SELECTED_REAL_KIND( ). (See [[mod_kinds | ROMS/Modules/mod_kinds.F). This allows you to associate an integer parameter with a specific data type...in this case r8 is associated with 64-bit precision. RTFM (Read the Fortran90 Manual), or better yet, chapter 11 in Chapman, 2004.