Skip to content

Commit

Permalink
refactor(idm): remove component level FoundType and param sfac constr… (
Browse files Browse the repository at this point in the history
#1421)

* refactor(idm): remove component level FoundType and param sfac constructs

* update chd error to report head value that failed check

---------

Co-authored-by: mjreno <mreno@IGSAAA071L00066.gs.doi.net>
  • Loading branch information
mjreno and mjreno committed Nov 3, 2023
1 parent 688d45f commit b305820
Show file tree
Hide file tree
Showing 31 changed files with 60 additions and 552 deletions.
2 changes: 1 addition & 1 deletion src/Model/GroundWaterFlow/gwf3chd8.f90
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ subroutine chd_ck(this)
! -- accumulate errors
if (this%head_mult(i) < bt .and. this%icelltype(node) /= 0) then
call this%dis%noder_to_string(node, nodestr)
write (errmsg, fmt=fmtchderr) i, this%head(i), bt, trim(nodestr)
write (errmsg, fmt=fmtchderr) i, this%head_mult(i), bt, trim(nodestr)
call store_error(errmsg)
end if
end do
Expand Down
3 changes: 0 additions & 3 deletions src/Model/GroundWaterFlow/gwf3chd8idm.f90
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module GwfChdInputModule
public gwf_chd_block_definitions
public GwfChdParamFoundType
public gwf_chd_multi_package
public gwf_chd_aux_sfac_param

type GwfChdParamFoundType
logical :: auxiliary = .false.
Expand All @@ -35,8 +34,6 @@ module GwfChdInputModule

logical :: gwf_chd_multi_package = .true.

character(len=LENVARNAME) :: gwf_chd_aux_sfac_param = ''

type(InputParamDefinitionType), parameter :: &
gwfchd_auxiliary = InputParamDefinitionType &
( &
Expand Down
3 changes: 0 additions & 3 deletions src/Model/GroundWaterFlow/gwf3dis8idm.f90
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module GwfDisInputModule
public gwf_dis_block_definitions
public GwfDisParamFoundType
public gwf_dis_multi_package
public gwf_dis_aux_sfac_param

type GwfDisParamFoundType
logical :: length_units = .false.
Expand All @@ -29,8 +28,6 @@ module GwfDisInputModule

logical :: gwf_dis_multi_package = .false.

character(len=LENVARNAME) :: gwf_dis_aux_sfac_param = ''

type(InputParamDefinitionType), parameter :: &
gwfdis_length_units = InputParamDefinitionType &
( &
Expand Down
3 changes: 0 additions & 3 deletions src/Model/GroundWaterFlow/gwf3disu8idm.f90
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module GwfDisuInputModule
public gwf_disu_block_definitions
public GwfDisuParamFoundType
public gwf_disu_multi_package
public gwf_disu_aux_sfac_param

type GwfDisuParamFoundType
logical :: length_units = .false.
Expand Down Expand Up @@ -43,8 +42,6 @@ module GwfDisuInputModule

logical :: gwf_disu_multi_package = .false.

character(len=LENVARNAME) :: gwf_disu_aux_sfac_param = ''

type(InputParamDefinitionType), parameter :: &
gwfdisu_length_units = InputParamDefinitionType &
( &
Expand Down
3 changes: 0 additions & 3 deletions src/Model/GroundWaterFlow/gwf3disv8idm.f90
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module GwfDisvInputModule
public gwf_disv_block_definitions
public GwfDisvParamFoundType
public gwf_disv_multi_package
public gwf_disv_aux_sfac_param

type GwfDisvParamFoundType
logical :: length_units = .false.
Expand All @@ -35,8 +34,6 @@ module GwfDisvInputModule

logical :: gwf_disv_multi_package = .false.

character(len=LENVARNAME) :: gwf_disv_aux_sfac_param = ''

type(InputParamDefinitionType), parameter :: &
gwfdisv_length_units = InputParamDefinitionType &
( &
Expand Down
3 changes: 0 additions & 3 deletions src/Model/GroundWaterFlow/gwf3drn8idm.f90
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module GwfDrnInputModule
public gwf_drn_block_definitions
public GwfDrnParamFoundType
public gwf_drn_multi_package
public gwf_drn_aux_sfac_param

type GwfDrnParamFoundType
logical :: auxiliary = .false.
Expand Down Expand Up @@ -38,8 +37,6 @@ module GwfDrnInputModule

logical :: gwf_drn_multi_package = .true.

character(len=LENVARNAME) :: gwf_drn_aux_sfac_param = ''

type(InputParamDefinitionType), parameter :: &
gwfdrn_auxiliary = InputParamDefinitionType &
( &
Expand Down
39 changes: 21 additions & 18 deletions src/Model/GroundWaterFlow/gwf3evt8.f90
Original file line number Diff line number Diff line change
Expand Up @@ -217,25 +217,26 @@ subroutine evt_source_options(this)
! ------------------------------------------------------------------------------
! -- modules
use MemoryManagerExtModule, only: mem_set_value
use IdmGwfDfnSelectorModule, only: GwfParamFoundType
! -- dummy
class(EvtType), intent(inout) :: this
! -- local
type(GwfParamFoundType) :: found
logical(LGP) :: found_fixed_cell = .false.
logical(LGP) :: found_readasarrays = .false.
logical(LGP) :: found_surfratespec = .false.
! ------------------------------------------------------------------------------
!
! -- source common bound options
call this%BndExtType%source_options()
!
! -- update defaults with idm sourced values
call mem_set_value(this%fixed_cell, 'FIXED_CELL', &
this%input_mempath, found%fixed_cell)
this%input_mempath, found_fixed_cell)
call mem_set_value(this%read_as_arrays, 'READASARRAYS', &
this%input_mempath, found%readasarrays)
this%input_mempath, found_readasarrays)
call mem_set_value(this%surfratespecified, 'SURFRATESPEC', &
this%input_mempath, found%surfratespec)
this%input_mempath, found_surfratespec)
!
if (found%readasarrays) then
if (found_readasarrays) then
if (this%dis%supports_layers()) then
this%text = texta
else
Expand All @@ -246,7 +247,7 @@ subroutine evt_source_options(this)
end if
end if
!
if (found%readasarrays .and. found%surfratespec) then
if (found_readasarrays .and. found_surfratespec) then
if (this%read_as_arrays) then
errmsg = 'READASARRAYS option is not compatible with the'// &
' SURF_RATE_SPECIFIED option.'
Expand All @@ -256,13 +257,15 @@ subroutine evt_source_options(this)
end if
!
! -- log evt specific options
call this%evt_log_options(found)
call this%evt_log_options(found_fixed_cell, found_readasarrays, &
found_surfratespec)
!
! -- return
return
end subroutine evt_source_options

subroutine evt_log_options(this, found)
subroutine evt_log_options(this, found_fixed_cell, found_readasarrays, &
found_surfratespec)
! ******************************************************************************
! evt_log_options -- source options specific to EvtType
! ******************************************************************************
Expand All @@ -273,10 +276,11 @@ subroutine evt_log_options(this, found)
use MemoryManagerModule, only: mem_reallocate, mem_setptr
use MemoryManagerExtModule, only: mem_set_value
use CharacterStringModule, only: CharacterStringType
use IdmGwfDfnSelectorModule, only: GwfParamFoundType
! -- dummy
class(EvtType), intent(inout) :: this
type(GwfParamFoundType), intent(in) :: found
logical(LGP), intent(in) :: found_fixed_cell
logical(LGP), intent(in) :: found_readasarrays
logical(LGP), intent(in) :: found_surfratespec
! -- local
! -- formats
character(len=*), parameter :: fmtihact = &
Expand All @@ -295,15 +299,15 @@ subroutine evt_log_options(this, found)
write (this%iout, '(/1x,a)') 'PROCESSING '//trim(adjustl(this%text)) &
//' OPTIONS'
!
if (found%fixed_cell) then
if (found_fixed_cell) then
write (this%iout, fmtfixedcell)
end if
!
if (found%readasarrays) then
if (found_readasarrays) then
write (this%iout, fmtreadasarrays)
end if
!
if (found%surfratespec) then
if (found_surfratespec) then
write (this%iout, fmtsrs)
end if
!
Expand All @@ -325,11 +329,10 @@ subroutine evt_source_dimensions(this)
! ------------------------------------------------------------------------------
! -- modules
use MemoryManagerExtModule, only: mem_set_value
use GwfEvtInputModule, only: GwfEvtParamFoundType
! -- dummy
class(EvtType), intent(inout) :: this
! -- local
type(GwfEvtParamFoundType) :: found
logical(LGP) :: found_nseg = .false.
! -- format
character(len=*), parameter :: fmtnsegerr = &
&"('Error: In EVT, NSEG must be > 0 but is specified as ',i0)"
Expand Down Expand Up @@ -359,9 +362,9 @@ subroutine evt_source_dimensions(this)
//' DIMENSIONS'
!
! -- update defaults with idm sourced values
call mem_set_value(this%nseg, 'NSEG', this%input_mempath, found%nseg)
call mem_set_value(this%nseg, 'NSEG', this%input_mempath, found_nseg)
!
if (found%nseg) then
if (found_nseg) then
!
write (this%iout, '(4x,a,i0)') 'NSEG = ', this%nseg
!
Expand Down
3 changes: 0 additions & 3 deletions src/Model/GroundWaterFlow/gwf3evt8idm.f90
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module GwfEvtInputModule
public gwf_evt_block_definitions
public GwfEvtParamFoundType
public gwf_evt_multi_package
public gwf_evt_aux_sfac_param

type GwfEvtParamFoundType
logical :: fixed_cell = .false.
Expand Down Expand Up @@ -42,8 +41,6 @@ module GwfEvtInputModule

logical :: gwf_evt_multi_package = .true.

character(len=LENVARNAME) :: gwf_evt_aux_sfac_param = ''

type(InputParamDefinitionType), parameter :: &
gwfevt_fixed_cell = InputParamDefinitionType &
( &
Expand Down
3 changes: 0 additions & 3 deletions src/Model/GroundWaterFlow/gwf3evta8idm.f90
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module GwfEvtaInputModule
public gwf_evta_block_definitions
public GwfEvtaParamFoundType
public gwf_evta_multi_package
public gwf_evta_aux_sfac_param

type GwfEvtaParamFoundType
logical :: readasarrays = .false.
Expand All @@ -35,8 +34,6 @@ module GwfEvtaInputModule

logical :: gwf_evta_multi_package = .true.

character(len=LENVARNAME) :: gwf_evta_aux_sfac_param = ''

type(InputParamDefinitionType), parameter :: &
gwfevta_readasarrays = InputParamDefinitionType &
( &
Expand Down
3 changes: 0 additions & 3 deletions src/Model/GroundWaterFlow/gwf3ghb8idm.f90
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module GwfGhbInputModule
public gwf_ghb_block_definitions
public GwfGhbParamFoundType
public gwf_ghb_multi_package
public gwf_ghb_aux_sfac_param

type GwfGhbParamFoundType
logical :: auxiliary = .false.
Expand All @@ -36,8 +35,6 @@ module GwfGhbInputModule

logical :: gwf_ghb_multi_package = .true.

character(len=LENVARNAME) :: gwf_ghb_aux_sfac_param = ''

type(InputParamDefinitionType), parameter :: &
gwfghb_auxiliary = InputParamDefinitionType &
( &
Expand Down
3 changes: 0 additions & 3 deletions src/Model/GroundWaterFlow/gwf3idm.f90
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module GwfNamInputModule
public gwf_nam_block_definitions
public GwfNamParamFoundType
public gwf_nam_multi_package
public gwf_nam_aux_sfac_param

type GwfNamParamFoundType
logical :: list = .false.
Expand All @@ -26,8 +25,6 @@ module GwfNamInputModule

logical :: gwf_nam_multi_package = .false.

character(len=LENVARNAME) :: gwf_nam_aux_sfac_param = ''

type(InputParamDefinitionType), parameter :: &
gwfnam_list = InputParamDefinitionType &
( &
Expand Down
3 changes: 0 additions & 3 deletions src/Model/GroundWaterFlow/gwf3npf8idm.f90
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module GwfNpfInputModule
public gwf_npf_block_definitions
public GwfNpfParamFoundType
public gwf_npf_multi_package
public gwf_npf_aux_sfac_param

type GwfNpfParamFoundType
logical :: ipakcb = .false.
Expand Down Expand Up @@ -53,8 +52,6 @@ module GwfNpfInputModule

logical :: gwf_npf_multi_package = .false.

character(len=LENVARNAME) :: gwf_npf_aux_sfac_param = ''

type(InputParamDefinitionType), parameter :: &
gwfnpf_ipakcb = InputParamDefinitionType &
( &
Expand Down
22 changes: 11 additions & 11 deletions src/Model/GroundWaterFlow/gwf3rch8.f90
Original file line number Diff line number Diff line change
Expand Up @@ -164,24 +164,24 @@ subroutine rch_source_options(this)
! SPECIFICATIONS:
! ------------------------------------------------------------------------------
use MemoryManagerExtModule, only: mem_set_value
use IdmGwfDfnSelectorModule, only: GwfParamFoundType
implicit none
! -- dummy
class(RchType), intent(inout) :: this
! -- local
type(GwfParamFoundType) :: found
logical(LGP) :: found_fixed_cell = .false.
logical(LGP) :: found_readasarrays = .false.
! ------------------------------------------------------------------------------
!
! -- source common bound options
call this%BndExtType%source_options()
!
! -- update defaults with idm sourced values
call mem_set_value(this%fixed_cell, 'FIXED_CELL', this%input_mempath, &
found%fixed_cell)
found_fixed_cell)
call mem_set_value(this%read_as_arrays, 'READASARRAYS', this%input_mempath, &
found%readasarrays)
found_readasarrays)
!
if (found%readasarrays) then
if (found_readasarrays) then
if (this%dis%supports_layers()) then
this%text = texta
else
Expand All @@ -193,24 +193,24 @@ subroutine rch_source_options(this)
end if
!
! -- log rch params
call this%log_rch_options(found)
call this%log_rch_options(found_fixed_cell, found_readasarrays)
!
! -- return
return
end subroutine rch_source_options

subroutine log_rch_options(this, found)
subroutine log_rch_options(this, found_fixed_cell, found_readasarrays)
! ******************************************************************************
! log_rch_options -- log options specific to RchType
! ******************************************************************************
!
! SPECIFICATIONS:
! ------------------------------------------------------------------------------
use IdmGwfDfnSelectorModule, only: GwfParamFoundType
implicit none
! -- dummy
class(RchType), intent(inout) :: this
type(GwfParamFoundType), intent(in) :: found
logical(LGP), intent(in) :: found_fixed_cell
logical(LGP), intent(in) :: found_readasarrays
! -- local
! -- formats
character(len=*), parameter :: fmtfixedcell = &
Expand All @@ -223,11 +223,11 @@ subroutine log_rch_options(this, found)
write (this%iout, '(/1x,a)') 'PROCESSING '//trim(adjustl(this%text)) &
//' OPTIONS'
!
if (found%fixed_cell) then
if (found_fixed_cell) then
write (this%iout, fmtfixedcell)
end if
!
if (found%readasarrays) then
if (found_readasarrays) then
write (this%iout, fmtreadasarrays)
end if
!
Expand Down
3 changes: 0 additions & 3 deletions src/Model/GroundWaterFlow/gwf3rch8idm.f90
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module GwfRchInputModule
public gwf_rch_block_definitions
public GwfRchParamFoundType
public gwf_rch_multi_package
public gwf_rch_aux_sfac_param

type GwfRchParamFoundType
logical :: fixed_cell = .false.
Expand All @@ -35,8 +34,6 @@ module GwfRchInputModule

logical :: gwf_rch_multi_package = .true.

character(len=LENVARNAME) :: gwf_rch_aux_sfac_param = ''

type(InputParamDefinitionType), parameter :: &
gwfrch_fixed_cell = InputParamDefinitionType &
( &
Expand Down
Loading

0 comments on commit b305820

Please sign in to comment.