G2S3 2012 Gene Golub SIAM Summer School 2012
 
Simulation and Supercomputing in the Geosciences

Table Of Contents

Previous topic

Sample Clawpack codes

Next topic

Sample GeoClaw codes

This Page

Clawpack Quickstart guide

See also:

If you use using the class VM, the Clawpack software is in the directory clawpack-4.x. If you are using it on your own computer, see the Installation instructions.

Open a terminal and do (the first $ indicates the Linux prompt):

$ cd $CLAW

This should take you into the directory clawpack-4.x. (The environment variable $CLAW should already be set properly on the VM.)

To try out an advection example:

$ cd apps/advection/1d/example1
$ make .plots

With luck this will automatically do the following:

  • Compile the Fortran code
  • Create some files ending with extension .data that are needed by the Fortran code. (Based on parameter values set in the Python script setrun.py)
  • Run the Fortran code and produce a directory named _output that has the solution at various times from the computation.
  • Run a plotting program to produce a directory named _plots that contains images *.png of the solution at various times and files *.html that allow you to easily view these images. Exactly what is plotted is determined by the file setplot.py.

If you now give the command:

$ firefox _plots/_PlotIndex.html

you should be able to view these plots.

Changing parameters

To try changing a parameter, edit the file setrun.py and then type:

$ make .plots

and reload the plot file in firefox.

Some things you might try changing:

  • clawdata.order Change the value to 1 for the first order upwind method.
  • clawdata.mthbc_xlower and clawdata.mthbc_xupper. Change both values to 2 to impose periodic boundary conditions.
  • clawdata.tfinal determines the final time you solve to.

Next steps

The directory $CLAW/apps contains a number of other applications you might want to experiment with. You might next look at the acoustics examples in $CLAW/apps/acoustics/1d/example1.

Note that the Riemann solver used for each case is in a Fortran file in the corresponding directory with the name rp1.f.

See the Clawpack Documentation for more information about changing parameters and plotting the results.