©1995,1996 Richard B. Winston
Please Register
Last modified on Wednesday, January 31, 1996 - 7:21:32 PM
Skip forward to Input instructions for the U2DREL Utility.
The original instructions for U2DREL are on pages 14-4 to 14-5 of McDonald and Harbaugh (1988).
Introduction: U2DREL is a utility module that is used to enter two dimensional arrays of real numbers.
Go back to Contents
All input parameters (except FMTIN) should be right justified
- Line 1
- Spaces 1-10 = LOCAT, the unit number of the file containing the array plus information about whether the file is formatted (LOCAT > 0) or unformatted (LOCAT < 0) or constant (LOCAT = 0). (Integer)
- Spaces 11-20 = CNSTNT, a constant by which all values in the array are multiplied or, if all values in the array are the same, that value.
- Spaces 21-40 = FMTIN, the format of the numbers in the array
- Spaces 41-50 = IPRN, a number indicating the format in which the array should be printed in the output file. (Integer)
- Subsequent lines
- Example
LOCAT does two things; it tells where to find the data that is in the two dimensional array and it tells whether the data is formatted or not. Normally the data is formatted. You might want to use unformatted data if you were using the output of a previous model run as the initial conditions for another model. LOCAT should be right-justified. LOCAT is in integer so you should not use a decimal point.
- If LOCAT < 0, the data is unfomatted.
- If LOCAT = 0 than all the elements in the array are the same and they are equal to CNSTNT.
- If LOCAT > 0 then the data is formatted. The format will be specified in FMTIN which is the third item on this line (just after CNSTNT).
Most of the time, you would set LOCAT > 0. If LOCAT < > 0, the value that you specify for LOCAT is the "unit number". That is, it is the number assigned to the file which has the data. You probably assigned the unit number in line 4 of the Basic Package. If you specify a unit number which you have not assigned previously, the program should prompt you for the file name during program execution.
Go back to Input instructions for the U2DREL Utility.
Go to top of U2DREL section.
Line 1;
Spaces 11-20; Variable = CNSTNT
The meaning of CNSTNT depends on the value of LOCAT.
- If LOCAT = 0, that meant that every value in the array is the same and has a value equal to CNSTNT. For example, if LOCAT = 0 and CNSTNT = 3, every value in the array is a 3.
- If LOCAT < > 0, every value in the array will be multiplied by CNSTNT. For example, if LOCAT = 20, CNSTNT = 1E-6, and the values in the array are 3.2, 35.3 and 0.63, the final values in the array will be 3.2E-6, 3.53E-5 and 6.3E-7. You could set CNSTNT = 1 and enter the final values directly but that might take longer and might be more likely to contain errors.
CNSTNT should be right justified..
Go back to Input instructions for the U2DREL Utility.
Go to top of U2DREL section.
Line 1;
Spaces 21-40; Variable = FMTIN
This gives the FORTRAN format for the values in the array that will be read. FMTIN is used only if LOCAT > 0. Otherwise the spaces reserved for FMTIN should be left blank. The format must be enclosed in parentheses.
FMTIN need not be right justified.
Go back to Input instructions for the U2DREL Utility.
Go to top of U2DREL section.
Line 1;
Spaces 41-50; Variable = IPRN
IPRN indicates that the array should be printed with a specific FORTRAN format. IPRN is in integer so you should not use a decimal point.
If IPRN < 0, the array will not be printed
If IPRN = 0, the format will be 10G11.4
If IPRN = 1, the format will be 10G10.3
If IPRN = 2, the format will be 9G13.6
If IPRN = 3, the format will be 15F7.1
If IPRN = 4, the format will be 15F7.2
If IPRN = 5, the format will be 15F7.3
If IPRN = 6, the format will be 15F7.4
If IPRN = 7, the format will be 20F5.0
If IPRN = 8, the format will be 20F5.1
If IPRN = 9, the format will be 20F5.2
If IPRN = 10, the format will be 20F5.3
If IPRN = 11, the format will be 20F5.4
If IPRN = 12, the format will be 10G11.4
Go back to Input instructions for the U2DREL Utility.
Go to top of U2DREL section.
The Array itself
On the following lines you enter the values that go in the array if those values aren't supposed to be in some other file. Be sure that the data are in the format you specified in FMTIN. It's OK if a line ends early so long as there are no blank spaces at the end of the line. If there are blank spaces, those may be interpreted as 0's.
Go back to Input instructions for the U2DREL Utility.
Go to top of U2DREL section.
Let's suppose you are trying to enter the following array with 2 columns and 3 rows
0.006360 0.00027
0.035450 0.00084
0.000830 0.00083
The first two lines below show positions on the line in the examples which follow. Those two lines do not go into the input file. In this example, we are reading the array on unit 10. We could enter the data as follows:
00000000011111111112222222222333333333344444444445
12345678901234567890123456789012345678901234567890
bbbbbbbb10bbbbbb1E-4bbbb(20F5.1)bbbbbbbbbbbbbbbb12
bb636bbb27b3545bbb84bbb83bbb83
As always, I'm using
b
to indicate blank spaces.
Another way to enter the data would be:
bbbbbbbb10bbbbbb1E-4bbbb(20F5.1)bbbbbbbbbbbbbbbb12
bb636bbb27
b3545bbb84
bbb83bbb83
The first lines of these examples say that the array should be read from unit 10 (LOCAT) and then multiplied by 1E-4 (CNSTNT). In the input file, the values in the array are in the 20F5.1 format (FMTIN) and they will be printed in the 10G11.4 format (IPRN) after being multiplied by 1E-4 (CNSTNT). The final printed values in the output as specified by IPRN and the numbers used in subsequent calculations will be:
bbbb0.00636bbbb0.00027
bbbb0.03545bbbb0.00084
bbbb0.00083bbbb0.00083
Please note that I wasn't required to use up all 20 places on a line in the input file before starting a new line.
If you are confused, you may wish to review FORTRAN formats.
Go back to Input instructions for the U2DREL Utility.
Go to top of U2DREL section.
Go back to Contents
©1995,1996 Richard B. Winston,
rwinsto@lsuvm.sncc.lsu.edu
Dept. of Geology and Geophysics
Louisiana State University
Baton Rouge, La 70803
U.S.A.
504-388-2337
Fax 504-388-2302
http://scribe.geol.lsu.edu/rbwinston.html
ftp://aapg.geol.lsu.edu/pub/winston