MODFLOW 6
version 6.6.0.dev0
USGS Modular Hydrologic Model
|
Functions/Subroutines | |
subroutine, public | openfile (iu, iout, fname, ftype, fmtarg_opt, accarg_opt, filstat_opt, mode_opt) |
Open a file. More... | |
subroutine | freeunitnumber (iu) |
Assign a free unopened unit number. More... | |
integer(i4b) function, public | getunit () |
Get a free unit number. More... | |
subroutine, public | upcase (word) |
Convert to upper case. More... | |
subroutine, public | lowcase (word) |
Convert to lower case. More... | |
subroutine, public | append_processor_id (name, proc_id) |
Append processor id to a string. More... | |
subroutine, public | uwword (line, icol, ilen, ncode, c, n, r, fmt, alignment, sep) |
Create a formatted line. More... | |
subroutine, public | urword (line, icol, istart, istop, ncode, n, r, iout, in) |
Extract a word from a string. More... | |
subroutine, public | ulstlb (iout, label, caux, ncaux, naux) |
Print a label for a list. More... | |
subroutine, public | ubdsv4 (kstp, kper, text, naux, auxtxt, ibdchn, ncol, nrow, nlay, nlist, iout, delt, pertim, totim) |
Write header records for cell-by-cell flow terms for one component of flow plus auxiliary data using a list structure. More... | |
subroutine, public | ubdsvb (ibdchn, icrl, q, val, nvl, naux, laux) |
Write one value of cell-by-cell flow plus auxiliary data using a list structure. More... | |
subroutine, public | ucolno (nlbl1, nlbl2, nspace, ncpl, ndig, iout) |
Output column numbers above a matrix printout. More... | |
subroutine, public | ulaprw (buf, text, kstp, kper, ncol, nrow, ilay, iprn, iout) |
Print 1 layer array. More... | |
subroutine, public | ulasav (buf, text, kstp, kper, pertim, totim, ncol, nrow, ilay, ichn) |
Save 1 layer array on disk. More... | |
subroutine, public | ubdsv1 (kstp, kper, text, ibdchn, buff, ncol, nrow, nlay, iout, delt, pertim, totim) |
Record cell-by-cell flow terms for one component of flow as a 3-D array with extra record to indicate delt, pertim, and totim. More... | |
subroutine, public | ubdsv06 (kstp, kper, text, modelnam1, paknam1, modelnam2, paknam2, ibdchn, naux, auxtxt, ncol, nrow, nlay, nlist, iout, delt, pertim, totim) |
Write header records for cell-by-cell flow terms for one component of flow. More... | |
subroutine, public | ubdsvc (ibdchn, n, q, naux, aux) |
Write one value of cell-by-cell flow using a list structure. More... | |
subroutine, public | ubdsvd (ibdchn, n, n2, q, naux, aux) |
Write one value of cell-by-cell flow using a list structure. More... | |
logical function, public | same_word (word1, word2) |
Perform a case-insensitive comparison of two words. More... | |
character(len=max(len_trim(str), width)) function, public | str_pad_left (str, width) |
Function for string manipulation. More... | |
subroutine, public | unitinquire (iu) |
subroutine, public | parseline (line, nwords, words, inunit, filename) |
Parse a line into words. More... | |
subroutine, public | ulaprufw (ncol, nrow, kstp, kper, ilay, iout, buf, text, userfmt, nvalues, nwidth, editdesc) |
Print 1 layer array with user formatting in wrap format. More... | |
character(len=:) function, allocatable, public | read_line (iu, eof) |
This function reads a line of arbitrary length and returns it. More... | |
subroutine, public | getfilefrompath (pathname, filename) |
subroutine, public | extract_idnum_or_bndname (line, icol, istart, istop, idnum, bndname) |
Starting at position icol, define string as line(istart:istop). More... | |
subroutine, public | urdaux (naux, inunit, iout, lloc, istart, istop, auxname, line, text) |
Read auxiliary variables from an input line. More... | |
subroutine, public | print_format (linein, cdatafmp, editdesc, nvaluesp, nwidthp, inunit) |
Define the print or save format. More... | |
subroutine, public | buildfixedformat (nvalsp, nwidp, ndig, outfmt, prowcolnum) |
Build a fixed format for printing or saving a real array. More... | |
subroutine, public | buildfloatformat (nvalsp, nwidp, ndig, editdesc, outfmt, prowcolnum) |
Build a floating-point format for printing or saving a real array. More... | |
subroutine, public | buildintformat (nvalsp, nwidp, outfmt, prowcolnum) |
Build a format for printing or saving an integer array. More... | |
integer(i4b) function, public | get_nwords (line) |
Get the number of words in a string. More... | |
subroutine, public | fseek_stream (iu, offset, whence, status) |
Move the file pointer. More... | |
subroutine, public | u9rdcom (iin, iout, line, ierr) |
Read until non-comment line found and then return line. More... | |
subroutine | get_line (lun, line, iostat) |
Read an unlimited length line from unit number lun into a deferred- length character string (line). More... | |
subroutine, public inputoutputmodule::append_processor_id | ( | character(len=linelength), intent(inout) | name, |
integer(i4b), intent(in) | proc_id | ||
) |
Subroutine to append the processor id to a string before the file extension (extension is the string after the last '.' in the string. If there is no '.' in the string the processor id is appended to the end of the string.
[in,out] | name | file name |
[in] | proc_id | processor id |
Definition at line 235 of file InputOutput.f90.
subroutine, public inputoutputmodule::buildfixedformat | ( | integer(i4b), intent(in) | nvalsp, |
integer(i4b), intent(in) | nwidp, | ||
integer(i4b), intent(in) | ndig, | ||
character(len=*), intent(inout) | outfmt, | ||
logical, intent(in), optional | prowcolnum | ||
) |
subroutine, public inputoutputmodule::buildfloatformat | ( | integer(i4b), intent(in) | nvalsp, |
integer(i4b), intent(in) | nwidp, | ||
integer(i4b), intent(in) | ndig, | ||
character(len=*), intent(in) | editdesc, | ||
character(len=*), intent(inout) | outfmt, | ||
logical, intent(in), optional | prowcolnum | ||
) |
subroutine, public inputoutputmodule::buildintformat | ( | integer(i4b), intent(in) | nvalsp, |
integer(i4b), intent(in) | nwidp, | ||
character(len=*), intent(inout) | outfmt, | ||
logical, intent(in), optional | prowcolnum | ||
) |
subroutine, public inputoutputmodule::extract_idnum_or_bndname | ( | character(len=*), intent(inout) | line, |
integer(i4b), intent(inout) | icol, | ||
integer(i4b), intent(inout) | istart, | ||
integer(i4b), intent(inout) | istop, | ||
integer(i4b), intent(out) | idnum, | ||
character(len=lenboundname), intent(out) | bndname | ||
) |
If string can be interpreted as an integer(I4B), return integer in idnum argument. If token is not an integer(I4B), assume it is a boundary name, return NAMEDBOUNDFLAG in idnum, convert string to uppercase and return it in bndname.
Definition at line 1291 of file InputOutput.f90.
subroutine inputoutputmodule::freeunitnumber | ( | integer(i4b), intent(inout) | iu | ) |
Subroutine to assign a free unopened unit number to the iu dummy argument
[in,out] | iu | next free file unit number |
Definition at line 148 of file InputOutput.f90.
subroutine, public inputoutputmodule::fseek_stream | ( | integer(i4b), intent(in) | iu, |
integer(i4b), intent(in) | offset, | ||
integer(i4b), intent(in) | whence, | ||
integer(i4b), intent(inout) | status | ||
) |
Patterned after fseek, which is not supported as part of the fortran standard. For this subroutine to work the file must have been opened with access='stream' and action='readwrite'.
Definition at line 1693 of file InputOutput.f90.
|
private |
Tack on a single space to the end so that routines like URWORD continue to function as before.
Definition at line 1829 of file InputOutput.f90.
integer(i4b) function, public inputoutputmodule::get_nwords | ( | character(len=*), intent(in) | line | ) |
Definition at line 1661 of file InputOutput.f90.
subroutine, public inputoutputmodule::getfilefrompath | ( | character(len=*), intent(in) | pathname, |
character(len=*), intent(out) | filename | ||
) |
integer(i4b) function, public inputoutputmodule::getunit |
Function to get a free unit number that hasn't been used
Definition at line 169 of file InputOutput.f90.
subroutine, public inputoutputmodule::lowcase | ( | character(len=*) | word | ) |
Subroutine to convert a character string to lower case.
Definition at line 210 of file InputOutput.f90.
subroutine, public inputoutputmodule::openfile | ( | integer(i4b), intent(inout) | iu, |
integer(i4b), intent(in) | iout, | ||
character(len=*), intent(in) | fname, | ||
character(len=*), intent(in) | ftype, | ||
character(len=*), intent(in), optional | fmtarg_opt, | ||
character(len=*), intent(in), optional | accarg_opt, | ||
character(len=*), intent(in), optional | filstat_opt, | ||
integer(i4b), intent(in), optional | mode_opt | ||
) |
Subroutine to open a file using the specified arguments
[in,out] | iu | unit number |
[in] | iout | output unit number to write a message (iout=0 does not print) |
[in] | fname | name of the file |
[in] | ftype | file type (e.g. WEL) |
[in] | fmtarg_opt | file format, default is 'formatted' |
[in] | accarg_opt | file access, default is 'sequential' |
[in] | filstat_opt | file status, default is 'old'. Use 'REPLACE' for output file. |
[in] | mode_opt | simulation mode that is evaluated to determine if the file should be opened |
Definition at line 28 of file InputOutput.f90.
subroutine, public inputoutputmodule::parseline | ( | character(len=*), intent(in) | line, |
integer(i4b), intent(inout) | nwords, | ||
character(len=*), dimension(:), intent(inout), allocatable | words, | ||
integer(i4b), intent(in), optional | inunit, | ||
character(len=*), intent(in), optional | filename | ||
) |
Blanks and commas are recognized as delimiters. Multiple blanks between words is OK, but multiple commas between words is treated as an error. Quotation marks are not recognized as delimiters.
Definition at line 1108 of file InputOutput.f90.
subroutine, public inputoutputmodule::print_format | ( | character(len=*), intent(in) | linein, |
character(len=*), intent(inout) | cdatafmp, | ||
character(len=*), intent(inout) | editdesc, | ||
integer(i4b), intent(inout) | nvaluesp, | ||
integer(i4b), intent(inout) | nwidthp, | ||
integer(i4b), intent(in) | inunit | ||
) |
Define cdatafmp as a Fortran output format based on user input. Also define nvalues, nwidth, and editdesc.
Syntax for linein: COLUMNS nval WIDTH nwid [DIGITS ndig [options]]
Where: nval = Number of values per line. nwid = Number of character places to be used for each value. ndig = Number of digits to the right of the decimal point (required for real array). options are: editoption: One of [EXPONENTIAL, FIXED, GENERAL, SCIENTIFIC] A default value should be passed in for editdesc as G, I, E, F, or S. If I is passed in, then the fortran format will be for an integer variable.
Definition at line 1386 of file InputOutput.f90.
character(len=:) function, allocatable, public inputoutputmodule::read_line | ( | integer(i4b), intent(in) | iu, |
logical, intent(out) | eof | ||
) |
The returned string can be stored in a deferred-length character variable, for example:
integer(I4B) :: iu character(len=:), allocatable :: my_string logical :: eof iu = 8 open(iu,file='my_file') my_string = read_line(iu, eof)
Definition at line 1196 of file InputOutput.f90.
logical function, public inputoutputmodule::same_word | ( | character(len=*), intent(in) | word1, |
character(len=*), intent(in) | word2 | ||
) |
Definition at line 1052 of file InputOutput.f90.
character(len=max(len_trim(str), width)) function, public inputoutputmodule::str_pad_left | ( | character(len=*), intent(in) | str, |
integer, intent(in) | width | ||
) |
subroutine, public inputoutputmodule::u9rdcom | ( | integer(i4b), intent(in) | iin, |
integer(i4b), intent(in) | iout, | ||
character(len=:), intent(inout), allocatable | line, | ||
integer(i4b), intent(out) | ierr | ||
) |
Different from u8rdcom in that line is a deferred length character string, which allows any length lines to be read using the get_line subroutine.
Definition at line 1731 of file InputOutput.f90.
subroutine, public inputoutputmodule::ubdsv06 | ( | integer(i4b), intent(in) | kstp, |
integer(i4b), intent(in) | kper, | ||
character(len=*), intent(in) | text, | ||
character(len=*), intent(in) | modelnam1, | ||
character(len=*), intent(in) | paknam1, | ||
character(len=*), intent(in) | modelnam2, | ||
character(len=*), intent(in) | paknam2, | ||
integer(i4b), intent(in) | ibdchn, | ||
integer(i4b), intent(in) | naux, | ||
character(len=16), dimension(:), intent(in) | auxtxt, | ||
integer(i4b), intent(in) | ncol, | ||
integer(i4b), intent(in) | nrow, | ||
integer(i4b), intent(in) | nlay, | ||
integer(i4b), intent(in) | nlist, | ||
integer(i4b), intent(in) | iout, | ||
real(dp), intent(in) | delt, | ||
real(dp), intent(in) | pertim, | ||
real(dp), intent(in) | totim | ||
) |
Each item in the list is written by module ubdsvc
Definition at line 958 of file InputOutput.f90.
subroutine, public inputoutputmodule::ubdsv1 | ( | integer(i4b), intent(in) | kstp, |
integer(i4b), intent(in) | kper, | ||
character(len=*), intent(in) | text, | ||
integer(i4b), intent(in) | ibdchn, | ||
real(dp), dimension(:), intent(in) | buff, | ||
integer(i4b), intent(in) | ncol, | ||
integer(i4b), intent(in) | nrow, | ||
integer(i4b), intent(in) | nlay, | ||
integer(i4b), intent(in) | iout, | ||
real(dp), intent(in) | delt, | ||
real(dp), intent(in) | pertim, | ||
real(dp), intent(in) | totim | ||
) |
subroutine, public inputoutputmodule::ubdsv4 | ( | kstp, | |
kper, | |||
character(len=16) | text, | ||
naux, | |||
character(len=16), dimension(:) | auxtxt, | ||
ibdchn, | |||
ncol, | |||
nrow, | |||
nlay, | |||
nlist, | |||
iout, | |||
real(dp), intent(in) | delt, | ||
real(dp), intent(in) | pertim, | ||
real(dp), intent(in) | totim | ||
) |
subroutine, public inputoutputmodule::ubdsvb | ( | ibdchn, | |
icrl, | |||
real(dp) | q, | ||
real(dp), dimension(nvl) | val, | ||
nvl, | |||
naux, | |||
laux | |||
) |
Definition at line 626 of file InputOutput.f90.
subroutine, public inputoutputmodule::ubdsvc | ( | integer(i4b), intent(in) | ibdchn, |
integer(i4b), intent(in) | n, | ||
real(dp), intent(in) | q, | ||
integer(i4b), intent(in) | naux, | ||
real(dp), dimension(naux), intent(in) | aux | ||
) |
From node (n) and to node (n2) are written to the file
Definition at line 1007 of file InputOutput.f90.
subroutine, public inputoutputmodule::ubdsvd | ( | integer(i4b), intent(in) | ibdchn, |
integer(i4b), intent(in) | n, | ||
integer(i4b), intent(in) | n2, | ||
real(dp), intent(in) | q, | ||
integer(i4b), intent(in) | naux, | ||
real(dp), dimension(naux), intent(in) | aux | ||
) |
From node (n) and to node (n2) are written to the file
Definition at line 1030 of file InputOutput.f90.
subroutine, public inputoutputmodule::ucolno | ( | nlbl1, | |
nlbl2, | |||
nspace, | |||
ncpl, | |||
ndig, | |||
iout | |||
) |
nlbl1 is the start column label (number) nlbl2 is the stop column label (number) nspace is number of blank spaces to leave at start of line ncpl is number of column numbers per line ndig is number of characters in each column field iout is output channel
Definition at line 649 of file InputOutput.f90.
subroutine, public inputoutputmodule::ulaprufw | ( | integer(i4b), intent(in) | ncol, |
integer(i4b), intent(in) | nrow, | ||
integer(i4b), intent(in) | kstp, | ||
integer(i4b), intent(in) | kper, | ||
integer(i4b), intent(in) | ilay, | ||
integer(i4b), intent(in) | iout, | ||
real(dp), dimension(ncol, nrow), intent(in) | buf, | ||
character(len=*), intent(in) | text, | ||
character(len=*), intent(in) | userfmt, | ||
integer(i4b), intent(in) | nvalues, | ||
integer(i4b), intent(in) | nwidth, | ||
character(len=1), intent(in) | editdesc | ||
) |
Definition at line 1142 of file InputOutput.f90.
subroutine, public inputoutputmodule::ulaprw | ( | real(dp), dimension(ncol, nrow) | buf, |
character(len=16) | text, | ||
kstp, | |||
kper, | |||
ncol, | |||
nrow, | |||
ilay, | |||
iprn, | |||
iout | |||
) |
subroutine, public inputoutputmodule::ulasav | ( | real(dp), dimension(ncol, nrow) | buf, |
character(len=16) | text, | ||
kstp, | |||
kper, | |||
real(dp) | pertim, | ||
real(dp) | totim, | ||
ncol, | |||
nrow, | |||
ilay, | |||
ichn | |||
) |
subroutine, public inputoutputmodule::ulstlb | ( | iout, | |
character(len=*) | label, | ||
character(len=16), dimension(ncaux) | caux, | ||
ncaux, | |||
naux | |||
) |
subroutine, public inputoutputmodule::unitinquire | ( | integer(i4b) | iu | ) |
Definition at line 1079 of file InputOutput.f90.
subroutine, public inputoutputmodule::upcase | ( | character(len=*), intent(inout) | word | ) |
Subroutine to convert a character string to upper case.
[in,out] | word | word to convert to upper case |
Definition at line 186 of file InputOutput.f90.
subroutine, public inputoutputmodule::urdaux | ( | integer(i4b), intent(inout) | naux, |
integer(i4b), intent(in) | inunit, | ||
integer(i4b), intent(in) | iout, | ||
integer(i4b), intent(inout) | lloc, | ||
integer(i4b), intent(inout) | istart, | ||
integer(i4b), intent(inout) | istop, | ||
character(len=lenauxname), dimension(:), intent(inout), allocatable | auxname, | ||
character(len=*), intent(inout) | line, | ||
character(len=*), intent(in) | text | ||
) |
Definition at line 1316 of file InputOutput.f90.
subroutine, public inputoutputmodule::urword | ( | character(len=*) | line, |
integer(i4b), intent(inout) | icol, | ||
integer(i4b), intent(inout) | istart, | ||
integer(i4b), intent(inout) | istop, | ||
integer(i4b), intent(in) | ncode, | ||
integer(i4b), intent(inout) | n, | ||
real(dp), intent(inout) | r, | ||
integer(i4b), intent(in) | iout, | ||
integer(i4b), intent(in) | in | ||
) |
Subroutine to extract a word from a line of text, and optionally convert the word to a number. The last character in the line is set to blank so that if any problems occur with finding a word, istart and istop will point to this blank character. Thus, a word will always be returned unless there is a numeric conversion error. Be sure that the last character in line is not an important character because it will always be set to blank.
A word starts with the first character that is not a space or comma, and ends when a subsequent character that is a space or comma. Note that these parsing rules do not treat two commas separated by one or more spaces as a null word.
For a word that begins with "'" or '"', the word starts with the character after the quote and ends with the character preceding a subsequent quote. Thus, a quoted word can include spaces and commas. The quoted word cannot contain a quote character of the same type within the word but can contain a different quote character. For example, "WORD'S" or 'WORD"S'.
Number conversion error is written to unit iout if iout is positive; error is written to default output if iout is 0; no error message is written if iout is negative.
line | line to parse | |
[in,out] | icol | current column in line |
[in,out] | istart | starting character position of the word |
[in,out] | istop | ending character position of the word |
[in] | ncode | word conversion flag (1) upper case, (2) integer, (3) real number |
[in,out] | n | integer data type |
[in,out] | r | float data type |
[in] | iout | output listing file unit |
[in] | in | input file unit number |
Definition at line 405 of file InputOutput.f90.
subroutine, public inputoutputmodule::uwword | ( | character(len=*), intent(inout) | line, |
integer(i4b), intent(inout) | icol, | ||
integer(i4b), intent(in) | ilen, | ||
integer(i4b), intent(in) | ncode, | ||
character(len=*), intent(in) | c, | ||
integer(i4b), intent(in) | n, | ||
real(dp), intent(in) | r, | ||
character(len=*), intent(in), optional | fmt, | ||
integer(i4b), intent(in), optional | alignment, | ||
character(len=*), intent(in), optional | sep | ||
) |
Subroutine to create a formatted line with specified alignment and column separators. Like URWORD, UWWORD works with strings, integers, and floats. Can pass an optional format statement, alignment, and column separator.
[in,out] | icol | column to write to line |
[in] | ilen | current length of line |
[in] | ncode | code for data type to write |
[in] | c | character data type |
[in] | n | integer data type |
[in] | r | float data type |
[in] | fmt | format statement |
[in] | alignment | alignment specifier |
[in] | sep | column separator |
Definition at line 267 of file InputOutput.f90.