CLAWPACK (Conservative LAW's PACKage) is a package of Fortran subroutines for solving time-dependent hyperbolic systems of conservation laws in 1, 2 and 3 space dimensions made by Randall J. LeVeque.The finite differences method is used with a flux limitation .This library is freely available on the web and can be downloaded from



Organization of CLAWPACK




A number of applications are in the claw/applications directory. These are typically subdivided into 1d and 2d, and then within each of these is a subdirectory rp which contains the Riemann solver(s) and other subdirectories for solving particular problems or classes of problems. These are :



This is the basic directory containing the softawre package itself, and has subdirectories 1d, 2d, and 3d, containing the algorithms in 1,2 and 3 space dimensions respectively.There is also a subdirectory limiters which contains limiter functions used in all dimensions.
Each of the dimensionnal subdirectories is organized in a similar manner, and 1d will be described in a next part Example of 1D Fortran subroutines.



This directory contains the documentation in the form of postcript files. This is divided into Notes on various aspect of the software or particular applications :

Note 1

Introduction to using clawpack

Note 2

The Clawpack Algorithms

Note 3

Boundary conditions

Note 4

Auxiliary variables

Note 5

Source terms

Note 6

Capacity-form flux differencing

Note 7

Burgers' equation

Note 8

Advection algorithms

Note 9

Advection on a curvilinear grid

Note 10

Advection in stratified fluid

Note 11

Saturated groundwater flow

Note 12


Note 13

Acoustics in a heterogenous medium

Note 14

Isothermal gas dynamics

Note 15

Euler equations

See also the paper
Wave propagation algorithms for multi-dimensional hyperbolic systems, J. Comput. Phys. 131(1997) pp 327-353.

After downloading, you can print it with giving the following command :
lp -dprinter's name note*.ps



Getting started with Clawpack

The best is to look at the simple example programs included 1d, 2d or 3d directories. For example in clawpack/1d/ you will find a subdirectory nammed example. It is organized in the same manner as other applications directories. It contains the following files :


Description of the example


This file contains the Unix instruction needed to compile the code, pulling together the necessary surboutines from different directories. Giving the command


at the unix prompt will execute f77 to compile the program and produce the executable


If it does not work , verify that the acces permission of compile for the user is x; if not give this command :

chmod u+x -compile

In order for this to work properly, the environnement variable CLAWPACK must be set to point to the proper path for the clawpack routines. This can be put in your .cshrc file.


Data file is read in by the program to set various parameters. To run the code, type



The main driver routine for this example, which calls clawpack.


Sets initial conditions

To view the results, open matlab and then type : plotq

For more details, see the manual and forget the files README.