Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(MemoryManager): Add string array #449

Merged
merged 11 commits into from
May 27, 2020
Prev Previous commit
Next Next commit
refactor(MemoryManager): Add string array
  • Loading branch information
jdhughes-usgs committed May 21, 2020
commit 0657fce62cacc571f98b1303ac423820c892650b
7 changes: 5 additions & 2 deletions autotest/test_gwf_csub_sub02.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def get_model(idx, dir):
cdelays = 'nodelay'

sub6 = [[0, (0, 0, 0), cdelays, ini_stress, thick[0],
1., cc, cr, theta, kv, 0.]]
1., cc, cr, theta, kv, 0., 'db01']]

# build MODFLOW 6 files
ws = dir
Expand Down Expand Up @@ -173,7 +173,10 @@ def get_model(idx, dir):
save_flows=False)

# csub files
csub = flopy.mf6.ModflowGwfcsub(gwf, head_based=True,
csub = flopy.mf6.ModflowGwfcsub(gwf,
print_input=True,
boundnames=True,
head_based=True,
ndelaycells=ndelaycells[idx],
ninterbeds=1,
beta=0., cg_ske_cr=cg_ske,
Expand Down
51 changes: 27 additions & 24 deletions src/Model/GroundWaterFlow/gwf3csub8.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1690,11 +1690,11 @@ subroutine csub_read_packagedata(this)
character(len=LINELENGTH) :: tag
character(len=20) :: scellid
character(len=10) :: text
character(len=LENBOUNDNAME) :: bndName, bndNameTemp
character(len=LENBOUNDNAME) :: bndName
character(len=7) :: cdelay
character(len=9) :: cno
logical :: isfound
logical :: endOfBlock
integer(I4B) :: ival
logical :: isfound, endOfBlock
integer(I4B) :: n
integer(I4B) :: nn
integer(I4B) :: ib
Expand Down Expand Up @@ -1729,21 +1729,25 @@ subroutine csub_read_packagedata(this)
' PACKAGEDATA'
do
call this%parser%GetNextLine(endOfBlock)
if (endOfBlock) exit
! -- read interbed number
if (endOfBlock) then
exit
end if
!
! -- get interbed number
itmp = this%parser%GetInteger()

!
! -- check for error condition
if (itmp < 1 .or. itmp > this%ninterbeds) then
write(errmsg,'(a,1x,i0,2(1x,a),1x,i0,a)') &
'Interbed number (', itmp, ') must be greater than 0 and ', &
'less than or equal to', this%ninterbeds, '.'
call store_error(errmsg)
cycle
end if

!
! -- increment nboundchk
nboundchk(itmp) = nboundchk(itmp) + 1

!
! -- read cellid
call this%parser%GetCellid(this%dis%ndim, cellid)
nn = this%dis%noder_from_cellid(cellid, &
Expand All @@ -1753,17 +1757,18 @@ subroutine csub_read_packagedata(this)
top = this%dis%top(nn)
bot = this%dis%bot(nn)
baq = top - bot
!
! -- determine if a valid cell location was provided
if (nn < 1) then
write(errmsg,'(a,1x,i0,a)') &
'Invalid cellid for packagedata entry', itmp, '.'
call store_error(errmsg)
end if

!
! -- set nodelist and unodelist
this%nodelist(itmp) = nn
this%unodelist(itmp) = n

!
! -- get cdelay
call this%parser%GetStringCaps(cdelay)
select case (cdelay)
Expand All @@ -1781,10 +1786,10 @@ subroutine csub_read_packagedata(this)
end select
idelay = ival
this%idelay(itmp) = ival

!
! -- get initial preconsolidation stress
this%pcs(itmp) = this%parser%GetDouble()

!
! -- get thickness or cell fraction
rval = this%parser%GetDouble()
if (this%icellf == 0) then
Expand All @@ -1808,7 +1813,7 @@ subroutine csub_read_packagedata(this)
if (this%iupdatematprop /= 0) then
this%thick(itmp) = rval
end if

!
! -- get rnb
rval = this%parser%GetDouble()
if (idelay > 0) then
Expand Down Expand Up @@ -1873,26 +1878,24 @@ subroutine csub_read_packagedata(this)
end if
end if
this%kv(itmp) = rval

!
! -- get h0
rval = this%parser%GetDouble()
this%h0(itmp) = rval

!
! -- get bound names
write (cno,'(i9.9)') nn
bndName = 'nsystem' // cno
if (this%inamedbound /= 0) then
call this%parser%GetStringCaps(bndNameTemp)
if (bndNameTemp /= '') then
bndName = bndNameTemp(1:16)
call this%parser%GetStringCaps(bndName)
if (len_trim(bndName) < 1) then
write(errmsg,'(a,1x,i0,a)') &
'BOUNDNAME must be specified for packagedata entry', itmp, '.'
call store_error(errmsg)
else
write(errmsg,'(a,1x,i0,a)') &
'BOUNDNAME must be specified for packagedata entry', itmp, '.'
call store_error(errmsg)
this%boundname(itmp) = bndName
end if
end if
this%boundname(itmp) = bndName
end do

write(this%iout,'(1x,a)') &
'END OF ' // trim(adjustl(this%name)) // ' PACKAGEDATA'
end if
Expand Down