623 class(TspFmiType) :: this
625 type(BudgetObjectType),
pointer :: budobjptr
626 character(len=LINELENGTH) :: keyword, fname
627 character(len=LENPACKAGENAME) :: pname
630 integer(I4B) :: inunit
632 logical :: isfound, endOfBlock
633 logical :: blockrequired
635 type(BudObjPtrArray),
dimension(:),
allocatable :: tmpbudobj
639 blockrequired = .true.
642 call this%parser%GetBlock(
'PACKAGEDATA', isfound, ierr, &
643 blockrequired=blockrequired, &
644 supportopenclose=.true.)
648 write (this%iout,
'(1x,a)')
'PROCESSING FMI PACKAGEDATA'
650 call this%parser%GetNextLine(endofblock)
652 call this%parser%GetStringCaps(keyword)
653 select case (keyword)
655 call this%parser%GetStringCaps(keyword)
656 if (keyword /=
'FILEIN')
then
657 call store_error(
'GWFBUDGET keyword must be followed by '// &
658 '"FILEIN" then by filename.')
659 call this%parser%StoreErrorUnit()
661 call this%parser%GetString(fname)
663 inquire (file=trim(fname), exist=exist)
664 if (.not. exist)
then
665 call store_error(
'Could not find file '//trim(fname))
666 call this%parser%StoreErrorUnit()
668 call openfile(inunit, this%iout, fname,
'DATA(BINARY)',
form, &
671 call this%initialize_bfr()
673 call this%parser%GetStringCaps(keyword)
674 if (keyword /=
'FILEIN')
then
675 call store_error(
'GWFHEAD keyword must be followed by '// &
676 '"FILEIN" then by filename.')
677 call this%parser%StoreErrorUnit()
679 call this%parser%GetString(fname)
680 inquire (file=trim(fname), exist=exist)
681 if (.not. exist)
then
682 call store_error(
'Could not find file '//trim(fname))
683 call this%parser%StoreErrorUnit()
686 call openfile(inunit, this%iout, fname,
'DATA(BINARY)',
form, &
689 call this%initialize_hfr()
691 call this%parser%GetStringCaps(keyword)
692 if (keyword /=
'FILEIN')
then
693 call store_error(
'GWFMOVER keyword must be followed by '// &
694 '"FILEIN" then by filename.')
695 call this%parser%StoreErrorUnit()
697 call this%parser%GetString(fname)
699 call openfile(inunit, this%iout, fname,
'DATA(BINARY)',
form, &
702 call budgetobject_cr_bfr(this%mvrbudobj,
'MVT', this%iumvr, &
704 call this%mvrbudobj%fill_from_bfr(this%dis, this%iout)
708 allocate (tmpbudobj(iapt))
709 do i = 1,
size(this%aptbudobj)
710 tmpbudobj(i)%ptr => this%aptbudobj(i)%ptr
712 deallocate (this%aptbudobj)
713 allocate (this%aptbudobj(iapt + 1))
714 do i = 1,
size(tmpbudobj)
715 this%aptbudobj(i)%ptr => tmpbudobj(i)%ptr
717 deallocate (tmpbudobj)
722 call this%parser%GetStringCaps(keyword)
723 if (keyword /=
'FILEIN')
then
724 call store_error(
'Package name must be followed by '// &
725 '"FILEIN" then by filename.')
726 call this%parser%StoreErrorUnit()
728 call this%parser%GetString(fname)
730 call openfile(inunit, this%iout, fname,
'DATA(BINARY)',
form, &
732 call budgetobject_cr_bfr(budobjptr, pname, inunit, &
733 this%iout, colconv2=[
'GWF '])
734 call budobjptr%fill_from_bfr(this%dis, this%iout)
735 this%aptbudobj(iapt)%ptr => budobjptr
738 write (this%iout,
'(1x,a)')
'END OF FMI PACKAGEDATA'
integer(i4b), parameter lenpackagename
maximum length of the package name