Difference between revisions of "Frequently Asked Questions"

From WikiROMS
Jump to navigationJump to search
Line 19: Line 19:
=== Why the _r8 at the end of real constants? ===
=== 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 [[Bibliography#ChapmanSJ_2004a | Chapman, 2004]].
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 [[Bibliography#ChapmanSJ_2004a | Chapman, 2004]].
== Input/Output NetCDF files ==
=== How to add a new variable to ROMS output files? ===
This question has been asked several times. ROMS IO design is very flexible and easy to expand. There are several steps that need to be followed to add new variables to any of the output files:
# All the ROMS output NetCDF files are created and defined in any of the routines with the prefix <span class="red">def_</span> in the ROMS/Utilities directory (said, [[def_his.F | ROMS/Functionals/analytical.F]]). The fields are written and varwritten in U.  Please follow any of variables examples in such files

Revision as of 21:11, 11 October 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 options defining a distributed test case. 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 distributed-memory, you need to edit the makefile and activate USE_MPI and USE_MPIF90 if there is not a native MPI library available (-lmpi) but an MPICH library. The MPICH library 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.

Input/Output NetCDF files

How to add a new variable to ROMS output files?

This question has been asked several times. ROMS IO design is very flexible and easy to expand. There are several steps that need to be followed to add new variables to any of the output files:

  1. All the ROMS output NetCDF files are created and defined in any of the routines with the prefix def_ in the ROMS/Utilities directory (said, ROMS/Functionals/analytical.F). The fields are written and varwritten in U. Please follow any of variables examples in such files