Online Guide to MODFLOW-2005

Array Reading Utility Modules

Hide Navigation Pane

Array Reading Utility Modules

Previous topic Next topic No directory for this topic Expand/collapse all hidden text  

Array Reading Utility Modules

Previous topic Next topic Topic directory requires JavaScript JavaScript is required for expanding text JavaScript is required for the print function  

Purpose

The Array Reading Utility Modules are used to read arrays of data in a variety of packages.

Documentation

Harbaugh, A.W., Banta, E.R., Hill, M.C., and McDonald, M.G., 2000, MODFLOW-2000, the U.S. Geological Survey modular ground-water model -- User guide to modularization concepts and the Ground-Water Flow Process: U.S. Geological Survey Open-File Report 00-92, 121 p.

Other Notes

The Array Reading Utility Modules are never used independently from packages so they do not have a separate symbol in the name file.

Input Instructions

The array reading utility modules provide a common way for all packages to read variables that have multiple values. The term “array” is simply a programming term for a variable that contains multiple values. There are three modules: U2DREL, U2DINT, and U1DREL. U2DREL reads real two-dimensional variables, U2DINT reads integer two-dimensional variables, and U1DREL reads real one-dimensional variables. All of these modules work similarly. They read one array-control record and, optionally, a data array in a format specified on the array-control record. Several alternate structures for the control record are provided. The original fixed-format control records work as documented in McDonald and Harbaugh (1988), and four free-format versions have been added. The free-format versions are described first because they are easier to use.

FREE-FORMAT CONTROL RECORDS FOR ARRAY READERS:

Values in bold italics are keywords that can be specified as uppercase or lowercase. Each control record is limited to a length of 199 characters.

For each array, specify the values for the array using one of the four methods below.

Data Set 1

CONSTANT CNSTNT

All values in the array are set equal to CNSTNT.

CNSTNT—is a real-number constant for U2DREL and U1DREL, and an integer constant for U2DINT. If the array is being defined as a constant, CNSTNT is the constant value. If individual elements of the array are being read, the values are multiplied by CNSTNT after they are read. When CNSTNT is used as a multiplier and specified as 0, it is changed to 1.

Data Set 2

INTERNAL CNSTNT FMTIN IPRN

The individual array elements will be read from the same file that contains the control record.

CNSTNT—is a real-number constant for U2DREL and U1DREL, and an integer constant for U2DINT. If the array is being defined as a constant, CNSTNT is the constant value. If individual elements of the array are being read, the values are multiplied by CNSTNT after they are read. When CNSTNT is used as a multiplier and specified as 0, it is changed to 1.

FMTIN—is the format for reading array elements. The format must contain 20 characters or less. The format must either be a standard Fortran format that is enclosed in parentheses, "(FREE)" which indicates free format, or "(BINARY)" which indicates binary (unformatted) data. When using a free-format control record, the format must be enclosed in apostrophes if it contains one or more blanks or commas. There are only two ways to create a binary file that can be read by MODFLOW. The first way is to use MODFLOW to create the file by saving heads in a binary file. This is commonly done when it is desired to use computed heads from one simulation as initial heads for a subsequent simulation. The other way to create a binary file is to write a special program that generates a binary file. "(FREE)" and "(BINARY)" can only be specified in free-format control records. Also, "(BINARY)" can only be specified when using U2DREL or U2DINT, and only when the control record is EXTERNAL or OPEN/CLOSE. When the "(FREE)" option is used, be sure that all array elements have a non-blank value and that a comma or at least one blank separates adjacent values.

When using FREE format, the data for each of the NROW rows needs to start on a new line.

IPRN—is a flag that indicates if the array being read should be printed (written to the listing file) after it has been read and a code for indicating the format that should be used when it is printed. The format codes are different for each of the three array-reading modules as shown below. IPRN is set to zero when the specified value exceeds those defined. If IPRN is less than zero, the array will not be printed. See Table of IPRN Values.

Data Set 3

EXTERNAL Nunit CNSTNT FMTIN IPRN

The individual array elements will be read from the file unit number specified by Nunit. The name of the file associated with this file unit must be contained in the name file.

Nunit—is the unit for reading the array when the EXTERNAL free-format control record is used.

CNSTNT—is a real-number constant for U2DREL and U1DREL, and an integer constant for U2DINT. If the array is being defined as a constant, CNSTNT is the constant value. If individual elements of the array are being read, the values are multiplied by CNSTNT after they are read. When CNSTNT is used as a multiplier and specified as 0, it is changed to 1.

FMTIN—is the format for reading array elements. The format must contain 20 characters or less. The format must either be a standard Fortran format that is enclosed in parentheses, "(FREE)" which indicates free format, or "(BINARY)" which indicates binary (unformatted) data. When using a free-format control record, the format must be enclosed in apostrophes if it contains one or more blanks or commas. There are only two ways to create a binary file that can be read by MODFLOW. The first way is to use MODFLOW to create the file by saving heads in a binary file. This is commonly done when it is desired to use computed heads from one simulation as initial heads for a subsequent simulation. The other way to create a binary file is to write a special program that generates a binary file. "(FREE)" and "(BINARY)" can only be specified in free-format control records. Also, "(BINARY)" can only be specified when using U2DREL or U2DINT, and only when the control record is EXTERNAL or OPEN/CLOSE. When the "(FREE)" option is used, be sure that all array elements have a non-blank value and that a comma or at least one blank separates adjacent values.

When using FREE format, the data for each of the NROW rows needs to start on a new line.

IPRN—is a flag that indicates if the array being read should be printed (written to the listing file) after it has been read and a code for indicating the format that should be used when it is printed. The format codes are different for each of the three array-reading modules as shown below. IPRN is set to zero when the specified value exceeds those defined. If IPRN is less than zero, the array will not be printed. See Table of IPRN Values.

Data Set 4

OPEN/CLOSE FNAME CNSTNT FMTIN IPRN

The array will be read from the file whose name is specified by FNAME. This file will be opened on unit 99 just prior to reading the array and closed immediately after the array is read. This file should not be included in the name file. A file that is read using this control record can contain only a single array. The OPEN/CLOSE option is particularly useful for running simulations that require more than 99 files using a computer that allows only 99 files to be opened simultaneously.

CNSTNT—is a real-number constant for U2DREL and U1DREL, and an integer constant for U2DINT. If the array is being defined as a constant, CNSTNT is the constant value. If individual elements of the array are being read, the values are multiplied by CNSTNT after they are read. When CNSTNT is used as a multiplier and specified as 0, it is changed to 1.

FMTIN—is the format for reading array elements. The format must contain 20 characters or less. The format must either be a standard Fortran format that is enclosed in parentheses, "(FREE)" which indicates free format, or "(BINARY)" which indicates binary (unformatted) data. When using a free-format control record, the format must be enclosed in apostrophes if it contains one or more blanks or commas. There are only two ways to create a binary file that can be read by MODFLOW. The first way is to use MODFLOW to create the file by saving heads in a binary file. This is commonly done when it is desired to use computed heads from one simulation as initial heads for a subsequent simulation. The other way to create a binary file is to write a special program that generates a binary file. "(FREE)" and "(BINARY)" can only be specified in free-format control records. Also, "(BINARY)" can only be specified when using U2DREL or U2DINT, and only when the control record is EXTERNAL or OPEN/CLOSE. When the "(FREE)" option is used, be sure that all array elements have a non-blank value and that a comma or at least one blank separates adjacent values.

When using FREE format, the data for each of the NROW rows needs to start on a new line.

IPRN—is a flag that indicates if the array being read should be printed (written to the listing file) after it has been read and a code for indicating the format that should be used when it is printed. The format codes are different for each of the three array-reading modules as shown below. IPRN is set to zero when the specified value exceeds those defined. If IPRN is less than zero, the array will not be printed. See Table of IPRN Values.

FIXED-FORMAT CONTROL RECORD FOR ARRAY READERS:

Data Set 1

A fixed-format control record contains the following variables:

LOCAT CNSTNT FMTIN IPRN

These variables are explained below. LOCAT, CNSTNT, and IPRN are 10-character numeric fields. For U2DREL and U1DREL, CNSTNT is a real number. For U2DINT, CNSTNT is an integer and must not include a decimal. FMTIN is a 20-character text field. All four variables are always read when the control record is fixed format; however, some of the variables are unused in some situations. For example when LOCAT = 0, FMTIN and IPRN are not used.

LOCAT—indicates the location of the array values for a fixed-format array control record. If LOCAT = 0, all elements are set equal to CNSTNT. If LOCAT > 0, it is the unit number for reading formatted records using FMTIN as the format. If LOCAT < 0, it is the unit number for binary (unformatted) records, and FMTIN is ignored. Also, when LOCAT is not 0, the array values are multiplied by CNSTNT after they are read.

CNSTNT—is a real-number constant for U2DREL and U1DREL, and an integer constant for U2DINT. If the array is being defined as a constant, CNSTNT is the constant value. If individual elements of the array are being read, the values are multiplied by CNSTNT after they are read. When CNSTNT is used as a multiplier and specified as 0, it is changed to 1.

FMTIN—is the format for reading array elements. The format must contain 20 characters or less. The format must either be a standard Fortran format that is enclosed in parentheses, "(FREE)" which indicates free format, or "(BINARY)" which indicates binary (unformatted) data. When using a free-format control record, the format must be enclosed in apostrophes if it contains one or more blanks or commas. There are only two ways to create a binary file that can be read by MODFLOW. The first way is to use MODFLOW to create the file by saving heads in a binary file. This is commonly done when it is desired to use computed heads from one simulation as initial heads for a subsequent simulation. The other way to create a binary file is to write a special program that generates a binary file. "(FREE)" and "(BINARY)" can only be specified in free-format control records. Also, "(BINARY)" can only be specified when using U2DREL or U2DINT, and only when the control record is EXTERNAL or OPEN/CLOSE. When the "(FREE)" option is used, be sure that all array elements have a non-blank value and that a comma or at least one blank separates adjacent values.

When using FREE format, the data for each of the NROW rows needs to start on a new line.

IPRN—is a flag that indicates if the array being read should be printed (written to the listing file) after it has been read and a code for indicating the format that should be used when it is printed. The format codes are different for each of the three array-reading modules as shown below. IPRN is set to zero when the specified value exceeds those defined. If IPRN is less than zero, the array will not be printed. See Table of IPRN Values.

Table of IPRN Values

IPRN

U2DREL

U2DINT

U1DREL

0

10G11.4

10I11

10G12.5

1

11G10.3

60I1

5G12.5

2

9G13.6

40I2

 

3

15F7.1

30I3

 

4

15F7.2

25I4

 

5

15F7.3

20I5

 

6

15F7.4

10I11

 

7

20F5.0

25I2

 

8

20F5.1

15I4

 

9

20F5.2

10I6

 

10

20F5.3

 

 

11

20F5.4

 

 

12

10G11.4

 

 

13

10F6.0

 

 

14

10F6.1

 

 

15

10F6.2

 

 

16

10F6.3

 

 

17

10F6.4

 

 

18

10F6.5

 

 

19

5G12.5

 

 

20

6G11.4

 

 

21

7G9.2