129 class(BudgetFileReaderType) :: this
130 logical,
intent(out) :: success
131 integer(I4B),
intent(in),
optional :: iout_opt
133 integer(I4B) :: i, n, iostat, iout
134 character(len=LINELENGTH) :: errmsg
136 if (
present(iout_opt))
then
149 this%srcmodelname =
''
150 this%srcpackagename =
''
151 this%dstmodelname =
''
152 this%dstpackagename =
''
157 read (this%inunit, iostat=iostat) this%kstp, this%kper, this%budtxt, &
158 this%nval, this%idum1, this%idum2
159 if (iostat /= 0)
then
161 if (iostat < 0) this%endoffile = .true.
164 read (this%inunit) this%imeth, this%delt, this%pertim, this%totim
165 if (this%imeth == 1)
then
166 if (trim(adjustl(this%budtxt)) ==
'FLOW-JA-FACE')
then
167 if (
allocated(this%flowja))
deallocate (this%flowja)
168 allocate (this%flowja(this%nval))
169 read (this%inunit) this%flowja
170 this%hasimeth1flowja = .true.
172 this%nval = this%nval * this%idum1 * abs(this%idum2)
173 if (
allocated(this%flow))
deallocate (this%flow)
174 allocate (this%flow(this%nval))
175 if (
allocated(this%nodesrc))
deallocate (this%nodesrc)
176 allocate (this%nodesrc(this%nval))
177 read (this%inunit) this%flow
182 elseif (this%imeth == 6)
then
184 read (this%inunit) this%srcmodelname
185 read (this%inunit) this%srcpackagename
186 read (this%inunit) this%dstmodelname
187 read (this%inunit) this%dstpackagename
188 read (this%inunit) this%ndat
189 this%naux = this%ndat - 1
190 if (
allocated(this%auxtxt))
deallocate (this%auxtxt)
191 allocate (this%auxtxt(this%naux))
192 read (this%inunit) this%auxtxt
193 read (this%inunit) this%nlist
194 if (
allocated(this%nodesrc))
deallocate (this%nodesrc)
195 allocate (this%nodesrc(this%nlist))
196 if (
allocated(this%nodedst))
deallocate (this%nodedst)
197 allocate (this%nodedst(this%nlist))
198 if (
allocated(this%flow))
deallocate (this%flow)
199 allocate (this%flow(this%nlist))
200 if (
allocated(this%auxvar))
deallocate (this%auxvar)
201 allocate (this%auxvar(this%naux, this%nlist))
202 read (this%inunit) (this%nodesrc(n), this%nodedst(n), this%flow(n), &
203 (this%auxvar(i, n), i=1, this%naux), n=1, this%nlist)
205 write (errmsg,
'(a, a)')
'ERROR READING: ', trim(this%budtxt)
206 call store_error(errmsg)
207 write (errmsg,
'(a, i0)')
'INVALID METHOD CODE DETECTED: ', this%imeth
208 call store_error(errmsg)
209 call store_error_unit(this%inunit)
212 write (iout,
'(1pg15.6, a, 1x, a)') this%totim, this%budtxt, &
217 if (.not. this%endoffile)
then
218 read (this%inunit, iostat=iostat) this%kstpnext, this%kpernext
219 if (iostat == 0)
then
221 else if (iostat < 0)
then
222 this%endoffile = .true.