52 class(BudgetFileReaderType) :: this
53 integer(I4B),
intent(in) :: iu
54 integer(I4B),
intent(in) :: iout
55 integer(I4B),
intent(out) :: ncrbud
57 integer(I4B) :: ibudterm
58 integer(I4B) :: kstp_last, kper_last
59 integer(I4B) :: maxaux
71 'Reading budget file to determine number of terms per time step.'
75 call this%read_record(success)
76 if (.not. success)
exit
77 this%nbudterms = this%nbudterms + 1
78 select type (h => this%header)
79 type is (budgetfileheadertype)
80 if (h%naux > maxaux) maxaux = h%naux
83 if (this%endoffile)
exit
84 if (this%header%kstp /= this%headernext%kstp .or. &
85 this%header%kper /= this%headernext%kper) &
88 kstp_last = this%header%kstp
89 kper_last = this%header%kper
90 allocate (this%budtxtarray(this%nbudterms))
91 allocate (this%imetharray(this%nbudterms))
92 allocate (this%dstpackagenamearray(this%nbudterms))
93 allocate (this%nauxarray(this%nbudterms))
94 allocate (this%auxtxtarray(maxaux, this%nbudterms))
95 this%auxtxtarray(:, :) =
''
99 do ibudterm = 1, this%nbudterms
100 call this%read_record(success, iout)
101 if (.not. success)
exit
102 select type (h => this%header)
103 type is (budgetfileheadertype)
104 this%budtxtarray(ibudterm) = h%budtxt
105 this%imetharray(ibudterm) = h%imeth
106 this%dstpackagenamearray(ibudterm) = h%dstpackagename
107 this%nauxarray(ibudterm) = h%naux
109 this%auxtxtarray(1:h%naux, ibudterm) = h%auxtxt(:)
111 if (h%srcmodelname == h%dstmodelname)
then
112 if (
allocated(this%nodesrc)) ncrbud = max(ncrbud, maxval(this%nodesrc))
118 write (iout,
'(a, i0, a)')
'Detected ', this%nbudterms, &
119 ' unique flow terms in budget file.'