TABLE_UNBORDER Remove boundary values from a table

TABLE_UNBORDER is a FORTRAN90 program which removes boundary values from a table.

To understand what's going on, assume that we begin with a set of (scalar) values on an M by N grid; we illustrate with M = 5 and N = 7:

```        11  12  13  14  15  16  17
21  22  23  24  25  26  27
31  32  33  34  35  36  37
41  42  43  44  45  46  47
51  52  53  54  55  56  57
```

Suppose, for some reason, that we only want to consider the data in the "interior" of the grid; that is, we want the M-2 by N-2 array created by removing the first and last rows and columns. For our example, this would be:

```        22  23  24  25  26
32  33  34  35  36
42  43  44  45  46
```

The TABLE_UNBORDER program is designed to do this, using the command line.

Now we are probably going to be dealing with much larger sets of data, stored in a file. So we have to figure out the rules for doing that.

Input file format: The initial data, which is "really" an M by N array, is to be thought of as a vector of length M * N, created by listing the first column, the second column, and so on to the last column. This data is stored in a file using the TABLE format. Our example data would be:

```        # Comments are OK in a file if preceded by the comment character!
#
11
21
31
41
51
12
22
...
27
37
47
57
```
We will presume this file is called "u.txt".

(Pie in the Sky): In a future version of this program, the data at each node will be allowed to be vector-valued. That's one reason we are forcing the data currently to be listed with just a single value per line in the file!

Usage:

table_unborder u.txt v.txt 5 7
reads the file u.txt containing a matrix of 5 rows and 7 columns, and removes the "border" values, writing the result to v.txt.
table_unborder
will prompt interactively for the four missing arguments.

Languages:

TABLE_UNBORDER is available in a C++ version and a FORTRAN90 version.

Related Data and Programs:

TABLE_BARPLOT_PPMA, a FORTRAN90 program which reads a table file and creates a PPMA bargraph of the data.

TABLE_BORDER, a FORTRAN90 program which can be used to add a border (of zero values) to a table file.

TABLE_COLUMNS, a FORTRAN90 program which can extract specific columns of data from a table file.

TABLE_COLUMNS_PERMUTE, a FORTRAN90 program which permutes the columns of a table file.

TABLE_DELAUNAY, a FORTRAN90 program which computes the Delaunay triangulation of a set of points.

TABLE_HISTOGRAM, a FORTRAN90 program which can make a histogram of a set of points stored in a table file.

TABLE_IO, a FORTRAN90 program which supplies the routines used to read the TABLE file.

TABLE_LATINIZE, a FORTRAN90 program which reads a file of points and creates a "latinized" version by adjusting the data.

TABLE_MERGE, a FORTRAN90 program which reads a file of points, and removes duplicates, and points that are close to each other.

TABLE_ORTHONORMALIZE, a FORTRAN90 program which reads a file of points and orthonormalizes the columns.

TABLE_QUALITY, a FORTRAN90 program which reads a file of points and computes the quality of dispersion.

TABLE_RECORD_MATCH, a FORTRAN90 program which can be used to find close records in a table file.

TABLE_SCALE, a FORTRAN90 program which can be used to multiply the entries of a table file by a scale vector.

TABLE_SHIFT, a FORTRAN90 program which can be used to shift the entries of a table file by a shift vector.

TABLE_STATS, a FORTRAN90 program which can read a table file and compute certain statistics.

TABLE_TET_MESH, a FORTRAN90 program which can read a table file of 3D data, and compute a tetrahedral mesh.

TABLE_TOP, a FORTRAN90 program which can read a table file of M-dimensional data and make a table of plots of all pairs of coordinates.

TABLE_UNIFORM_NOISE, a FORTRAN90 program which can be used to add a uniform noise term to the data in a table file.

TABLE_VORONOI, a FORTRAN90 program which can be used to compute information about the Voronoi diagram of the points.

Examples and Tests:

Our test files are the results of the command:

table_unborder u_01.txt v_01.txt 7 5
Note that the program will automatically repeat the command on a numerical sequence of input files! Test files you may copy include:

List of Routines:

• MAIN is the main program for TABLE_UNBORDER.
• CH_CAP capitalizes a single character.
• CH_EQI is a case insensitive comparison of two characters for equality.
• CH_IS_DIGIT returns TRUE if a character is a decimal digit.
• CH_TO_DIGIT returns the integer value of a base 10 digit.
• DTABLE_DATA_BORDER_CUT cuts the "border" of double precision table data.
• DTABLE_DATA_WRITE writes data to a double precision table file.
• DTABLE_PRINT prints a double precision matrix.
• DTABLE_PRINT_SOME prints some of a double precision matrix.
• DTABLE_WRITE writes a double precision table file.
• FILE_COLUMN_COUNT counts the number of columns in the first line of a file.
• FILE_EXIST reports whether a file exists.
• FILE_NAME_INC generates the next filename in a series.
• FILE_ROW_COUNT counts the number of row records in a file.
• GET_UNIT returns a free FORTRAN unit number.
• I4_INPUT prints a prompt string and reads an integer from the user.
• S_BLANK_DELETE removes blanks from a string, left justifying the remainder.
• S_INPUT prints a prompt string and reads a string from the user.
• S_TO_I4 reads an I4 from a string.
• S_TO_R8 reads an R8 from a string.
• S_TO_R8VEC reads an R8VEC from a string.
• S_WORD_COUNT counts the number of "words" in a string.
• TIMESTAMP prints the current YMDHMS date as a time stamp.
• TIMESTRING writes the current YMDHMS date into a string.

You can go up one level to the FORTRAN90 source codes.

Last revised on 13 November 2006.