23 integer(I4B) :: nval = 0
24 integer(I4B),
allocatable,
dimension(:) :: iunit
25 integer(I4B),
allocatable,
dimension(:) :: ipos
29 integer(I4B) :: niunit = 0
30 character(len=LENFTYPE),
allocatable,
dimension(:) :: cunit
43 subroutine init(this, niunit, cunit)
46 integer(I4B),
intent(in) :: niunit
47 character(len=*),
dimension(niunit),
intent(in) :: cunit
51 allocate (this%cunit(niunit))
52 allocate (this%iunit(niunit))
55 this%cunit(i) = cunit(i)
63 subroutine addfile(this, ftyp, iunit, ipos, namefilename)
66 character(len=*),
intent(in) :: ftyp
67 integer(I4B),
intent(in) :: iunit
68 integer(I4B),
intent(in) :: ipos
69 character(len=*),
intent(in) :: namefilename
71 character(len=LINELENGTH) :: errmsg
72 integer(I4B),
allocatable,
dimension(:) :: itemp
73 integer(I4B) :: i, irow
78 if (this%cunit(i) == ftyp)
then
84 write (errmsg,
'(a,a)')
'Package type not supported: ', ftyp
90 if (this%iunit(irow)%nval == 0)
then
91 allocate (this%iunit(irow)%iunit(1))
92 allocate (this%iunit(irow)%ipos(1))
93 this%iunit(irow)%nval = 1
97 allocate (itemp(this%iunit(irow)%nval))
98 itemp(:) = this%iunit(irow)%iunit(:)
99 deallocate (this%iunit(irow)%iunit)
100 this%iunit(irow)%nval = this%iunit(irow)%nval + 1
101 allocate (this%iunit(irow)%iunit(this%iunit(irow)%nval))
102 this%iunit(irow)%iunit(1:this%iunit(irow)%nval - 1) = itemp(:)
105 itemp(:) = this%iunit(irow)%ipos(:)
106 deallocate (this%iunit(irow)%ipos)
107 allocate (this%iunit(irow)%ipos(this%iunit(irow)%nval))
108 this%iunit(irow)%ipos(1:this%iunit(irow)%nval - 1) = itemp(:)
113 this%iunit(irow)%iunit(this%iunit(irow)%nval) = iunit
114 this%iunit(irow)%ipos(this%iunit(irow)%nval) = ipos
124 character(len=*),
intent(in) :: ftyp
125 integer(I4B),
intent(inout) :: iunit
126 integer(I4B),
intent(in) :: iremove
128 integer(I4B) :: i, irow, nval
132 do i = 1, this%niunit
133 if (this%cunit(i) == ftyp)
then
142 nval = this%iunit(irow)%nval
144 iunit = this%iunit(irow)%iunit(nval)
145 if (iremove > 0)
then
146 this%iunit(irow)%iunit(nval) = 0
147 this%iunit(irow)%nval = nval - 1
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
integer(i4b), parameter lenftype
maximum length of a package type (DIS, WEL, OC, etc.)
– Module to manage unit numbers. Allows for multiple unit numbers – assigned to a single package type...
subroutine getunitnumber(this, ftyp, iunit, iremove)
Get the last unit number for type ftyp or return 0 for iunit.
subroutine addfile(this, ftyp, iunit, ipos, namefilename)
Add an ftyp and unit number.
This module defines variable data types.
This module contains simulation methods.
subroutine, public store_error(msg, terminate)
Store an error message.
subroutine, public store_error_filename(filename, terminate)
Store the erroring file name.