39 character(len=*),
intent(in) :: sourcename
40 character(len=LENPACKAGENAME) :: sourcetype
41 character(len=LENPACKAGENAME) :: ext
45 sourcetype =
'MF6FILE'
59 character(len=*),
intent(in) :: component
60 character(len=LENCOMPONENTNAME) :: component_type
61 integer(I4B) :: i, ilen, idx
67 ilen = len_trim(component)
69 if (component(i:i) ==
'6' .or. component(i:i) ==
'-')
then
72 component_type(idx:idx) = component(i:i)
78 'IDP input error, unrecognized component: "'//trim(component)//
'"'
92 result(subcomponent_type)
93 character(len=*),
intent(in) :: component
94 character(len=*),
intent(in) :: subcomponent
95 character(len=LENCOMPONENTNAME) :: subcomponent_type
96 character(len=LENCOMPONENTNAME) :: component_type
97 integer(I4B) :: i, ilen, idx
100 subcomponent_type =
''
106 ilen = len_trim(subcomponent)
108 if (subcomponent(i:i) ==
'6' .or. subcomponent(i:i) ==
'-')
then
111 subcomponent_type(idx:idx) = subcomponent(i:i)
124 result(subcomponent_name)
126 character(len=*),
intent(in) :: component_type
127 character(len=*),
intent(in) :: subcomponent_type
128 character(len=*),
intent(in) :: sc_name
129 character(len=LENPACKAGENAME) :: subcomponent_name
130 subcomponent_name =
''
131 if (
idm_utl_type(component_type, subcomponent_type) .or. &
133 subcomponent_name = sc_name
135 subcomponent_name = subcomponent_type
149 character(len=*),
intent(in) :: pkg_type
150 integer(I4B),
intent(in) :: inst
151 character(len=LENPACKAGENAME) :: sc_name
152 write (sc_name,
'(a,i0)') trim(pkg_type)//
'-', inst
163 character(len=*),
intent(in) :: component
164 character(len=*),
intent(in) :: subcomponent
165 character(len=LENCOMPONENTNAME) :: subcomponent_type
166 logical(LGP) :: utl_type
167 integer(I4B) :: ilen, idx
168 ilen = len_trim(subcomponent)
169 subcomponent_type =
''
170 idx = index(subcomponent(1:ilen),
'-')
173 subcomponent_type = subcomponent(1:idx - 1)
174 else if (ilen > 0 .and. subcomponent(ilen:ilen) ==
'6')
then
176 subcomponent_type = subcomponent(1:ilen - 1)
178 subcomponent_type = subcomponent(1:ilen)
191 character(len=*),
intent(in) :: filename
192 character(len=LENPACKAGETYPE) :: ext
198 idx = index(filename,
'.', back=.true.)
200 ext = filename(idx + 1:len_trim(filename))
207 character(len=*),
intent(in) :: shape_string
208 integer(I4B),
dimension(:),
allocatable,
intent(inout) :: array_shape
209 character(len=*),
intent(in) :: memorypath
212 integer(I4B),
pointer :: int_ptr
213 character(len=16),
dimension(:),
allocatable :: array_shape_string
214 character(len=:),
allocatable :: shape_string_copy
217 shape_string_copy = trim(shape_string)//
' '
218 call parseline(shape_string_copy, ndim, array_shape_string)
219 allocate (array_shape(ndim))
223 call mem_setptr(int_ptr, array_shape_string(i), memorypath)
224 array_shape(i) = int_ptr
229 integer(I4B),
dimension(:),
intent(in) :: mshape
230 integer(I4B),
intent(out) :: nlay
231 integer(I4B),
dimension(:),
allocatable,
intent(out) :: layer_shape
239 allocate (layer_shape(1))
240 layer_shape(1) = mshape(1)
241 else if (ndim == 2)
then
243 allocate (layer_shape(1))
244 layer_shape(1) = mshape(2)
245 else if (ndim == 3)
then
247 allocate (layer_shape(2))
248 layer_shape(1) = mshape(3)
249 layer_shape(2) = mshape(2)
265 character(len=*),
intent(in) :: ftype
266 character(len=*),
intent(in) :: fname
267 character(len=*),
intent(in) :: model_mempath
268 character(len=*),
intent(in) :: dis_mempath
269 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(inout) :: model_shape
270 integer(I4B),
pointer :: ndim1
271 integer(I4B),
pointer :: ndim2
272 integer(I4B),
pointer :: ndim3
273 integer(I4B),
pointer :: ncelldim
274 integer(I4B),
pointer :: distype
275 integer(I4B) :: dim1_size, dim2_size, dim3_size, dis_type
285 call get_isize(
'NLAY', dis_mempath, dim1_size)
286 call get_isize(
'NROW', dis_mempath, dim2_size)
287 call get_isize(
'NCOL', dis_mempath, dim3_size)
289 if (dim1_size <= 0)
then
291 'Required input dimension "NLAY" not found.'
295 if (dim2_size <= 0)
then
297 'Required input dimension "NROW" not found.'
301 if (dim3_size <= 0)
then
303 'Required input dimension "NCOL" not found.'
307 if (dim1_size >= 1 .and. dim2_size >= 1 .and. dim3_size >= 1)
then
308 call mem_allocate(model_shape, 3,
'MODEL_SHAPE', model_mempath)
312 model_shape = [ndim1, ndim2, ndim3]
319 call get_isize(
'NROW', dis_mempath, dim1_size)
320 call get_isize(
'NCOL', dis_mempath, dim2_size)
322 if (dim1_size <= 0)
then
324 'Required input dimension "NROW" not found.'
328 if (dim2_size <= 0)
then
330 'Required input dimension "NCOL" not found.'
334 if (dim1_size >= 1 .and. dim2_size >= 1)
then
335 call mem_allocate(model_shape, 2,
'MODEL_SHAPE', model_mempath)
338 model_shape = [ndim1, ndim2]
345 call get_isize(
'NLAY', dis_mempath, dim1_size)
346 call get_isize(
'NCPL', dis_mempath, dim2_size)
348 if (dim1_size <= 0)
then
350 'Required input dimension "NLAY" not found.'
354 if (dim2_size <= 0)
then
356 'Required input dimension "NCPL" not found.'
360 if (dim1_size >= 1 .and. dim2_size >= 1)
then
361 call mem_allocate(model_shape, 2,
'MODEL_SHAPE', model_mempath)
364 model_shape = [ndim1, ndim2]
371 call get_isize(
'NODES', dis_mempath, dim1_size)
373 if (dim1_size <= 0)
then
375 'Required input dimension "NODES" not found.'
379 if (dim1_size >= 1)
then
380 call mem_allocate(model_shape, 1,
'MODEL_SHAPE', model_mempath)
382 model_shape = [ndim1]
386 case (
'DISU6',
'DISV1D6')
388 if (ftype ==
'DISU6')
then
390 else if (ftype ==
'DISV1D6')
then
394 call get_isize(
'NODES', dis_mempath, dim1_size)
396 if (dim1_size <= 0)
then
398 'Required input dimension "NODES" not found.'
403 call mem_allocate(model_shape, 1,
'MODEL_SHAPE', model_mempath)
405 model_shape = [ndim1]
407 errmsg =
'Unknown discretization type. IDM cannot set shape for "' &
415 ncelldim =
size(model_shape)
427 character(len=*) :: str
428 character(len=LINELENGTH) :: compare_str
431 findloop:
do i = 1,
size(array)
432 compare_str = array(i)
433 if (compare_str == str)
then
454 character(len=*),
intent(inout) :: filename
455 character(len=*),
intent(in) :: tagname
456 character(len=*),
intent(in) :: input_mempath
457 character(len=*),
intent(in) :: input_fname
458 logical(LGP) :: found
461 integer(I4B) :: isize
467 call get_isize(tagname, input_mempath, isize)
471 errmsg =
'Multiple FILEIN keywords detected for tag "'//trim(tagname)// &
472 '" in OPTIONS block. Only one entry allowed.'
477 call mem_setptr(fnames, tagname, input_mempath)
488 character(len=*),
intent(inout) :: mf6_name
489 integer(I4B),
intent(in) :: maxlen
490 character(len=*),
intent(in) :: name_type
491 character(len=LINELENGTH) :: input_str
496 input_str = input_name
497 ilen = len_trim(input_str)
498 if (ilen > maxlen)
then
499 write (
errmsg,
'(a,i0,a)') &
500 'Input name "'//trim(input_str)//
'" exceeds maximum allowed length (', &
501 maxlen,
') for '//trim(name_type)//
'.'
506 mf6_name = trim(input_str)
This module contains simulation constants.
integer(i4b), parameter linelength
maximum length of a standard line
integer(i4b), parameter lencomponentname
maximum length of a component name
integer(i4b), parameter lenpackagename
maximum length of the package name
integer(i4b), parameter lenpackagetype
maximum length of a package type (DIS6, SFR6, CSUB6, etc.)
@ disu
DISV6 discretization.
@ dis
DIS6 discretization.
@ disv2d
DISV2D6 discretization.
@ disv1d
DISV1D6 discretization.
@ dis2d
DIS2D6 discretization.
@ disv
DISU6 discretization.
@ disundef
undefined discretization
logical function, public idm_integrated(component, subcomponent)
logical function, public idm_component(component)
logical function, public idm_multi_package(component, subcomponent)
This module defines variable data types.
subroutine, public get_isize(name, mem_path, isize)
Get the number of elements for this variable.
This module contains simulation methods.
subroutine, public store_error(msg, terminate)
Store an error message.
subroutine, public store_error_filename(filename, terminate)
Store the erroring file name.
This module contains simulation variables.
character(len=maxcharlen) errmsg
error message string
This module contains the SourceCommonModule.
character(len=lenpackagename) function, public package_source_type(sourcename)
source identifier from model namfile FNAME array
subroutine, public get_layered_shape(mshape, nlay, layer_shape)
character(len=lencomponentname) function, public idm_subcomponent_type(component, subcomponent)
component from package or model type
character(len=lenpackagename) function, public idm_pkg_instance_name(pkg_type, inst)
default name for a multi-package instance
subroutine, public inlen_check(input_name, mf6_name, maxlen, name_type)
store an error for input exceeding internal name length
logical(lgp) function, public idm_utl_type(component, subcomponent)
is utility type
subroutine, public set_model_shape(ftype, fname, model_mempath, dis_mempath, model_shape)
routine for setting the model shape
character(len=lencomponentname) function, public idm_component_type(component)
component from package or model type
character(len=lenpackagetype) function, public file_ext(filename)
input file extension
integer(i4b) function, public ifind_charstr(array, str)
character(len=lenpackagename) function, public idm_subcomponent_name(component_type, subcomponent_type, sc_name)
model package subcomponent name
subroutine, public get_shape_from_string(shape_string, array_shape, memorypath)
logical(lgp) function, public filein_fname(filename, tagname, input_mempath, input_fname)
enforce and set a single input filename provided via FILEIN keyword
This class is used to store a single deferred-length character string. It was designed to work in an ...