MODFLOW 6  version 6.6.0.dev0
USGS Modular Hydrologic Model
ModelPackageInput.f90
Go to the documentation of this file.
1 !> @brief This module contains the ModelPackageInputModule
2 !!
3 !! Add an input model type to routines in this module
4 !! to integrate the Model with IDM.
5 !!
6 !<
8 
9  use kindmodule, only: dp, i4b, lgp
10  use simvariablesmodule, only: errmsg
13  use chfmodule, only: chf_nbasepkg, chf_nmultipkg, &
15  use gwemodule, only: gwe_nbasepkg, gwe_nmultipkg, &
17  use gwfmodule, only: gwf_nbasepkg, gwf_nmultipkg, &
19  use gwtmodule, only: gwt_nbasepkg, gwt_nmultipkg, &
21  use olfmodule, only: olf_nbasepkg, olf_nmultipkg, &
23  use prtmodule, only: prt_nbasepkg, prt_nmultipkg, &
25 
26  implicit none
27 
28  private
29  public :: supported_model_packages
30  public :: multi_package_type
31 
32 contains
33 
34  !> @brief set supported package types for model
35  !!
36  !! Allocate a list of package types supported
37  !! by the model. Base packages should be listed
38  !! first as list determines load order.
39  !!
40  !<
41  subroutine supported_model_packages(mtype, pkgtypes, numpkgs)
42  ! -- modules
43  ! -- dummy
44  character(len=LENFTYPE), intent(in) :: mtype
45  character(len=LENPACKAGETYPE), dimension(:), allocatable, &
46  intent(inout) :: pkgtypes
47  integer(I4B), intent(inout) :: numpkgs
48  ! -- local
49  !
50  select case (mtype)
51  case ('CHF6')
52  numpkgs = chf_nbasepkg + chf_nmultipkg
53  allocate (pkgtypes(numpkgs))
54  pkgtypes = [chf_basepkg, chf_multipkg]
55  case ('GWE6')
56  numpkgs = gwe_nbasepkg + gwe_nmultipkg
57  allocate (pkgtypes(numpkgs))
58  pkgtypes = [gwe_basepkg, gwe_multipkg]
59  case ('GWF6')
60  numpkgs = gwf_nbasepkg + gwf_nmultipkg
61  allocate (pkgtypes(numpkgs))
62  pkgtypes = [gwf_basepkg, gwf_multipkg]
63  case ('GWT6')
64  numpkgs = gwt_nbasepkg + gwt_nmultipkg
65  allocate (pkgtypes(numpkgs))
66  pkgtypes = [gwt_basepkg, gwt_multipkg]
67  case ('OLF6')
68  numpkgs = olf_nbasepkg + olf_nmultipkg
69  allocate (pkgtypes(numpkgs))
70  pkgtypes = [olf_basepkg, olf_multipkg]
71  case ('PRT6')
72  numpkgs = prt_nbasepkg + prt_nmultipkg
73  allocate (pkgtypes(numpkgs))
74  pkgtypes = [prt_basepkg, prt_multipkg]
75  case default
76  end select
77  end subroutine supported_model_packages
78 
79  !> @brief Is the package multi-instance
80  !<
81  function multi_package_type(mtype_component, ptype_component, pkgtype) &
82  result(multi_package)
83  ! -- modules
84  ! -- dummy
85  character(len=LENFTYPE), intent(in) :: mtype_component
86  character(len=LENFTYPE), intent(in) :: ptype_component
87  character(len=LENFTYPE), intent(in) :: pkgtype
88  ! -- return
89  logical(LGP) :: multi_package
90  ! -- local
91  integer(I4B) :: n
92  !
93  multi_package = .false.
94  !
95  select case (mtype_component)
96  case ('CHF')
97  do n = 1, chf_nmultipkg
98  if (chf_multipkg(n) == pkgtype) then
99  multi_package = .true.
100  exit
101  end if
102  end do
103  !
104  case ('GWE')
105  do n = 1, gwe_nmultipkg
106  if (gwe_multipkg(n) == pkgtype) then
107  multi_package = .true.
108  exit
109  end if
110  end do
111  !
112  case ('GWF')
113  do n = 1, gwf_nmultipkg
114  if (gwf_multipkg(n) == pkgtype) then
115  multi_package = .true.
116  exit
117  end if
118  end do
119  !
120  case ('GWT')
121  do n = 1, gwt_nmultipkg
122  if (gwt_multipkg(n) == pkgtype) then
123  multi_package = .true.
124  exit
125  end if
126  end do
127  !
128  case ('OLF')
129  do n = 1, olf_nmultipkg
130  if (olf_multipkg(n) == pkgtype) then
131  multi_package = .true.
132  exit
133  end if
134  end do
135  !
136  case ('PRT')
137  do n = 1, prt_nmultipkg
138  if (prt_multipkg(n) == pkgtype) then
139  multi_package = .true.
140  exit
141  end if
142  end do
143  !
144  case default
145  end select
146  end function multi_package_type
147 
148 end module modelpackageinputmodule
Channel Flow (CHF) Module.
Definition: chf.f90:3
integer(i4b), parameter, public chf_nbasepkg
CHF base package array descriptors.
Definition: chf.f90:32
character(len=lenpackagetype), dimension(chf_nmultipkg), public chf_multipkg
Definition: chf.f90:43
character(len=lenpackagetype), dimension(chf_nbasepkg), public chf_basepkg
candidates for input and these will be loaded in the order specified.
Definition: chf.f90:33
integer(i4b), parameter, public chf_nmultipkg
CHF multi package array descriptors.
Definition: chf.f90:42
This module contains simulation constants.
Definition: Constants.f90:9
integer(i4b), parameter lenpackagetype
maximum length of a package type (DIS6, SFR6, CSUB6, etc.)
Definition: Constants.f90:38
integer(i4b), parameter lenftype
maximum length of a package type (DIS, WEL, OC, etc.)
Definition: Constants.f90:39
Definition: gwe.f90:3
character(len=lenpackagetype), dimension(gwe_nmultipkg), public gwe_multipkg
Definition: gwe.f90:83
integer(i4b), parameter, public gwe_nbasepkg
GWE base package array descriptors.
Definition: gwe.f90:69
character(len=lenpackagetype), dimension(gwe_nbasepkg), public gwe_basepkg
Definition: gwe.f90:70
integer(i4b), parameter, public gwe_nmultipkg
GWE multi package array descriptors.
Definition: gwe.f90:82
Definition: gwf.f90:1
integer(i4b), parameter, public gwf_nmultipkg
GWF multi package array descriptors.
Definition: gwf.f90:119
character(len=lenpackagetype), dimension(gwf_nmultipkg), public gwf_multipkg
Definition: gwf.f90:120
integer(i4b), parameter, public gwf_nbasepkg
GWF base package array descriptors.
Definition: gwf.f90:106
character(len=lenpackagetype), dimension(gwf_nbasepkg), public gwf_basepkg
Definition: gwf.f90:107
Definition: gwt.f90:8
integer(i4b), parameter, public gwt_nbasepkg
GWT base package array descriptors.
Definition: gwt.f90:74
character(len=lenpackagetype), dimension(gwt_nmultipkg), public gwt_multipkg
Definition: gwt.f90:88
character(len=lenpackagetype), dimension(gwt_nbasepkg), public gwt_basepkg
Definition: gwt.f90:75
integer(i4b), parameter, public gwt_nmultipkg
GWT multi package array descriptors.
Definition: gwt.f90:87
This module defines variable data types.
Definition: kind.f90:8
This module contains the ModelPackageInputModule.
logical(lgp) function, public multi_package_type(mtype_component, ptype_component, pkgtype)
Is the package multi-instance.
subroutine, public supported_model_packages(mtype, pkgtypes, numpkgs)
set supported package types for model
Channel Flow (OLF) Module.
Definition: olf.f90:3
integer(i4b), parameter, public olf_nmultipkg
OLF multi package array descriptors.
Definition: olf.f90:42
character(len=lenpackagetype), dimension(olf_nbasepkg), public olf_basepkg
candidates for input and these will be loaded in the order specified.
Definition: olf.f90:33
character(len=lenpackagetype), dimension(olf_nmultipkg), public olf_multipkg
Definition: olf.f90:43
integer(i4b), parameter, public olf_nbasepkg
OLF base package array descriptors.
Definition: olf.f90:32
Definition: prt.f90:1
character(len=lenpackagetype), dimension(prt_nmultipkg), public prt_multipkg
Definition: prt.f90:108
character(len=lenpackagetype), dimension(prt_nbasepkg), public prt_basepkg
Definition: prt.f90:94
integer(i4b), parameter, public prt_nmultipkg
PRT multi package array descriptors.
Definition: prt.f90:107
integer(i4b), parameter, public prt_nbasepkg
PRT base package array descriptors.
Definition: prt.f90:93
This module contains simulation methods.
Definition: Sim.f90:10
subroutine, public store_error(msg, terminate)
Store an error message.
Definition: Sim.f90:92
subroutine, public store_error_filename(filename, terminate)
Store the erroring file name.
Definition: Sim.f90:203
This module contains simulation variables.
Definition: SimVariables.f90:9
character(len=maxcharlen) errmsg
error message string