Skip to content

Commit

Permalink
fix(getblock): many of the parser%getblock calls did not have support…
Browse files Browse the repository at this point in the history
…openclose=.true.

added supportopenclose=.true. to many getblock calls
closes #MODFLOW-USGS#163
  • Loading branch information
langevin-usgs committed Nov 7, 2019
1 parent 254cc17 commit b2fe994
Show file tree
Hide file tree
Showing 17 changed files with 57 additions and 30 deletions.
8 changes: 5 additions & 3 deletions src/Exchange/GhostNode.f90
Original file line number Diff line number Diff line change
Expand Up @@ -784,7 +784,8 @@ subroutine read_options(this)
! ------------------------------------------------------------------------------
!
! -- get options block
call this%parser%GetBlock('OPTIONS', isfound, ierr, blockRequired=.false.)
call this%parser%GetBlock('OPTIONS', isfound, ierr, &
supportOpenClose=.true., blockRequired=.false.)
!
! -- parse options block if detected
if (isfound) then
Expand Down Expand Up @@ -846,7 +847,8 @@ subroutine read_dimensions(this)
! ------------------------------------------------------------------------------
!
! -- get options block
call this%parser%GetBlock('DIMENSIONS', isfound, ierr)
call this%parser%GetBlock('DIMENSIONS', isfound, ierr, &
supportOpenClose=.true.)
!
! -- parse options block if detected
if (isfound) then
Expand Down Expand Up @@ -911,7 +913,7 @@ subroutine read_data(this)
allocate(nodesuj(this%numjs))
!
! -- get GNCDATA block
call this%parser%GetBlock('GNCDATA', isfound, ierr)
call this%parser%GetBlock('GNCDATA', isfound, ierr, supportOpenClose=.true.)
!
! -- process GNC data
if (isfound) then
Expand Down
3 changes: 2 additions & 1 deletion src/Model/GroundWaterFlow/gwf3disv8.f90
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ subroutine read_options(this)
! ------------------------------------------------------------------------------
!
! -- get options block
call this%parser%GetBlock('OPTIONS', isfound, ierr, blockRequired=.false.)
call this%parser%GetBlock('OPTIONS', isfound, ierr, &
supportOpenClose=.true., blockRequired=.false.)
!
! -- set default options
this%lenuni = 0
Expand Down
6 changes: 4 additions & 2 deletions src/Model/GroundWaterFlow/gwf3hfb8.f90
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,8 @@ subroutine read_options(this)
! ------------------------------------------------------------------------------
!
! -- get options block
call this%parser%GetBlock('OPTIONS', isfound, ierr, blockRequired=.false.)
call this%parser%GetBlock('OPTIONS', isfound, ierr, &
supportOpenClose=.true., blockRequired=.false.)
!
! -- parse options block if detected
if (isfound) then
Expand Down Expand Up @@ -610,7 +611,8 @@ subroutine read_dimensions(this)
! ------------------------------------------------------------------------------
!
! -- get dimensions block
call this%parser%GetBlock('DIMENSIONS', isfound, ierr)
call this%parser%GetBlock('DIMENSIONS', isfound, ierr, &
supportOpenClose=.true.)
!
! -- parse dimensions block if detected
if (isfound) then
Expand Down
3 changes: 2 additions & 1 deletion src/Model/GroundWaterFlow/gwf3lak8.f90
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,8 @@ subroutine lak_read_lakes(this)
!
! -- read lake well data
! -- get lakes block
call this%parser%GetBlock('PACKAGEDATA', isfound, ierr, supportOpenClose=.true.)
call this%parser%GetBlock('PACKAGEDATA', isfound, ierr, &
supportOpenClose=.true.)
!
! -- parse locations block if detected
if (isfound) then
Expand Down
3 changes: 2 additions & 1 deletion src/Model/GroundWaterFlow/gwf3maw8.f90
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,8 @@ subroutine maw_read_wells(this)
!
! -- read maw well data
! -- get wells block
call this%parser%GetBlock('PACKAGEDATA', isfound, ierr, supportopenclose=.true.)
call this%parser%GetBlock('PACKAGEDATA', isfound, ierr, &
supportopenclose=.true.)
!
! -- parse locations block if detected
if (isfound) then
Expand Down
4 changes: 2 additions & 2 deletions src/Model/GroundWaterFlow/gwf3mvr8.f90
Original file line number Diff line number Diff line change
Expand Up @@ -704,8 +704,8 @@ subroutine read_options(this)
! ------------------------------------------------------------------------------
!
! -- get options block
call this%parser%GetBlock('OPTIONS', isfound, ierr, supportOpenClose=.true., &
blockRequired=.false.)
call this%parser%GetBlock('OPTIONS', isfound, ierr, &
supportOpenClose=.true., blockRequired=.false.)
!
! -- parse options block if detected
if (isfound) then
Expand Down
3 changes: 2 additions & 1 deletion src/Model/GroundWaterFlow/gwf3sto8.f90
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,8 @@ subroutine read_options(this)
! ------------------------------------------------------------------------------
!
! -- get options block
call this%parser%GetBlock('OPTIONS', isfound, ierr, blockRequired=.false.)
call this%parser%GetBlock('OPTIONS', isfound, ierr, &
supportOpenClose=.true., blockRequired=.false.)
!
! -- parse options block if detected
if (isfound) then
Expand Down
3 changes: 2 additions & 1 deletion src/Model/GroundWaterFlow/gwf3uzf8.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2521,7 +2521,8 @@ subroutine read_cell_properties(this)
hgwf = DZERO
!
! -- get uzf properties block
call this%parser%GetBlock('PACKAGEDATA', isfound, ierr, supportOpenClose=.true.)
call this%parser%GetBlock('PACKAGEDATA', isfound, ierr, &
supportOpenClose=.true.)
!
! -- parse locations block if detected
if (isfound) then
Expand Down
15 changes: 10 additions & 5 deletions src/SimulationCreate.f90
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,8 @@ subroutine options_create()
! ------------------------------------------------------------------------------
!
! -- Process OPTIONS block
call parser%GetBlock('OPTIONS', isfound, ierr, blockRequired=.false.)
call parser%GetBlock('OPTIONS', isfound, ierr, &
supportOpenClose=.true., blockRequired=.false.)
if (isfound) then
write(iout,'(/1x,a)')'READING SIMULATION OPTIONS'
do
Expand Down Expand Up @@ -281,7 +282,8 @@ subroutine timing_create()
found_tdis = .false.
!
! -- Process TIMING block
call parser%GetBlock('TIMING', isfound, ierr)
call parser%GetBlock('TIMING', isfound, ierr, &
supportOpenClose=.true.)
if (isfound) then
write(iout,'(/1x,a)')'READING SIMULATION TIMING'
do
Expand Down Expand Up @@ -342,7 +344,8 @@ subroutine models_create()
! ------------------------------------------------------------------------------
!
! -- Process MODELS block
call parser%GetBlock('MODELS', isfound, ierr)
call parser%GetBlock('MODELS', isfound, ierr, &
supportOpenClose=.true.)
if (isfound) then
write(iout,'(/1x,a)')'READING SIMULATION MODELS'
im = 0
Expand Down Expand Up @@ -399,7 +402,8 @@ subroutine exchanges_create()
character(len=*), parameter :: fmtmerr = "('Error in simulation control ', &
&'file. Could not find model: ', a)"
! ------------------------------------------------------------------------------
call parser%GetBlock('EXCHANGES', isfound, ierr)
call parser%GetBlock('EXCHANGES', isfound, ierr, &
supportOpenClose=.true.)
if (isfound) then
write(iout,'(/1x,a)')'READING SIMULATION EXCHANGES'
id = 0
Expand Down Expand Up @@ -502,7 +506,8 @@ subroutine solution_groups_create()
!Read through the simulation name file and process each SOLUTION_GROUP
sgploop: do
!
call parser%GetBlock('SOLUTIONGROUP', isfound, ierr)
call parser%GetBlock('SOLUTIONGROUP', isfound, ierr, &
supportOpenClose=.true.)
if(ierr /= 0) exit sgploop
if (.not. isfound) exit sgploop
isgp = isgp + 1
Expand Down
6 changes: 4 additions & 2 deletions src/Solution/NumericalSolution.f90
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,8 @@ subroutine sln_ar(this)
mxvl = 0
!
! -- get options block
call this%parser%GetBlock('OPTIONS', isfound, ierr, blockRequired=.false.)
call this%parser%GetBlock('OPTIONS', isfound, ierr, &
supportOpenClose=.true., blockRequired=.false.)
!
! -- parse options block if detected
if (isfound) then
Expand Down Expand Up @@ -641,7 +642,8 @@ subroutine sln_ar(this)
call this%sln_setouter(ifdparam)
!
! -- get NONLINEAR block
call this%parser%GetBlock('NONLINEAR', isfound, ierr, blockRequired=.FALSE.)
call this%parser%GetBlock('NONLINEAR', isfound, ierr, &
supportOpenClose=.true., blockRequired=.FALSE.)
!
! -- parse NONLINEAR block if detected
if (isfound) then
Expand Down
3 changes: 2 additions & 1 deletion src/Solution/SparseMatrixSolver/ims8linear.f90
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ SUBROUTINE IMSLINEAR_AR(THIS, NAME, IN, IOUT, IPRIMS, MXITER, IFDPARAM, &
!
! -- get IMSLINEAR block
if (lreaddata) then
call parser%GetBlock('LINEAR', isfound, ierr, blockRequired=.FALSE.)
call parser%GetBlock('LINEAR', isfound, ierr, &
supportOpenClose=.true., blockRequired=.FALSE.)
else
isfound = .FALSE.
end if
Expand Down
9 changes: 6 additions & 3 deletions src/Timing/tdis.f90
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,8 @@ subroutine tdis_read_options()
undspec = .false.
!
! -- get options block
call parser%GetBlock('OPTIONS', isfound, ierr, blockRequired=.false.)
call parser%GetBlock('OPTIONS', isfound, ierr, &
supportOpenClose=.true., blockRequired=.false.)
!
! -- parse options block if detected
if (isfound) then
Expand Down Expand Up @@ -481,7 +482,8 @@ subroutine tdis_read_dimensions()
! ------------------------------------------------------------------------------
!
! -- get DIMENSIONS block
call parser%GetBlock('DIMENSIONS', isfound, ierr)
call parser%GetBlock('DIMENSIONS', isfound, ierr, &
supportOpenClose=.true.)
!
! -- parse block if detected
if (isfound) then
Expand Down Expand Up @@ -538,7 +540,8 @@ subroutine tdis_read_timing()
! ------------------------------------------------------------------------------
!
! -- get PERIODDATA block
call parser%GetBlock('PERIODDATA', isfound, ierr)
call parser%GetBlock('PERIODDATA', isfound, ierr, &
supportOpenClose=.true.)
!
! -- parse block if detected
if (isfound) then
Expand Down
6 changes: 4 additions & 2 deletions src/Utilities/NameFile.f90
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ subroutine namefile_init(this, filename, iout)
call this%parser%Initialize(inunit, iout)
!
! -- Read and set the options
call this%parser%GetBlock('OPTIONS', isFound, ierr, blockRequired=.false.)
call this%parser%GetBlock('OPTIONS', isFound, ierr, &
supportOpenClose=.true., blockRequired=.false.)
if(isFound) then
!
! -- Populate this%opts
Expand Down Expand Up @@ -98,7 +99,8 @@ subroutine namefile_init(this, filename, iout)
endif
!
! -- Read and set the input_files
call this%parser%GetBlock('PACKAGES', isFound, ierr)
call this%parser%GetBlock('PACKAGES', isFound, ierr, &
supportOpenClose=.true.)
if(isFound) then
!
! -- Populate this%input_files
Expand Down
3 changes: 2 additions & 1 deletion src/Utilities/Observation/Obs3.f90
Original file line number Diff line number Diff line change
Expand Up @@ -677,7 +677,8 @@ subroutine read_obs_options(this)
ierr = 0
!
! -- get BEGIN line of OPTIONS block
call this%parser%GetBlock('OPTIONS', found, ierr, blockRequired=.false.)
call this%parser%GetBlock('OPTIONS', found, ierr, &
supportOpenClose=.true., blockRequired=.false.)
if (ierr /= 0) then
! end of file
ermsg = 'End-of-file encountered while searching for' // &
Expand Down
3 changes: 2 additions & 1 deletion src/Utilities/OutputControl/OutputControl.f90
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,8 @@ subroutine read_options(this)
! ------------------------------------------------------------------------------
!
! -- get options block
call this%parser%GetBlock('OPTIONS', isfound, ierr, blockRequired=.false.)
call this%parser%GetBlock('OPTIONS', isfound, ierr, &
supportOpenClose=.true., blockRequired=.false.)
!
! -- parse options block if detected
if (isfound) then
Expand Down
6 changes: 4 additions & 2 deletions src/Utilities/TimeSeries/TimeArraySeries.f90
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ subroutine tas_init(this, fname, dis, iout, tasname, autoDeallocate)
ierr = 0
!
! -- get BEGIN line of ATTRIBUTES block
call this%parser%GetBlock('ATTRIBUTES', found, ierr)
call this%parser%GetBlock('ATTRIBUTES', found, ierr, &
supportOpenClose=.true.)
if (.not. found) then
ermsg = 'Error: Attributes block not found in file: ' // &
trim(fname)
Expand Down Expand Up @@ -417,7 +418,8 @@ logical function read_next_array(this)
call ConstructTimeArray(ta, this%dis)
! -- read a time and an array from the input file
! -- Get a TIME block and read the time
call this%parser%GetBlock('TIME', isFound, ierr, supportOpenClose=.true.)
call this%parser%GetBlock('TIME', isFound, ierr, &
supportOpenClose=.true.)
if (isFound) then
ta%taTime = this%parser%GetDouble()
! -- Read the array
Expand Down
3 changes: 2 additions & 1 deletion src/Utilities/TimeSeries/TimeSeries.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1228,7 +1228,8 @@ subroutine Initializetsfile(this, filename, iout, autoDeallocate)
ierr = 0
!
! -- get BEGIN line of ATTRIBUTES block
call this%parser%GetBlock('ATTRIBUTES', found, ierr)
call this%parser%GetBlock('ATTRIBUTES', found, ierr, &
supportOpenClose=.true.)
if (ierr /= 0) then
! end of file
ermsg = 'End-of-file encountered while searching for' // &
Expand Down

0 comments on commit b2fe994

Please sign in to comment.