forked from xiaolongma/jburkardt-f
-
Notifications
You must be signed in to change notification settings - Fork 1
/
vec_io.html
186 lines (157 loc) · 4.89 KB
/
vec_io.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<html>
<head>
<title>
VEC_IO - File I/O for Fixed Length Vectors
</title>
</head>
<body bgcolor="#EEEEEE" link="#CC0000" alink="#FF3300" vlink="#000055">
<h1 align = "center">
VEC_IO <br> File I/O for Fixed Length Vectors
</h1>
<hr>
<p>
<b>VEC_IO</b>
is a FORTRAN90 library which
provides a simple interface to read or write a set of
vectors to a file, which are of a single fixed size. The vectors
can be read or written in any order. Several sets of files can
be handled at one time.
</p>
<p>
A common procedure computationally involves computing a state
variable U(T,X,Y) at a fixed set of nodes, and for an increasing
sequence of equally spaced times. For certain optimization
problems, this process is followed by a <i>backwards</i> computation,
in which the data is analyzed in reverse order.
</p>
<p>
Since the data U(T,X,Y) for a single time step may require a
large amount of storage, and usually only two sets of data
are needed at any point in the computation, namely the values
at the current time, and at the future or previous time, it
is convenient to store the solution data for each timestep
in a single file.
</p>
<p>
A simple use of <b>VEC_IO</b> allows the user to write each
solution vector to the file in forward order, and then to
read back the same solution data in reverse order. Of course,
more general access patterns are also available.
</p>
<p>
At the moment, the only kind of data that can be written or
read is a double precision vector of length <b>N</b>.
Sets of this data can be stored in an unformatted direct access file,
or a formatted direct access file.
</p>
<p>
It would also be useful to allow other data types, such
as single precision or integer data, and other file formats,
but this has not yet been set up.
</p>
<h3 align = "center">
Licensing:
</h3>
<p>
The computer code and data files described and made available on this web page
are distributed under
<a href = "../../txt/gnu_lgpl.txt">the GNU LGPL license.</a>
</p>
<h3 align = "center">
Related Data and Programs:
</h3>
<p>
<a href = "../../f_src/cell/cell.html">
CELL</a>,
a FORTRAN90 library which
defines a cell array, a generalization of an array which
can compactly store and retrieve vector or matrix data of
varying size, such as the rows of a triangular matrix.
</p>
<p>
<a href = "../../f_src/table_io/table_io.html">
TABLE_IO</a>,
a FORTRAN90 library which
reads vector and table data
from a file. However, these routines read or write ALL the
data in one operation, and only use the ASCII file format.
</p>
<h3 align = "center">
Source Code:
</h3>
<p>
<ul>
<li>
<a href = "vec_io.f90">vec_io.f90</a>, the source code.
</li>
<li>
<a href = "vec_io.sh">vec_io.sh</a>,
commands to compile the source code.
</li>
</ul>
</p>
<h3 align = "center">
Examples and Tests:
</h3>
<p>
<ul>
<li>
<a href = "vec_io_prb.f90">vec_io_prb.f90</a>,
a sample calling program.
</li>
<li>
<a href = "vec_io_prb.sh">vec_io_prb.sh</a>,
commands to compile and run the sample program.
</li>
<li>
<a href = "vec_io_prb_output.txt">vec_io_prb_output.txt</a>,
the output from a run of the sample program.
</li>
</ul>
</p>
<h3 align = "center">
List of Routines:
</h3>
<p>
<ul>
<li>
<b>FILE_COPY</b> makes a copy of a file.
</li>
<li>
<b>FILE_DELETE</b> deletes a named file if it exists.
</li>
<li>
<b>FILE_EXIST</b> reports whether a file exists.
</li>
<li>
<b>FILE_IS_OPEN</b> reports whether a file (specified by filename) is open.
</li>
<li>
<b>FILE_RENAME</b> renames a file.
</li>
<li>
<b>GET_UNIT</b> returns a free FORTRAN unit number.
</li>
<li>
<b>R8AD_IO</b> reads or writes fixed size vectors, using R8AD protocol.
</li>
<li>
<b>R8UD_IO</b> reads or writes fixed size vectors, using R8UD protocol.
</li>
<li>
<b>TIMESTAMP</b> prints the current YMDHMS date as a time stamp.
</li>
</ul>
</p>
<p>
You can go up one level to <a href = "../f_src.html">
the FORTRAN90 source codes</a>.
</p>
<hr>
<i>
Last revised on 05 October 2005.
</i>
<!-- John Burkardt -->
</body>
<!-- Initial HTML skeleton created by HTMLINDEX. -->
</html>