GNUFOR : a GNUPLOT / FORTRAN interface
GNUFOR is a simple interface between a FORTRAN program and
GNUPLOT. It makes it possible, while running a FORTRAN program,
to generate some data and request an immediate plot. This is
done by issuing a SYSTEM command that starts up GNUPLOT, and
feeding it the appropriate commands and data. The FORTRAN program
pauses while the graph is displayed, and the user can admire the
plots for a while, before hitting return and giving control back
to the FORTRAN program.
It would be very nice to be able to have the FORTRAN program continue
execution without waiting for GNUPLOT. In this way, for example,
a program that was computing some quantity could, from time to time,
display an updated plot of what it was doing. A user could glance at
the picture from time to time, while the FORTRAN program merrily computed
away. Something like this can be done with the GNUPLOT_I package and
a C program.
To use this program, the command "gnuplot" must be in your path.
On a computer at ISU that is part of the Vincent system, the easiest
way to do this is to issue the command "add gnu".
Files you may copy include:
-
gnufor.f90, the source code.
-
gnufor_prb.f90, a sample problem.
-
test01_data.txt, the data file.
-
test01_commands.txt,
the command file.
-
test02_data.txt, the data file.
-
test02_commands.txt,
the command file.
-
test03_data.txt, the data file.
-
test03_commands.txt,
the command file.
-
test04_data.txt, the data file.
-
test04_commands.txt,
the command file.
-
test05_data.txt, the data file.
-
test05_commands.txt,
the command file.
-
test06_data.txt, the data file.
-
test06_commands.txt,
the command file.
The list of routines includes:
-
GET_UNIT returns a free FORTRAN unit number.
-
PI returns the value of pi.
-
RUN_GNUPLOT runs GNUPLOT with a given command file.
-
WRITE_VECTOR_DATA writes vector data to a file, for plotting by GNUPLOT.
-
WRITE_VECTOR_PLOT writes GNUPLOT commands to plot vectors.
-
WRITE_XY_DATA writes X(1:N), Y(1:N) data to a file.
-
WRITE_XY_PLOT writes GNUPLOT commands to plot X(1:N), Y(1:N) data.
-
WRITE_XYY_DATA writes a table of data to a file, for plotting by GNUPLOT.
-
WRITE_XYY_PLOTS writes GNUPLOT commands to make multiple (X,Y) plots.
-
WRITE_XYZ_DATA writes X(1:N), Y(1:N), Z(1:N) data to a file.
-
WRITE_XYZ_PLOT writes commands to plot parametric (X,Y,Z) data.
-
WRITE_XYZGRID_CONTOUR writes commands to plot contours of Z(X,Y).
-
WRITE_XYZGRID_DATA writes a file of XYZ grid data.
-
WRITE_XYZGRID_SURFACE writes a file of GNUPLOT commands to plot a 3D surface.
Return to the FORTRAN software page.
Last revised on 02 March 2001.