GNUFOR
a GNUPLOT / FORTRAN90 interface
GNUFOR is a simple FORTRAN90 interface to the
GNUPLOT plotting software.
GNUFOR makes it possible, while running a FORTRAN90 program
on a UNIX system, 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
FORTRAN90 program pauses while the graph is displayed in an X window,
and the user can admire the plots for a while, before hitting
return and giving control back to the FORTRAN90 program.
Thanks to some suggestions of Morag Am-Shallem, the FORTRAN90
program can continue execution without waiting for GNUPLOT. In this way, for example,
a program that was computing some quantity can, from time to time,
display an updated plot of what it is doing. A user can glance at
the picture from time to time, while the FORTRAN90 program merrily
computes away. Something like this can be done with a C program
that calls
the GNUPLOT_I package.
To use this program, the command "gnuplot" must be in your path.
Reference:
-
Philipp Janert,
Gnuplot in Action: Understanding Data with Graphs,
Manning, 2008,
ISBN: 1-933988-39-8.
-
Thomas Williams, Colin Kelley, John Campbell, David Kotz, Russell Lang,
gnuplot, An Interactive Plotting Program,
The Free Software Foundation, 1990,
../../pdf/gnuplot.pdf.
-
http://www.gnuplot.info/,
the GNUPLOT Website.
Source Code:
Examples and Tests:
You may copy the data files and command files that are created by
running GNUFOR_PRB:
-
test01_data.txt, data file #1.
-
test01_commands.txt,
command file #1.
-
test02_data.txt, data file #2.
-
test02_commands.txt,
command file #2.
-
test03_data.txt, data file #3.
-
test03_commands.txt,
command file #3.
-
test04_data.txt, data file #4.
-
test04_commands.txt,
command file #4.
-
test05_data.txt, data file #5.
-
test05_commands.txt,
command file #5.
-
test06_data.txt, data file #6.
-
table.txt,
a table of data created for command file #6.
-
test06_commands.txt,
command file #6.
List of Routines:
-
GET_UNIT returns a free FORTRAN unit number.
-
RUN_GNUPLOT runs GNUPLOT with a given command file.
-
TIMESTAMP returns the YMDHMS date as a timestamp.
-
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.
You can go up one level to
the FORTRAN90 source codes.
Last revised on 17 October 2007.