Note that you need the NetCDF software in order to create the OPA executable. If this software is not available on your computer, you should install it first. You can obtain the source code distribution of the NetCDF library via the OPA 8.1 page of the CKO website.
Unpacking the Software
To install the OPA 8.1 package, you should first create a directory
named OPA and change to this directory. Next, you should unpack
the package using the commands
gunzip -c ../opa-global.tar.gz | tar xvf -
Now, the directory OPA should have the following contents (dates and times may differ)
bgwd63 252% ll total 600 -rw-r--r-- 1 severijn ksoo 4210 Oct 4 17:25 acconfig.h -rw-r--r-- 1 severijn ksoo 17305 Oct 3 16:09 aclocal.m4 drwxr-xr-x 2 severijn ksoo 25 Nov 15 13:09 bin drwxr-xr-x 4 severijn ksoo 41 Nov 15 13:10 climatology drwxr-xr-x 2 severijn ksoo 4096 Nov 15 13:10 config -rwxr-xr-x 1 severijn ksoo 196649 Nov 15 09:10 configure -rw-r--r-- 1 severijn ksoo 40935 Nov 14 15:53 configure.in drwxr-xr-x 2 severijn ksoo 50 Nov 15 13:10 data drwxr-xr-x 2 severijn ksoo 119 Nov 15 13:10 doc drwxr-xr-x 3 severijn ksoo 4096 Nov 15 13:10 ferret drwxr-xr-x 2 severijn ksoo 4096 Nov 15 13:10 ioipsl drwxr-xr-x 2 severijn ksoo 12288 Nov 15 13:11 source -rw-r--r-- 1 severijn ksoo 10 Nov 15 09:11 stamp-h drwxr-xr-x 2 severijn ksoo 4096 Nov 15 13:11 support drwxr-xr-x 2 severijn ksoo 4096 Nov 15 13:11 toolsThe file configure is a script that you will use to configure the OPA 8.1 package for your computer. Here is a description of the directories.
Configuration
You need to configure OPA for two reasons: first, because of the differences
between the computers on which OPA can run. Second, because you need to
adapt the model for your research topic. We describe how you can configure
OPA in these cases in the following sections.
Configuring for Your Computer
Most of the work related to configuring OPA for you computer is handled
by the script configure that you can find in the directory OPA.
In this section we describe how you can configure OPA if you are using
it on a single processor. If you want to use a parallel configuration of
OPA you should read the section Configuring for Parallel
Execution instead of this.
The script will figure out where it can find all the tools and libraries that are needed to compile and run the OPA model. On some computers, the configuration script is not able to find the NetCDF library. In this case, you have to specify the location of this library with a command-line option. You can determine this directory by searching for the file netcdf.h. The path to this file will usually be something like /usr/local/include/netcdf.h. Everything upto (but not including) `include' is the directory you are looking for.
Once you know where the NetCDF software is located, you can configure OPA for your computer by entering the command
./configure --with-netcdf=location-of-netcdf
in the directory OPA. For example, if the file netcdf.h is located in the directory /usr/local/include then the configuration script is invoked as follows
./configure --with-netcdf=/usr/local
During the configuration process a number of makefiles, scripts, and include files are created. In addition, some data files are created in the OPA/climatology directory. When the configuration process is finished, the contents of the directory OPA should be similar to this
bgwd63 254% ll total 704 -rw-r--r-- 1 severijn ksoo 1441 Nov 15 13:18 Makefile -rw-r--r-- 1 severijn ksoo 4210 Oct 4 17:25 acconfig.h -rw-r--r-- 1 severijn ksoo 17305 Oct 3 16:09 aclocal.m4 drwxr-xr-x 2 severijn ksoo 124 Nov 15 13:19 bin drwxr-xr-x 4 severijn ksoo 58 Nov 15 13:18 climatology drwxr-xr-x 2 severijn ksoo 4096 Nov 15 13:18 config -rw-r--r-- 1 severijn ksoo 5030 Nov 15 13:18 config.cache -rw-r--r-- 1 severijn ksoo 18430 Nov 15 13:18 config.log -rwxr-xr-x 1 severijn ksoo 16619 Nov 15 13:18 config.status -rwxr-xr-x 1 severijn ksoo 196649 Nov 15 09:10 configure -rw-r--r-- 1 severijn ksoo 40935 Nov 14 15:53 configure.in drwxr-xr-x 2 severijn ksoo 67 Nov 15 13:18 data drwxr-xr-x 2 severijn ksoo 136 Nov 15 13:18 doc drwxr-xr-x 3 severijn ksoo 4096 Nov 15 13:18 ferret drwxr-xr-x 2 severijn ksoo 43 Nov 15 13:18 include drwxr-xr-x 2 severijn ksoo 4096 Nov 15 13:18 ioipsl drwxr-xr-x 2 severijn ksoo 12288 Nov 15 13:19 source -rw-r--r-- 1 severijn ksoo 10 Nov 15 13:18 stamp-h drwxr-xr-x 2 severijn ksoo 4096 Nov 15 13:18 support drwxr-xr-x 2 severijn ksoo 4096 Nov 15 13:19 toolsNote that the configuration script creates one more directory
You can change the run-time parameters by editing the files namelist and output.namelist in the directory OPA/data. The first file contains the parameters that control the model run, and the parameters in the second file are used to configure the output of the OPA model. Both files contain a brief description of their content. More extensive information about the parameters in the file namelist is available in the OPA user manual.
You can change the compile-time keys by editing the file global-ocean-4degree that you can find in the directory OPA/config. The keys are briefly documented in this file and more extensively in the manual. If you don't want to change the file global-ocean-4degree you can edit a copy of it in the config directory. In this case you have to reconfigure OPA in the following manner
./configure --with-parameters=name-of-configuration
For example, if your configuration file is config/spinup-100yr-4degree you should reconfigure OPA with
./configure --with-parameters=spinup-100yr-4degree
In any case, make sure that you recompile the source as described in the section Compilation below. Otherwise, your changes will not take effect.
Compilation
You can compile the OPA sources by typing the following command in
the OPA directory
make install
Once the make process is finished you will find the executable opa-global-ocean-4degree (or opa-your-configuration file) in the directory OPA/bin. This directory should also contain the tool mpptocdf now.
In the case that you modified any of the compile-time keys in the file global-ocean-4degree or you created your own configuration file in the directory OPA/config it is advisable to first remove all files that are influenced by your modifications. You can do this with the command
make veryclean
Running
When the OPA executable has been created you can start the demonstration
run by entering the command
make run
in the directory OPA. The script will create links to the appropriate data files in directory OPA/data. On SGI computers this commands returns when the demonstration run is finished. On the other computers, this command places a request in the NQS batch queue using the command qsub and returns. The batch system will start the demonstration run later on.
Depending on the computer that you are using (and its load) the demonstration run may take from about five minutes to an hour. Some data about computing times and memory usage are available on the page on OPA 8.1 of the CKO website.
Configuring for Parallel Execution
Before explaining how to configure OPA for parallel execution we note
that the input file dist.coast (in the directory OPA/data)
needed by the parallel configuration can only be created by running OPA
in the monotasking configuration. So, before continuing check that this
file exists. Note, that the contents of this file depends on the bathymetry
that you use. Therefore, remove the dist.coast file whenever you
decide to use a different bathymetry file and perform a short monotasking
run to recreate it.
Before you can configure OPA for parallel execution you have to decide how many processors you want to use and how you want to divide the work amongst them. You do this by subdividing the model grid and assigning each part to a processor. The model grid is always subdivided along the two horizontal coordinates axes. When you use m processors on the longitudinal axis and n on the latitudinal axis, you have a processor grid of m × n processors. Once you have determined the processor grid you can configure OPA with the following command
./configure --enable-type=mpi --with-pgrid=processor-grid
For example, if you want to use three processors in a 1 × 3 processor grid you would enter the command
./configure --enable-type=mpi --with-pgrid=1x3
Note that you don't have to specify the location of the NetCDF software here because the configuration script stored this information when you configured OPA for monotasking executable. After the configuration process is finished you compile the executable as described in the section Compiling above. Once you have selected the MPI-based parallel configuration, you don't have to provide the first option to the configuration script when you want to change the processor grid.
If you decide to use a monotasking configuration again, reconfigure the software by entering the command
./configure --enable-type=monotasking
and recompile the executable as described in the section Compiling.
test
Last
modified: Wed Sep 13 18:10:53 CEDT