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)
264 character(len=*),
intent(in) :: ftype
265 character(len=*),
intent(in) :: fname
266 character(len=*),
intent(in) :: model_mempath
267 character(len=*),
intent(in) :: dis_mempath
268 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(inout) :: model_shape
269 integer(I4B),
pointer :: ndim1
270 integer(I4B),
pointer :: ndim2
271 integer(I4B),
pointer :: ndim3
272 integer(I4B),
pointer :: ncelldim
273 integer(I4B),
pointer :: distype
274 integer(I4B) :: dim1_size, dim2_size, dim3_size, dis_type
284 call get_isize(
'NLAY', dis_mempath, dim1_size)
285 call get_isize(
'NROW', dis_mempath, dim2_size)
286 call get_isize(
'NCOL', dis_mempath, dim3_size)
288 if (dim1_size <= 0)
then
290 'Required input dimension "NLAY" not found.'
294 if (dim2_size <= 0)
then
296 'Required input dimension "NROW" not found.'
300 if (dim3_size <= 0)
then
302 'Required input dimension "NCOL" not found.'
306 if (dim1_size >= 1 .and. dim2_size >= 1 .and. dim3_size >= 1)
then
307 call mem_allocate(model_shape, 3,
'MODEL_SHAPE', model_mempath)
311 model_shape = [ndim1, ndim2, ndim3]
318 call get_isize(
'NROW', dis_mempath, dim1_size)
319 call get_isize(
'NCOL', dis_mempath, dim2_size)
321 if (dim1_size <= 0)
then
323 'Required input dimension "NROW" not found.'
327 if (dim2_size <= 0)
then
329 'Required input dimension "NCOL" not found.'
333 if (dim1_size >= 1 .and. dim2_size >= 1)
then
334 call mem_allocate(model_shape, 2,
'MODEL_SHAPE', model_mempath)
337 model_shape = [ndim1, ndim2]
344 call get_isize(
'NLAY', dis_mempath, dim1_size)
345 call get_isize(
'NCPL', dis_mempath, dim2_size)
347 if (dim1_size <= 0)
then
349 'Required input dimension "NLAY" not found.'
353 if (dim2_size <= 0)
then
355 'Required input dimension "NCPL" not found.'
359 if (dim1_size >= 1 .and. dim2_size >= 1)
then
360 call mem_allocate(model_shape, 2,
'MODEL_SHAPE', model_mempath)
363 model_shape = [ndim1, ndim2]
368 call get_isize(
'NODES', dis_mempath, dim1_size)
370 if (dim1_size <= 0)
then
372 'Required input dimension "NODES" not found.'
376 if (dim1_size >= 1)
then
377 call mem_allocate(model_shape, 1,
'MODEL_SHAPE', model_mempath)
379 model_shape = [ndim1]
383 case (
'DISU6',
'DISV1D6')
385 if (ftype ==
'DISU6')
then
387 else if (ftype ==
'DISV1D6')
then
391 call get_isize(
'NODES', dis_mempath, dim1_size)
393 if (dim1_size <= 0)
then
395 'Required input dimension "NODES" not found.'
400 call mem_allocate(model_shape, 1,
'MODEL_SHAPE', model_mempath)
402 model_shape = [ndim1]
404 errmsg =
'Unknown discretization type. IDM cannot set shape for "' &
412 ncelldim =
size(model_shape)
424 character(len=*) :: str
425 character(len=LINELENGTH) :: compare_str
428 findloop:
do i = 1,
size(array)
429 compare_str = array(i)
430 if (compare_str == str)
then
451 character(len=*),
intent(inout) :: filename
452 character(len=*),
intent(in) :: tagname
453 character(len=*),
intent(in) :: input_mempath
454 character(len=*),
intent(in) :: input_fname
455 logical(LGP) :: found
458 integer(I4B) :: isize
464 call get_isize(tagname, input_mempath, isize)
468 errmsg =
'Multiple FILEIN keywords detected for tag "'//trim(tagname)// &
469 '" in OPTIONS block. Only one entry allowed.'
474 call mem_setptr(fnames, tagname, input_mempath)
485 character(len=*),
intent(inout) :: mf6_name
486 integer(I4B),
intent(in) :: maxlen
487 character(len=*),
intent(in) :: name_type
488 character(len=LINELENGTH) :: input_str
493 input_str = input_name
494 ilen = len_trim(input_str)
495 if (ilen > maxlen)
then
496 write (
errmsg,
'(a,i0,a)') &
497 'Input name "'//trim(input_str)//
'" exceeds maximum allowed length (', &
498 maxlen,
') for '//trim(name_type)//
'.'
503 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.
@ 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)
@ brief 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)
subroutine, public get_shape_from_string(shape_string, array_shape, memoryPath)
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
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 ...