584 class(TspFmiType) :: this
586 type(BudgetObjectType),
pointer :: budobjptr
587 character(len=LINELENGTH) :: keyword, fname
588 character(len=LENPACKAGENAME) :: pname
591 integer(I4B) :: inunit
593 logical :: isfound, endOfBlock
594 logical :: blockrequired
596 type(BudObjPtrArray),
dimension(:),
allocatable :: tmpbudobj
600 blockrequired = .true.
603 call this%parser%GetBlock(
'PACKAGEDATA', isfound, ierr, &
604 blockrequired=blockrequired, &
605 supportopenclose=.true.)
609 write (this%iout,
'(1x,a)')
'PROCESSING FMI PACKAGEDATA'
611 call this%parser%GetNextLine(endofblock)
613 call this%parser%GetStringCaps(keyword)
614 select case (keyword)
616 call this%parser%GetStringCaps(keyword)
617 if (keyword /=
'FILEIN')
then
618 call store_error(
'GWFBUDGET keyword must be followed by '// &
619 '"FILEIN" then by filename.')
620 call this%parser%StoreErrorUnit()
622 call this%parser%GetString(fname)
624 inquire (file=trim(fname), exist=exist)
625 if (.not. exist)
then
626 call store_error(
'Could not find file '//trim(fname))
627 call this%parser%StoreErrorUnit()
629 call openfile(inunit, this%iout, fname,
'DATA(BINARY)',
form, &
632 call this%initialize_bfr()
634 call this%parser%GetStringCaps(keyword)
635 if (keyword /=
'FILEIN')
then
636 call store_error(
'GWFHEAD keyword must be followed by '// &
637 '"FILEIN" then by filename.')
638 call this%parser%StoreErrorUnit()
640 call this%parser%GetString(fname)
641 inquire (file=trim(fname), exist=exist)
642 if (.not. exist)
then
643 call store_error(
'Could not find file '//trim(fname))
644 call this%parser%StoreErrorUnit()
647 call openfile(inunit, this%iout, fname,
'DATA(BINARY)',
form, &
650 call this%initialize_hfr()
652 call this%parser%GetStringCaps(keyword)
653 if (keyword /=
'FILEIN')
then
654 call store_error(
'GWFMOVER keyword must be followed by '// &
655 '"FILEIN" then by filename.')
656 call this%parser%StoreErrorUnit()
658 call this%parser%GetString(fname)
660 call openfile(inunit, this%iout, fname,
'DATA(BINARY)',
form, &
663 call budgetobject_cr_bfr(this%mvrbudobj,
'MVT', this%iumvr, &
665 call this%mvrbudobj%fill_from_bfr(this%dis, this%iout)
669 allocate (tmpbudobj(iapt))
670 do i = 1,
size(this%aptbudobj)
671 tmpbudobj(i)%ptr => this%aptbudobj(i)%ptr
673 deallocate (this%aptbudobj)
674 allocate (this%aptbudobj(iapt + 1))
675 do i = 1,
size(tmpbudobj)
676 this%aptbudobj(i)%ptr => tmpbudobj(i)%ptr
678 deallocate (tmpbudobj)
683 call this%parser%GetStringCaps(keyword)
684 if (keyword /=
'FILEIN')
then
685 call store_error(
'Package name must be followed by '// &
686 '"FILEIN" then by filename.')
687 call this%parser%StoreErrorUnit()
689 call this%parser%GetString(fname)
691 call openfile(inunit, this%iout, fname,
'DATA(BINARY)',
form, &
693 call budgetobject_cr_bfr(budobjptr, pname, inunit, &
694 this%iout, colconv2=[
'GWF '])
695 call budobjptr%fill_from_bfr(this%dis, this%iout)
696 this%aptbudobj(iapt)%ptr => budobjptr
699 write (this%iout,
'(1x,a)')
'END OF FMI PACKAGEDATA'
integer(i4b), parameter lenpackagename
maximum length of the package name