Getting Started: Difference between revisions
No edit summary (change visibility) |
|||
(6 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
<div class="title">Getting Started</div> | <div class="title">Getting Started</div> | ||
ROMS is a very complex model with many options and capabilities. ROMS is composed of many Fortran files ('''.F'''), a few header files ('''.h'''), various input script files ('''.in'''), a metadata variable definition file ([[varinfo. | ROMS is a very complex model with many options and capabilities. ROMS is composed of many Fortran files ('''.F'''), a few header files ('''.h'''), various input script files ('''.in'''), a metadata variable definition file ([[varinfo.yaml]]), and a single [[makefile]]. The ROMS algorithms are distributed with the following directory structure: | ||
<span class="twilightBlue">Compilers/ make configuration files | |||
Data/ Input data root directory | |||
/ROMS/ ROMS data root directory | |||
/CDL ROMS NetCDF metadata design | |||
Master/ Main standalone and coupling programs | |||
ROMS/ ROMS root directory | |||
/Adjoint/ Adjoint model | |||
/Biology Adjoint biology/ecosystem models | |||
/Bin Executable scripts | |||
/Drivers Computational drivers | |||
/External Standard input scripts | |||
/Functionals Analytical expression header files | |||
/Include Test cases configuration header files | |||
/Modules Declaration modules | |||
/Nonlinear/ Nonlinear model | |||
/BBL Bottom Boundary Layer formulation | |||
/Biology Nonlinear biology/ecosystem models | |||
/SeaIce SeaIce model | |||
/Sediment Nonlinear sediment transport model | |||
/Obsolete Discontinued files | |||
/Programs Support programs | |||
/Representer/ Representer model | |||
/Biology Representer biology/ecosystem models | |||
/Tangent/ Tangent linear model | |||
/Biology Tangent linear biology/ecosystem models | |||
/Utility Generic utility files | |||
User/ ROMS User interface root directory | |||
/External User standard input scripts | |||
/Functionals User analytical expressions templates | |||
/Include User application header files</span> | |||
ROMS uses [[C-preprocessing]] extensively to activate and/or deactivate | ROMS uses [[C-preprocessing]] extensively to activate and/or deactivate | ||
Line 59: | Line 44: | ||
* Make sure that you have the following required software in your computer before attempting to compile and run an application: | * Make sure that you have the following required software in your computer before attempting to compile and run an application: | ||
** [ | ** [https://git-scm.com/ Git] client to download source | ||
** Fortran 90 or Fortran 95 compiler | ** Fortran 90 or Fortran 95 compiler | ||
** [http://gcc.gnu.org/onlinedocs/cpp/ cpp] program for [[C-preprocessing]] ROMS source code. | ** [http://gcc.gnu.org/onlinedocs/cpp/ cpp] program for [[C-preprocessing]] ROMS source code. | ||
Line 67: | Line 52: | ||
** Message Passing Interface (MPI) library to run in parallel on a distributed-memory system | ** Message Passing Interface (MPI) library to run in parallel on a distributed-memory system | ||
* Use a [[ | * Use a [[Git]] client to '''clone''' the latest version of the ROMS '''develop''' branch. It is highly recommended that you obtain the code on the same system that you will be compiling and running the code on to avoid file format issues. | ||
* We recommend that you use the included '''[[build Script|build script]]''' to compile and link ROMS. This will set up your build environment and execute the [[gmake|make]] command to build the default ROMS [[UPWELLING_CASE | upwelling]] application. This process allows you to avoid editing the [[makefile]]. Please visit the '''[[build Script|build script]]''' page for more detailed instructions. | * We recommend that you use the included '''[[build Script|build script]]''' to compile and link ROMS. This will set up your build environment and execute the [[gmake|make]] command to build the default ROMS [[UPWELLING_CASE | upwelling]] application. This process allows you to avoid editing the [[makefile]]. Please visit the '''[[build Script|build script]]''' page for more detailed instructions. | ||
Line 79: | Line 64: | ||
* To run ROMS in serial, just type: <div class="box"><span class="red"> | {{note}}'''Note:''' In SVN revision 933 (January 26, 2019) all <span class="red">ocean_*.in</span> files were renamed to <span class="red">roms_*.in</span> and all <span class="red">ocean*</span> ROMS executables were renamed to <span class="red">roms*</span> in order to facilitate and clarify model coupling efforts. More information can be found in the ROMS repository [https://www.myroms.org/projects/src/ticket/794 Trac ticket #794]. If you are working with a ROMS release prior to revision 933 you will need to replace <span class="red">roms_upwelling.in</span> with <span class="red">ocean_upwelling.in</span> and <span class="red">romsS</span>, <span class="red">romsM</span>, or <span class="red">romsO</span> with <span class="red">oceanS</span>, <span class="red">oceanM</span>, or <span class="red">oceanO</span> in all commands below. | ||
* To run ROMS in serial, just type: <div class="box"><span class="red">romsS < ROMS/External/roms_upwelling.in > & log &</span></div>or to run in parallel (distributed-memory) on two processors: <div class="box"><span class="red">mpirun -np 2 romsM ROMS/External/roms_upwelling.in > & log &</span></div>or to run in parrallel (shared-memory) on two processors:<div class="box"><span class="red">setenv OMP_NUM_THREAD 2<br>romsO < ROMS/External/roms_upwelling.in > & log &</span></div>Here, the the file <span class="red">ROMS/External/roms_upwelling.in</span> contains all the input parameters to required by this application. Visit [[roms.in]] for more information. | |||
{{note}}Notice that in distributed-memory, the leading <span class="red"><</span> is omitted so all parallel threads can read and process this input script without any communications in between. | {{note}}Notice that in distributed-memory, the leading <span class="red"><</span> is omitted so all parallel threads can read and process this input script without any communications in between. |
Latest revision as of 20:46, 27 December 2024
ROMS is a very complex model with many options and capabilities. ROMS is composed of many Fortran files (.F), a few header files (.h), various input script files (.in), a metadata variable definition file (varinfo.yaml), and a single makefile. The ROMS algorithms are distributed with the following directory structure:
Compilers/ make configuration files
Data/ Input data root directory
/ROMS/ ROMS data root directory
/CDL ROMS NetCDF metadata design
Master/ Main standalone and coupling programs
ROMS/ ROMS root directory
/Adjoint/ Adjoint model
/Biology Adjoint biology/ecosystem models
/Bin Executable scripts
/Drivers Computational drivers
/External Standard input scripts
/Functionals Analytical expression header files
/Include Test cases configuration header files
/Modules Declaration modules
/Nonlinear/ Nonlinear model
/BBL Bottom Boundary Layer formulation
/Biology Nonlinear biology/ecosystem models
/SeaIce SeaIce model
/Sediment Nonlinear sediment transport model
/Obsolete Discontinued files
/Programs Support programs
/Representer/ Representer model
/Biology Representer biology/ecosystem models
/Tangent/ Tangent linear model
/Biology Tangent linear biology/ecosystem models
/Utility Generic utility files
User/ ROMS User interface root directory
/External User standard input scripts
/Functionals User analytical expressions templates
/Include User application header files
ROMS uses C-preprocessing extensively to activate and/or deactivate the various numerical and physical algorithm options. It also uses NetCDF to manage input and output data streams. It is highly recommended that first time users learn the basics of NetCDF before working with ROMS.
Basic Steps
- Register at the ROMS website (www.myroms.org) to get access to the algorithms and other user privileges. Select a username and password which will be used in the future to login and post messages on the ROMS forum, algorithm downloads, and contributing to wikiROMS.
- Make sure that you have the following required software in your computer before attempting to compile and run an application:
- Git client to download source
- Fortran 90 or Fortran 95 compiler
- cpp program for C-preprocessing ROMS source code.
- GNU make version 3.81 or higher to compile ROMS
- Perl interpreter program
- NetCDF library, with Fortran 90 interface
- Message Passing Interface (MPI) library to run in parallel on a distributed-memory system
- Use a Git client to clone the latest version of the ROMS develop branch. It is highly recommended that you obtain the code on the same system that you will be compiling and running the code on to avoid file format issues.
- We recommend that you use the included build script to compile and link ROMS. This will set up your build environment and execute the make command to build the default ROMS upwelling application. This process allows you to avoid editing the makefile. Please visit the build script page for more detailed instructions.
- You can also type make at the top of the directory structure where the makefile is located but we do not recommend this process because it requires changing the ROMS files which can cause conflicts when you update you ROMS code.
Note: To speed compilation, you may want to add the -j <n> flag to the build command (i.e. build.sh -j 4) where <n> is the number of processors you wish to compile with. Even single processor machines can benefit from the -j flag with <n> = 2.
Note: To make sure your application can compile successfully, you might want to set USE_DEBUG to on in the build script since it will compile faster. Once your application can compile you can unset USE_DEBUG in order to create an optimized executable. Please visit the build script page for more information
Note: In SVN revision 933 (January 26, 2019) all ocean_*.in files were renamed to roms_*.in and all ocean* ROMS executables were renamed to roms* in order to facilitate and clarify model coupling efforts. More information can be found in the ROMS repository Trac ticket #794. If you are working with a ROMS release prior to revision 933 you will need to replace roms_upwelling.in with ocean_upwelling.in and romsS, romsM, or romsO with oceanS, oceanM, or oceanO in all commands below.
- To run ROMS in serial, just type: romsS < ROMS/External/roms_upwelling.in > & log &or to run in parallel (distributed-memory) on two processors:mpirun -np 2 romsM ROMS/External/roms_upwelling.in > & log &or to run in parrallel (shared-memory) on two processors:setenv OMP_NUM_THREAD 2Here, the the file ROMS/External/roms_upwelling.in contains all the input parameters to required by this application. Visit roms.in for more information.
romsO < ROMS/External/roms_upwelling.in > & log &
Notice that in distributed-memory, the leading < is omitted so all parallel threads can read and process this input script without any communications in between.