585 class(TspFmiType) :: this
587 type(BudgetObjectType),
pointer :: budobjptr
588 character(len=LINELENGTH) :: keyword, fname
589 character(len=LENPACKAGENAME) :: pname
592 integer(I4B) :: inunit
594 logical :: isfound, endOfBlock
595 logical :: blockrequired
597 type(BudObjPtrArray),
dimension(:),
allocatable :: tmpbudobj
601 blockrequired = .true.
604 call this%parser%GetBlock(
'PACKAGEDATA', isfound, ierr, &
605 blockrequired=blockrequired, &
606 supportopenclose=.true.)
610 write (this%iout,
'(1x,a)')
'PROCESSING FMI PACKAGEDATA'
612 call this%parser%GetNextLine(endofblock)
614 call this%parser%GetStringCaps(keyword)
615 select case (keyword)
617 call this%parser%GetStringCaps(keyword)
618 if (keyword /=
'FILEIN')
then
619 call store_error(
'GWFBUDGET keyword must be followed by '// &
620 '"FILEIN" then by filename.')
621 call this%parser%StoreErrorUnit()
623 call this%parser%GetString(fname)
625 inquire (file=trim(fname), exist=exist)
626 if (.not. exist)
then
627 call store_error(
'Could not find file '//trim(fname))
628 call this%parser%StoreErrorUnit()
630 call openfile(inunit, this%iout, fname,
'DATA(BINARY)',
form, &
633 call this%initialize_bfr()
635 call this%parser%GetStringCaps(keyword)
636 if (keyword /=
'FILEIN')
then
637 call store_error(
'GWFHEAD keyword must be followed by '// &
638 '"FILEIN" then by filename.')
639 call this%parser%StoreErrorUnit()
641 call this%parser%GetString(fname)
642 inquire (file=trim(fname), exist=exist)
643 if (.not. exist)
then
644 call store_error(
'Could not find file '//trim(fname))
645 call this%parser%StoreErrorUnit()
648 call openfile(inunit, this%iout, fname,
'DATA(BINARY)',
form, &
651 call this%initialize_hfr()
653 call this%parser%GetStringCaps(keyword)
654 if (keyword /=
'FILEIN')
then
655 call store_error(
'GWFMOVER keyword must be followed by '// &
656 '"FILEIN" then by filename.')
657 call this%parser%StoreErrorUnit()
659 call this%parser%GetString(fname)
661 call openfile(inunit, this%iout, fname,
'DATA(BINARY)',
form, &
664 call budgetobject_cr_bfr(this%mvrbudobj,
'MVT', this%iumvr, &
666 call this%mvrbudobj%fill_from_bfr(this%dis, this%iout)
670 allocate (tmpbudobj(iapt))
671 do i = 1,
size(this%aptbudobj)
672 tmpbudobj(i)%ptr => this%aptbudobj(i)%ptr
674 deallocate (this%aptbudobj)
675 allocate (this%aptbudobj(iapt + 1))
676 do i = 1,
size(tmpbudobj)
677 this%aptbudobj(i)%ptr => tmpbudobj(i)%ptr
679 deallocate (tmpbudobj)
684 call this%parser%GetStringCaps(keyword)
685 if (keyword /=
'FILEIN')
then
686 call store_error(
'Package name must be followed by '// &
687 '"FILEIN" then by filename.')
688 call this%parser%StoreErrorUnit()
690 call this%parser%GetString(fname)
692 call openfile(inunit, this%iout, fname,
'DATA(BINARY)',
form, &
694 call budgetobject_cr_bfr(budobjptr, pname, inunit, &
695 this%iout, colconv2=[
'GWF '])
696 call budobjptr%fill_from_bfr(this%dis, this%iout)
697 this%aptbudobj(iapt)%ptr => budobjptr
700 write (this%iout,
'(1x,a)')
'END OF FMI PACKAGEDATA'
integer(i4b), parameter lenpackagename
maximum length of the package name