90 class(HeadFileReaderType) :: this
91 logical,
intent(out) :: success
92 integer(I4B),
intent(in),
optional :: iout_opt
94 integer(I4B) :: iostat, iout
95 integer(I4B) :: ncol, nrow, ilay
98 if (
present(iout_opt))
then
109 read (this%inunit, iostat=iostat) this%kstp, this%kper, this%pertim, &
110 this%totim, this%text, ncol, nrow, ilay
111 if (iostat /= 0)
then
113 if (iostat < 0) this%endoffile = .true.
118 if (.not.
allocated(this%head))
then
119 allocate (this%head(ncol * nrow))
121 if (
size(this%head) /= ncol * nrow)
then
122 deallocate (this%head)
123 allocate (this%head(ncol * nrow))
128 read (this%inunit) this%head
131 if (.not. this%endoffile)
then
132 read (this%inunit, iostat=iostat) this%kstpnext, this%kpernext
133 if (iostat == 0)
then
135 else if (iostat < 0)
then
136 this%endoffile = .true.