Each example is located in one of the directories in the examples
directory in
the main source directory. As an example, consider the internal waves example located
in examples/iwaves
. The internal waves simulation in this directory is defined by the following files
in the examples/iwaves
directory:
initialization.c
: Initial conditions
boundaries.c
: Boundary conditions
rundata/suntans.dat
: Parameters
rundata/pslg.dat
: Planar straight line graph
iwaves
directory compiles and links the initial and boundary condition
files with the main sun executable in the source directory. Then it copies the parameter
file (suntans.dat
) and the planar straight line graph file to the directory data
in
the particular example directory. Then the main sun executable is run with
../../sun -t -g -s -vv --datadir=datawhere the particular flags may depend on the example, but the executable is run from the main source directory and the data is local to the particular examples directory. In order to compile and run an example, enter that example directory and type
make test
. This will run the example simulation and place
the output data into the data directory in the examples directory.
While the simulation is running, the data can be viewed from another command line
from the main source directory with
./sunplot --datadir=examples/iwaves/dataIt is important that you run
make clobber
between successive tests in other
test directories to ensure that you are recompiling the ../../sun
executable
with the correct initial and boundary condition files each time. Without clobbering,
rerunning make test
will run the test case while only reflecting changes in suntans.dat
.
Therefore, it is not necessary to clobber if the same test is being run with different
parameters in suntans.dat
. The following test cases exist in the examples
directory. The first 5 are discussed in detail in what follows. Note that many examples
directories also contain an mfile
directory that has useful mfiles for analyzing output.