This section aims to give a quick insight into the SEA code and how it can be used. It is strongly recommended to anyone that has not previously used the SEA model. Using a worked example, an initial sequential run of a pseudo global model will be completed and the resulting restart file archived ready for analysis.
When the source code is initially downloaded, the default Makefile settings are configured to select the simple_world domain. This automatically generates a pseudo global model, with an idealised topography, extending from 70°S to 70°N. The spatial grid is defined with a two degree horizontal resolution in both the longitude and latitude directions and 15 vertical depth levels (which vary from 30m at the ocean surface to 800m at the ocean floor). All that is required to generate the sea executable, is to proceed through the make procedure, as detailed below, from within the SEA directory.
Note: It may be necessary to adjust some environment variables to correctly describe your architecture, as detailed in the User Guide.
The following screen dump is what to expect when the default make sequence is executed: make clean; make config; config; make sea
% make clean
rm -f config sea post-sea pre-sea pre-data
rm -f map.in include/gridres.h
rm -f data/model/*
rm -f *.o
% make config
f77 -r8 -O -I./include -I./utils -Dsimple_world -Dcyclic \
-o config utils/config.F src/utils.F
% config
-------------------------
SEA Configuration Routine
-------------------------
==> Pseudo topography being generated
Number of Sub Grids = 1
Allocated Processors = 1
Total Sea Points = 129282
Ideal Sea Points = 129282
Min Sea Points = 129282
Max Sea Points = 129282
% make sea
f77 -r8 -O -I./include -I./src -Dsimple_world -Dcyclic -Dde_checkbd \
-o sea src/sea.F
The config part of this procedure results in the generation of three files. The header file, include/gridres.h is later used in the compilation of the main SEA code (make sea). The other two files (read in at run-time) are processor map map.in and a topography file data/model/topog.0. The necessity of these files becomes more apparent when running in parallel mode and is explained fully in the user guide.
Having completed the make procedure, the sea program is ready to run. At run time (in addition to the two files above) the model will read in the file ocean.in, which is used to specify a number of variable run time parameters. Assuming the downloaded copy has not been changed, the model will run for one model day (first_day = 0.0, last_day = 1.0), from an initial state (init = .true). During the run a diagnostic line will be output every 0.2 days (tsi = 0.2) and a restart file will be output at the end of the run (restrt = .true.). (The meaning of the parameters and others is explained in full in the model user guide).
% sea
The Southampton - East Anglia (SEA) Model ... v3.0
==> The following #ifdef options are in effect:
ARCH =
DOMAIN = simple_world cyclic
PHYSICS = de_checkbd
FORCING =
MISC =
==> The following domain has been prescribed:
STLON = 0.0000 STLAT = -70.0000
DXDEG = 2.0000 DYDEG = 2.0000
IALL = 182 JALL = 73 KM = 15
==> Start of model run
==> TStep = 5 Day = 0.21 Year = 0.00 CPU = 1.417 7.48
DTemp = 5.526975E-08 DSalt = 1.081334E-12 KE = 6.655746E-01
==> TStep = 10 Day = 0.42 Year = 0.00 CPU = 1.422 14.66
DTemp = 3.896270E-08 DSalt = 1.072800E-12 KE = 6.580853E-01
==> TStep = 14 Day = 0.58 Year = 0.00 CPU = 1.413 20.34
DTemp = 3.969908E-08 DSalt = 1.066305E-12 KE = 6.231241E-01
==> TStep = 19 Day = 0.79 Year = 0.00 CPU = 1.427 27.49
DTemp = 3.820317E-08 DSalt = 1.060359E-12 KE = 5.313760E-01
==> TStep = 24 Day = 1.00 Year = 0.00 CPU = 1.411 34.71
DTemp = 3.475607E-08 DSalt = 1.056989E-12 KE = 5.375780E-01
==> Writing restart file(s) for timestep = 24
Filename = restarts/model/r000001
==> End of model run
To briefly explain the screen output, the header part is displayed at the start of the run, displaying some of the model configuration details. The diagnostic lines show details of the current timestep (DTemp and DSalt are the current rate of change of Temperature and Salinity in the model, whilst KE is the total Kinetic Energy). The exact values may vary slightly, depending on machine precision (also when run in parallel mode, truncation errors mean that the order of the summing is important and will also vary for different configurations), but provided they are correct to a few decimal places then the model should have run okay. The CPU values indicate the CPU time required to complete the current timestep and the total CPU time since the start of the run. These will almost certainly differ from one machine to another.
The resultant restart file is a direct access file that is written to the restarts/model directory, and will be named r000001.0 - the ".0" suffix indicates the process number that created the file (only truly relevant when running in parallel mode). To further manipulate the data contained within this file, or visualise it using the OCCAM plotting routines, it is possible to post-process the restart file and convert it to either an HDF file (r000001.hdf), or an unformatted sequential file (r000001.ufm), which will be stored in the restarts directory. For HDF to be used, the software must have been installed and the environment variables HDF_INC and HDF_LIB must be set correctly (as described in the Installation section). The Makefile must also indicate that HDF may be used by the SEA post-processing utility, using the following variables (if they are not set only unformatted sequential file options will be offered):
AR_FORM = -Dhdf AR_FLGS = -I$(HDF_INC) -L$(HDF_LIB) AR_LIBS = -lnetcdf -ldf
Having indicated the required archive format, the post-sea program may be compiled and run:
% make post-sea
f77 -r8 -O -I./include -I./utils -I./src -Dsimple_world -Dcyclic \
-I/usr/local/OCCAM/HDF3.3r4/include -L/usr/local/OCCAM/HDF3.3r4/lib/ALPHA -Dhdf \
-o post-sea utils/post-sea.F src/utils.F -lnetcdf -ldf
% post-sea
---------------------------
SEA post processing utility
---------------------------
1. Convert restart(s) to UFM
2. Convert snapshot(s) to UFM
3. Convert restart(s) to HDF
4. Convert snapshot(s) to HDF
5. Convert UFM restart to HDF
6. Convert UFM snapshot to HDF
7. Convert HDF restart to UFM
8. Convert HDF snapshot to UFM
0. Exit
==> Enter post processing option required
3
==> Enter name of restart file (eg. r000000)
r000001
==> Source file(s): restarts/r000001.#
Destination file: restarts/r000001.hdf
==> Keep source file(s) after processing (y/n) ?
y
==> Post processing in progress
Header Details
Free Surface Height
Barotropic U Velocity
Barotropic U Velocity
U Velocity
V Velocity
Potential Temperature
Salinity
... Done
From this example, a file restarts/r000001.hdf has been created and is ready for analysis. The file restarts/r000001.0 has been removed (to save filestore), but would have been kept had the response been "y" to the "Keep sub-files after merging ?" question. It is only worth keeping the unprocessed ".#" files if you wish to restart a run from that point, rather than from the beginning. If you delete them and later decide you need to restart from them, they can be re-created from the HDF (or unformatted) archive using the pre-sea utility. This is compiled and run in similar fashion to the post-sea utility.
If the OCCAM plotting routines have been installed, the archive file can be analysed visually, with a routine such as mplot. An example plot from this package, of the free surface height after one day, for this simple_world can be seen here.