MODFLOW 6  version 6.5.0.dev2
MODFLOW 6 Code Documentation
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 gwfmodule, only: gwf_nbasepkg, gwf_nmultipkg, &
15  use gwtmodule, only: gwt_nbasepkg, gwt_nmultipkg, &
17  use gwemodule, only: gwe_nbasepkg, gwe_nmultipkg, &
19  use swfmodule, only: swf_nbasepkg, swf_nmultipkg, &
21  use prtmodule, only: prt_nbasepkg, prt_nmultipkg, &
23 
24  implicit none
25 
26  private
27  public :: supported_model_packages
28  public :: multi_package_type
29 
30 contains
31 
32  !> @brief set supported package types for model
33  !!
34  !! Allocate a list of package types supported
35  !! by the model. Base packages should be listed
36  !! first as list determines load order.
37  !!
38  !<
39  subroutine supported_model_packages(mtype, pkgtypes, numpkgs)
40  ! -- modules
41  ! -- dummy
42  character(len=LENFTYPE), intent(in) :: mtype
43  character(len=LENPACKAGETYPE), dimension(:), allocatable, &
44  intent(inout) :: pkgtypes
45  integer(I4B), intent(inout) :: numpkgs
46  ! -- local
47  !
48  select case (mtype)
49  case ('GWF6')
50  numpkgs = gwf_nbasepkg + gwf_nmultipkg
51  allocate (pkgtypes(numpkgs))
52  pkgtypes = [gwf_basepkg, gwf_multipkg]
53  case ('GWT6')
54  numpkgs = gwt_nbasepkg + gwt_nmultipkg
55  allocate (pkgtypes(numpkgs))
56  pkgtypes = [gwt_basepkg, gwt_multipkg]
57  case ('GWE6')
58  numpkgs = gwe_nbasepkg + gwe_nmultipkg
59  allocate (pkgtypes(numpkgs))
60  pkgtypes = [gwe_basepkg, gwe_multipkg]
61  case ('PRT6')
62  numpkgs = prt_nbasepkg + prt_nmultipkg
63  allocate (pkgtypes(numpkgs))
64  pkgtypes = [prt_basepkg, prt_multipkg]
65  case ('SWF6')
66  numpkgs = swf_nbasepkg + swf_nmultipkg
67  allocate (pkgtypes(numpkgs))
68  pkgtypes = [swf_basepkg, swf_multipkg]
69  case default
70  end select
71  !
72  ! -- return
73  return
74  end subroutine supported_model_packages
75 
76  !> @brief Is the package multi-instance
77  !<
78  function multi_package_type(mtype_component, ptype_component, pkgtype) &
79  result(multi_package)
80  ! -- modules
81  ! -- dummy
82  character(len=LENFTYPE), intent(in) :: mtype_component
83  character(len=LENFTYPE), intent(in) :: ptype_component
84  character(len=LENFTYPE), intent(in) :: pkgtype
85  ! -- return
86  logical(LGP) :: multi_package
87  ! -- local
88  integer(I4B) :: n
89  !
90  multi_package = .false.
91  !
92  select case (mtype_component)
93  case ('GWF')
94  do n = 1, gwf_nmultipkg
95  if (gwf_multipkg(n) == pkgtype) then
96  multi_package = .true.
97  exit
98  end if
99  end do
100  !
101  case ('GWT')
102  do n = 1, gwt_nmultipkg
103  if (gwt_multipkg(n) == pkgtype) then
104  multi_package = .true.
105  exit
106  end if
107  end do
108  !
109  case ('GWE')
110  do n = 1, gwe_nmultipkg
111  if (gwe_multipkg(n) == pkgtype) then
112  multi_package = .true.
113  exit
114  end if
115  end do
116  !
117  case ('PRT')
118  do n = 1, prt_nmultipkg
119  if (prt_multipkg(n) == pkgtype) then
120  multi_package = .true.
121  exit
122  end if
123  end do
124  !
125  case default
126  end select
127  !
128  ! -- return
129  return
130  end function multi_package_type
131 
132 end module modelpackageinputmodule
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:37
integer(i4b), parameter lenftype
maximum length of a package type (DIS, WEL, OC, etc.)
Definition: Constants.f90:38
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:71
character(len=lenpackagetype), dimension(gwt_nmultipkg), public gwt_multipkg
Definition: gwt.f90:85
character(len=lenpackagetype), dimension(gwt_nbasepkg), public gwt_basepkg
Definition: gwt.f90:72
integer(i4b), parameter, public gwt_nmultipkg
GWT multi package array descriptors.
Definition: gwt.f90:84
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
Definition: prt.f90:1
character(len=lenpackagetype), dimension(prt_nmultipkg), public prt_multipkg
Definition: prt.f90:112
character(len=lenpackagetype), dimension(prt_nbasepkg), public prt_basepkg
Definition: prt.f90:98
integer(i4b), parameter, public prt_nmultipkg
PRT multi package array descriptors.
Definition: prt.f90:111
integer(i4b), parameter, public prt_nbasepkg
PRT base package array descriptors.
Definition: prt.f90:97
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
Stream Network Flow (SWF) Module.
Definition: swf.f90:38
character(len=lenpackagetype), dimension(swf_nbasepkg), public swf_basepkg
Definition: swf.f90:118
character(len=lenpackagetype), dimension(swf_nmultipkg), public swf_multipkg
Definition: swf.f90:129
integer(i4b), parameter, public swf_nbasepkg
SWF base package array descriptors.
Definition: swf.f90:117
integer(i4b), parameter, public swf_nmultipkg
SWF multi package array descriptors.
Definition: swf.f90:128