17 integer(I4B) :: iout = 0
18 integer(I4B) :: input_unit = 0
19 character(len=:),
allocatable :: array_name
20 character(len=:),
allocatable :: filename
21 integer(I4B) :: iprn = 0
22 logical(LGP) :: isconstant = .false.
23 logical(LGP) :: isinternal = .false.
24 logical(LGP) :: isopenclose = .false.
25 logical(LGP) :: isbinary = .false.
50 call this%read_control_record()
53 if (this%isConstant)
then
54 call this%fill_constant()
55 else if (this%isInternal)
then
56 call this%fill_internal()
57 else if (this%isOpenClose)
then
58 call this%fill_open_close()
66 this%isConstant = .false.
67 this%isInternal = .false.
68 this%isOpenClose = .false.
69 this%isBinary = .false.
74 logical(LGP) :: endOfBlock
75 character(len=100) :: keyword
76 character(len=MAXCHARLEN) :: string
79 call this%parser%GetNextLine(endofblock)
80 call this%parser%GetStringCaps(keyword)
85 this%isConstant = .true.
86 call this%set_constant()
88 this%isInternal = .true.
90 this%isOpenClose = .true.
91 call this%parser%GetString(string)
92 this%filename = trim(string)
94 write (
errmsg, *)
'Error reading control record for '// &
95 trim(adjustl(this%array_name))//
'. &
96 & Use CONSTANT, INTERNAL, or OPEN/CLOSE.'
98 call this%parser%StoreErrorUnit()
102 if (this%isInternal .or. this%isOpenClose)
then
104 call this%parser%GetStringCaps(keyword)
105 if (keyword ==
'')
exit
106 select case (keyword)
108 call this%set_factor()
110 this%iprn = this%parser%GetInteger()
112 this%isBinary = .true.
121 errmsg =
'Programming error in ArrayReader'
127 errmsg =
'Programming error in ArrayReader'
133 this%input_unit = this%parser%iuactive
134 call this%read_ascii()
135 call this%apply_factor()
141 call this%open_file()
142 if (this%isBinary)
then
143 call this%read_binary()
145 call this%read_ascii()
147 close (this%input_unit)
148 call this%apply_factor()
153 errmsg =
'Programming error in ArrayReader'
159 errmsg =
'Programming error in ArrayReader'
165 errmsg =
'Programming error in ArrayReader'
171 errmsg =
'Programming error in ArrayReader'
178 if (this%isBinary)
then
179 call openfile(this%input_unit, this%iout, this%filename, &
180 'OPEN/CLOSE', fmtarg_opt=
form, accarg_opt=
access)
182 call openfile(this%input_unit, this%iout, this%filename,
'OPEN/CLOSE')
subroutine set_factor(this)
subroutine fill_constant(this)
subroutine read_array(this)
subroutine reset_reader(this)
subroutine read_control_record(this)
subroutine set_constant(this)
subroutine fill_open_close(this)
subroutine apply_factor(this)
subroutine open_file(this)
subroutine fill_internal(this)
subroutine read_binary(this)
subroutine read_ascii(this)
This module contains block parser methods.
This module contains simulation constants.
integer(i4b), parameter maxcharlen
maximum length of char string
This module defines variable data types.
This module contains simulation methods.
subroutine, public store_error(msg, terminate)
Store an error message.
This module contains simulation variables.
character(len=maxcharlen) errmsg
error message string