141 class(BudgetFileReaderType) :: this
142 logical,
intent(out) :: success
143 integer(I4B),
intent(in),
optional :: iout_opt
145 integer(I4B) :: i, n, iostat, iout
146 character(len=LINELENGTH) :: errmsg
149 if (
present(iout_opt))
then
162 this%srcmodelname =
''
163 this%srcpackagename =
''
164 this%dstmodelname =
''
165 this%dstpackagename =
''
170 read (this%inunit, iostat=iostat) this%kstp, this%kper, this%budtxt, &
171 this%nval, this%idum1, this%idum2
172 if (iostat /= 0)
then
174 if (iostat < 0) this%endoffile = .true.
177 read (this%inunit) this%imeth, this%delt, this%pertim, this%totim
178 if (this%imeth == 1)
then
179 if (trim(adjustl(this%budtxt)) ==
'FLOW-JA-FACE')
then
180 if (
allocated(this%flowja))
deallocate (this%flowja)
181 allocate (this%flowja(this%nval))
182 read (this%inunit) this%flowja
183 this%hasimeth1flowja = .true.
185 this%nval = this%nval * this%idum1 * abs(this%idum2)
186 if (
allocated(this%flow))
deallocate (this%flow)
187 allocate (this%flow(this%nval))
188 if (
allocated(this%nodesrc))
deallocate (this%nodesrc)
189 allocate (this%nodesrc(this%nval))
190 read (this%inunit) this%flow
195 elseif (this%imeth == 6)
then
197 read (this%inunit) this%srcmodelname
198 read (this%inunit) this%srcpackagename
199 read (this%inunit) this%dstmodelname
200 read (this%inunit) this%dstpackagename
201 read (this%inunit) this%ndat
202 this%naux = this%ndat - 1
203 if (
allocated(this%auxtxt))
deallocate (this%auxtxt)
204 allocate (this%auxtxt(this%naux))
205 read (this%inunit) this%auxtxt
206 read (this%inunit) this%nlist
207 if (
allocated(this%nodesrc))
deallocate (this%nodesrc)
208 allocate (this%nodesrc(this%nlist))
209 if (
allocated(this%nodedst))
deallocate (this%nodedst)
210 allocate (this%nodedst(this%nlist))
211 if (
allocated(this%flow))
deallocate (this%flow)
212 allocate (this%flow(this%nlist))
213 if (
allocated(this%auxvar))
deallocate (this%auxvar)
214 allocate (this%auxvar(this%naux, this%nlist))
215 read (this%inunit) (this%nodesrc(n), this%nodedst(n), this%flow(n), &
216 (this%auxvar(i, n), i=1, this%naux), n=1, this%nlist)
218 write (errmsg,
'(a, a)')
'ERROR READING: ', trim(this%budtxt)
219 call store_error(errmsg)
220 write (errmsg,
'(a, i0)')
'INVALID METHOD CODE DETECTED: ', this%imeth
221 call store_error(errmsg)
222 call store_error_unit(this%inunit)
225 write (iout,
'(1pg15.6, a, 1x, a)') this%totim, this%budtxt, &
230 if (.not. this%endoffile)
then
231 read (this%inunit, iostat=iostat) this%kstpnext, this%kpernext
232 if (iostat == 0)
then
234 else if (iostat < 0)
then
235 this%endoffile = .true.