gnufor Module

A fortran api to GNUPLOT

Note

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.

link

Warning

To use this program, the command “gnuplot” must be in your path.


Used by

  • module~~gnufor~~UsedByGraph module~gnufor gnufor program~test_gnufor test_gnufor program~test_gnufor->module~gnufor

Functions

private function pi()

PI returns the value of pi.

Arguments

None

Return Value real


Subroutines

private subroutine get_unit(iunit)

GET_UNIT returns a free FORTRAN unit number.

Arguments

Type IntentOptional Attributes Name
integer :: iunit

public subroutine run_gnuplot(command_file_name)

RUN_GNUPLOT runs GNUPLOT with a given command file.

Arguments

Type IntentOptional Attributes Name
character(len=*) :: command_file_name

public subroutine test01()

TEST01 demonstrates the plotting of Y(X) data.

Arguments

None

public subroutine test02()

TEST02 demonstrates the plotting of a table of data.

Arguments

None

public subroutine test03()

TEST03 plots parameter (X,Y,Z) data.

Arguments

None

public subroutine test04()

TEST04 plots vector data.

Arguments

None

public subroutine test05()

TEST05 plots Z(X,Y) grid data as a surface.

Arguments

None

public subroutine test06()

TEST06 plots Z(X,Y) grid data as contours.

Arguments

None

private subroutine timestamp()

TIMESTAMP prints the current YMDHMS date as a time stamp.

Arguments

None

private subroutine write_polar_data(data_file_name, n, x, y, ierror)

Arguments

Type IntentOptional Attributes Name
character(len=*) :: data_file_name
integer :: n
real :: x(n)
real :: y(n)
integer :: ierror

private subroutine write_polar_plot(command_file_name, data_file_name, ierror)

Arguments

Type IntentOptional Attributes Name
character(len=*) :: command_file_name
character(len=*) :: data_file_name
integer :: ierror

private subroutine write_vector_data(data_file_name, n, x, y, dx, dy, ierror)

WRITE_VECTOR_DATA writes vector data to a file, for plotting by GNUPLOT.

Arguments

Type IntentOptional Attributes Name
character(len=*) :: data_file_name
integer :: n
real :: x(n)
real :: y(n)
real :: dx(n)
real :: dy(n)
integer :: ierror

private subroutine write_vector_plot(command_file_name, data_file_name, ierror)

WRITE_VECTOR_PLOT writes GNUPLOT commands to plot vectors.

Arguments

Type IntentOptional Attributes Name
character(len=*) :: command_file_name
character(len=*) :: data_file_name
integer :: ierror

private subroutine write_xy2_data(data_file_name, n, x, y, y2, ierror)

Arguments

Type IntentOptional Attributes Name
character(len=*) :: data_file_name
integer :: n
real :: x(n)
real :: y(n)
real :: y2(n)
integer :: ierror

private subroutine write_xy2_plot(command_file_name, data_file_name, logscale, ierror, nom)

Arguments

Type IntentOptional Attributes Name
character(len=*) :: command_file_name
character(len=*) :: data_file_name
logical :: logscale
integer :: ierror
character(len=*) :: nom

public subroutine write_xy_data(data_file_name, n, x, y, ierror)

WRITE_XY_DATA writes X(1:N), Y(1:N) data to a file.

Arguments

Type IntentOptional Attributes Name
character(len=*) :: data_file_name
integer :: n
real :: x(n)
real :: y(n)
integer :: ierror

public subroutine write_xy_plot(command_file_name, data_file_name, logscale, ierror, nom)

WRITE_XY_PLOT writes GNUPLOT commands to plot X(1:N), Y(1:N) data.

Arguments

Type IntentOptional Attributes Name
character(len=*) :: command_file_name
character(len=*) :: data_file_name
logical :: logscale
integer :: ierror
character(len=*) :: nom

public subroutine write_xyy_data(data_file_name, lda, nrow, ncol, x, ierror)

WRITE_XYY_DATA writes a table of data to a file, for plotting by GNUPLOT.

Arguments

Type IntentOptional Attributes Name
character(len=*) :: data_file_name
integer :: lda
integer :: nrow
integer :: ncol
real :: x(lda,ncol)
integer :: ierror

public subroutine write_xyy_plots(command_file_name, data_file_name, add_lines, title, ncol, ierror)

WRITE_XYY_PLOTS writes GNUPLOT commands to make multiple (X,Y) plots.

Arguments

Type IntentOptional Attributes Name
character(len=*) :: command_file_name
character(len=*) :: data_file_name
character(len=*), optional :: add_lines
character(len=*), dimension(1:ncol) :: title
integer :: ncol
integer :: ierror

private subroutine write_xyz_data(data_file_name, n, x, y, z, ierror)

WRITE_XYZ_DATA writes X(1:N), Y(1:N), Z(1:N) data to a file.

Arguments

Type IntentOptional Attributes Name
character(len=*) :: data_file_name
integer :: n
real :: x(n)
real :: y(n)
real :: z(n)
integer :: ierror

private subroutine write_xyz_plot(command_file_name, data_file_name, ierror)

WRITE_XYZ_PLOT writes commands to plot parametric (X,Y,Z) data.

Arguments

Type IntentOptional Attributes Name
character(len=*) :: command_file_name
character(len=*) :: data_file_name
integer :: ierror

private subroutine write_xyzgrid_contour(command_file_name, data_file_name, ierror)

WRITE_XYZGRID_CONTOUR writes commands to plot contours of Z(X,Y).

Arguments

Type IntentOptional Attributes Name
character(len=*) :: command_file_name
character(len=*) :: data_file_name
integer :: ierror

private subroutine write_xyzgrid_data(data_file_name, nx, ny, xyz, ierror)

WRITE_XYZGRID_DATA writes a file of XYZ grid data.

Arguments

Type IntentOptional Attributes Name
character(len=*) :: data_file_name
integer :: nx
integer :: ny
real :: xyz(3,nx,ny)
integer :: ierror

private subroutine write_xyzgrid_surface(command_file_name, data_file_name, ierror)

WRITE_XYZGRID_SURFACE writes a file of GNUPLOT commands to plot a 3D surface.

Arguments

Type IntentOptional Attributes Name
character(len=*) :: command_file_name
character(len=*) :: data_file_name
integer :: ierror

private subroutine write_y_plot(command_file_name, data_file_name, ierror)

WRITE_Y_PLOT writes GNUPLOT commands to plot Y(1:N) data.

Arguments

Type IntentOptional Attributes Name
character(len=*) :: command_file_name
character(len=*) :: data_file_name
integer :: ierror