This document will be updated throughout the course
p329f.f:
Source code for the p329f library.
p329fsa.f: Sample
driver for library routines.
vcyc.f for
usage information.
Sample driver routine:
mg0.f, include
file
mgprob.inc
and
Makefile.
Sample load statement:
f77 -g -n32 pgm.o \
-lvcyc -lv3util -lv2util -lvutil -lutilio -lutilmath -o pgm
tlat2d.f
and Makefile illustrating
use.
ser is a very powerful tool for analyzing
the output of finite-difference codes in one spatial dimension
and time. Any of the Center for Relativity graduate students
or postdocs who are working with me will be happy to give you
a quick tutorial, as will I.
libfftpack.a contains Fortran-callable routines for
performing single and double precision FFTs. Available on
einstein.
Documentation for the double precision routines is available
here. Sample usage:
f77 -g -n32 pgm.o -lfftpack -o pgm
Sample main program,
tfft.f and
Makefile which uses
some of the basic routines.
% explorer
Here are links to Postscript versions of the User's Guide
with graphics
and
without graphics.
BBH_I, BBH_D, BBH_C
are synonymous with
int, double, char
in C, and
integer, real*8, character
in Fortran.
Fortran routines have the same names (gft_write_bbox etc.)
and can be either called, or invoked as integer functions.
For output of 2- and 3-D arrays on uniform finite-difference meshes, the
routines
gft_write_bbox
gft_close_all
should suffice. Here is a usage example:
integer nx, ny
parameter ( nx = 65, ny = 33 )
real*8 gfcn(nx,ny)
real*8 xmin, xmax, ymin, ymax,
& time
integer shape(2), rank
real*8 bbox(4)
.
.
.
c------------------------------------------------------
c 'bbox' defines 'bounding box' of coords.
c associated with the data:
c
c bbox := ( xmin, xmax, ymin, ymax )
c------------------------------------------------------
bbox(1) = xmin
bbox(2) = xmax
bbox(3) = ymin
bbox(4) = ymax
rank = 2
shape(1) = nx
shape(2) = ny
do it = 1 , nt
.
.
.
c------------------------------------------------------
c The first (string) arg. to 'gft_write_bbox'
c is stripped of non alphanumeric/underscore
c characters (including punctuation) if necessary,
c and then used as the 'stem' for a filename of
c the form 'stem.hdf'. All calls to 'gft_write_bbox'
c with the same string result in output to the
c same file.
c------------------------------------------------------
time = it * 1.0d0
call gft_write_bbox('gfcn',time,shape,rank,
& bbox,gfcn)
end do
c------------------------------------------------------
c 'gft_close_all' MUST be called after all 'gft_'
c output is complete.
c------------------------------------------------------
call gft_close_all()
.
.
.
The gft_ routines use the NCSA HDF format and libraries. HDF is a machine-independent binary format; thus data output using gft_write_bbox on a Cray, for example, can be processed on an SGI. On the SGIs, 2- and 3-D data is best visualized using IRIS Explorer. A locally developed module, called ReadHDF_GFT0, is available for Explorer input of data written using the gft_ routines. Here's an image of an Explorer map which uses this module.
Linking to libbbhutil.a on einstein:
% f77 -g -n32 -L/usr/localn32/lib pgm.o \
-lbbhutil -lmfhdf -ldf -ljpeg -lz -o pgm
Linking to libbbhutil.a on charon:
% cf77 -L/hpcf/u0/ph/az/phaz337/lib pgm.o \
-lbbhutil -lnetcdf -ldf -o pgm
% nbody 2.0 0.01 < nbody_input | pp2d % nbody 2.0 0.01 < nbody_input | pp2d -mHelp is available via
% pp2d -hThe source code, pp2d.c and pp2d.h, may be of interest to those of you interested in using OpenGL for graphics programming. Makefile for pp2d.
% cc -n32 -I/usr/local/include pp2d.c -L/usr/localn32/lib -lglut \
-lMesaaux -lMesatk -lMesaGLU -lMesaGL -lXmu -lXi -lXext -lX11 \
-lm -o pp2d
p329fsa.f.
See
source
code
and course notes for further information.% f77 pgm.f -L/usr/localn32/lib -lp329 -o pgm
einstein% set DISPLAY linux1.ph.utexas.edu:0 einstein% ghostview somefile.psNote: Not all Postscript files will have .ps extensions, but many do by convention.
einstein% gnuplot
.
.
.
Terminal type set to 'x11'
gnuplot> help
.
.
.
gnuplot> quit
einstein% sm
Can't find entry for iris-ansi-net in /usr/local/lib/sm/termcap
Hello Matt, please give me a command
: device x11
: help
.
.
.
: quit
% ls
document.tex
% latex document.tex
This is TeX, Version 3.14159 (C version 6.1)
(document.tex
LaTeX2e <1996/06/01>
Hyphenation patterns for english, german, loaded.
.
.
.
No file document.aux.
[1] (document.aux) )
Output written on document.dvi (1 page, 696 bytes).
Transcript written on document.log.
% ls
document.aux document.dvi document.log document.tex
% ls document.aux document.dvi document.log document.tex % xdvi document
% ls document.aux document.dvi document.log document.tex % dvips document Got a new papersize This is dvips 5.58 Copyright 1986, 1994 Radical Eye Software ' TeX output 1997.01.22:1442' -> document.ps. [1] % ls document.aux document.dvi document.log document.ps document.tex