Fortran.
The main Clawpack routines are written in Fortran (a mixture of
Fortran 77 and Fortran 90/95) and so compiling and running the code
requires a Fortran compiler, such as gfortran, which is part of the GNU gcc compiler
suite.
For Mac OSX, see hpc.sourceforge.net for
some installation options.

Makefiles are used in libraries and directories and you will need some
version of make.

PYTHONPATH is a list of paths that should include $CLAW/python.
If this variable is already set in the shell from which you execute setenv.py
then it should provide an extension of the original path to include this.

FC is set to gfortran as the default compiler to use for Fortran. You may
want to change this.

There are a number of test cases bundled with Clawpack in the directories
$CLAW/apps and $CLAW/book. Here and below it is assumed that the
environment variable CLAW has been set properly as described above.

The Makefiles are set up to do dependency checking so that in many
application directories you can simply type:

$ make .plots

and the Fortran code will be compiled, data files created, the code
run, and the results plotted automatically, resulting in a set of webpages
showing the results.

However, if this is your first attempt to run a code, it is useful to go
through these steps one at a time, both to understand the steps and so that
any problems with your installation can be properly identified.

You might want to start by examining the Makefile. This sets a number of
variables, which at some point you might need to modify for other examples,
see Clawpack Makefiles for more about this. At the bottom of the Makefile is
an include statement that points to a common Makefile that is used by most
applications, and where all the details of the make process can be found.

This uses the Python code in setrun.py to create data files that have the
form *.data. For the 1d advection example, two files are created,
claw.data and setprob.data. The file claw.data
contains standard run-time
parameters of Clawpack (such as the number of grid cells mx, indications
of what method to use, what boundary conditions to impose, etc.).
The file setprob.data typically contains parameters specific to a
particular application, in this case the advection velocity u.

In Clawpack 4.3 and earlier versions, the user would modify the claw.data
and setprob.data files directly. Starting with Clawpack 4.4, the
recommended approach is to only modify the Python function setrun defined
in the file setrun.py, and use “make .data” to create the *.data files.
See Specifying run-time parameters in setrun.py for more details.

Once the executable and the data files all exist, we can run the code. The
recommended way to do this is to type:

One could run the code by typing ”./xclaw”, but using the make option has
several advantages. For one thing,
this checks dependencies to make sure the executable and data files are up
to date, so you could have typed “make .output” without the first two steps
above.

Also, before running the code a subdirectory _output is created
and the output of the code (often a large number of files) is directed to
this subdirectory. This is convenient if you want to do several runs with
different parameter values and keep the results organized. After the code
has run you can rename the subdirectory, or you can modify the variable
OUTDIR in the Makefile to direct results to a different directory. See
Clawpack Makefiles for more details. Copies of all the data files are also
placed in the output directory for future reference.

If the code runs successfully, you should see output like the following:

The fort.info file contains information about the run just completed. The files
with names of the form fort.t000N and fort.q000N contain the computed results for
Frame N. See fortfiles for more information about the contents of these files.

Normally you will not want to examine these files directly, but instead will use a
plotting tool to plot the results.

Plotting the results.
Once the code has run and the files listed above have been created, there are several
options for plotting the results.

If this works, it will create a subdirectory named _plots that contains a number of
image files (the *.png files) and a set of html files that can be used to view the
results from a web browser. See plotting_makeplots for more details.

Other visualization packages could also be used to display the results, but you will need
to figure out how to read in the data. See fortfiles for information about the
format of the files produced by Clawpack.