37 character(len=*),
intent(in) :: sourcename
38 character(len=LENPACKAGENAME) :: sourcetype
39 character(len=LENPACKAGENAME) :: ext
43 sourcetype =
'MF6FILE'
57 character(len=*),
intent(in) :: component
58 character(len=LENCOMPONENTNAME) :: component_type
59 integer(I4B) :: i, ilen, idx
65 ilen = len_trim(component)
67 if (component(i:i) ==
'6' .or. component(i:i) ==
'-')
then
70 component_type(idx:idx) = component(i:i)
76 'IDP input error, unrecognized component: "'//trim(component)//
'"'
90 result(subcomponent_type)
91 character(len=*),
intent(in) :: component
92 character(len=*),
intent(in) :: subcomponent
93 character(len=LENCOMPONENTNAME) :: subcomponent_type
94 character(len=LENCOMPONENTNAME) :: component_type
95 integer(I4B) :: i, ilen, idx
98 subcomponent_type =
''
104 ilen = len_trim(subcomponent)
106 if (subcomponent(i:i) ==
'6' .or. subcomponent(i:i) ==
'-')
then
109 subcomponent_type(idx:idx) = subcomponent(i:i)
122 result(subcomponent_name)
124 character(len=*),
intent(in) :: component_type
125 character(len=*),
intent(in) :: subcomponent_type
126 character(len=*),
intent(in) :: sc_name
127 character(len=LENPACKAGENAME) :: subcomponent_name
128 subcomponent_name =
''
130 subcomponent_name = sc_name
132 subcomponent_name = subcomponent_type
144 character(len=*),
intent(in) :: filename
145 character(len=LENPACKAGETYPE) :: ext
151 idx = index(filename,
'.', back=.true.)
153 ext = filename(idx + 1:len_trim(filename))
160 character(len=*),
intent(in) :: shape_string
161 integer(I4B),
dimension(:),
allocatable,
intent(inout) :: array_shape
162 character(len=*),
intent(in) :: memorypath
165 integer(I4B),
pointer :: int_ptr
166 character(len=16),
dimension(:),
allocatable :: array_shape_string
167 character(len=:),
allocatable :: shape_string_copy
170 shape_string_copy = trim(shape_string)//
' '
171 call parseline(shape_string_copy, ndim, array_shape_string)
172 allocate (array_shape(ndim))
176 call mem_setptr(int_ptr, array_shape_string(i), memorypath)
177 array_shape(i) = int_ptr
182 integer(I4B),
dimension(:),
intent(in) :: mshape
183 integer(I4B),
intent(out) :: nlay
184 integer(I4B),
dimension(:),
allocatable,
intent(out) :: layer_shape
192 allocate (layer_shape(1))
193 layer_shape(1) = mshape(1)
194 else if (ndim == 2)
then
196 allocate (layer_shape(1))
197 layer_shape(1) = mshape(2)
198 else if (ndim == 3)
then
200 allocate (layer_shape(2))
201 layer_shape(1) = mshape(3)
202 layer_shape(2) = mshape(2)
217 character(len=*),
intent(in) :: ftype
218 character(len=*),
intent(in) :: fname
219 character(len=*),
intent(in) :: model_mempath
220 character(len=*),
intent(in) :: dis_mempath
221 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(inout) :: model_shape
222 integer(I4B),
pointer :: ndim1
223 integer(I4B),
pointer :: ndim2
224 integer(I4B),
pointer :: ndim3
225 integer(I4B),
pointer :: ncelldim
226 integer(I4B),
pointer :: distype
227 integer(I4B) :: dim1_size, dim2_size, dim3_size, dis_type
237 call get_isize(
'NLAY', dis_mempath, dim1_size)
238 call get_isize(
'NROW', dis_mempath, dim2_size)
239 call get_isize(
'NCOL', dis_mempath, dim3_size)
241 if (dim1_size <= 0)
then
243 'Required input dimension "NLAY" not found.'
247 if (dim2_size <= 0)
then
249 'Required input dimension "NROW" not found.'
253 if (dim3_size <= 0)
then
255 'Required input dimension "NCOL" not found.'
259 if (dim1_size >= 1 .and. dim2_size >= 1 .and. dim3_size >= 1)
then
260 call mem_allocate(model_shape, 3,
'MODEL_SHAPE', model_mempath)
264 model_shape = [ndim1, ndim2, ndim3]
271 call get_isize(
'NROW', dis_mempath, dim1_size)
272 call get_isize(
'NCOL', dis_mempath, dim2_size)
274 if (dim1_size <= 0)
then
276 'Required input dimension "NROW" not found.'
280 if (dim2_size <= 0)
then
282 'Required input dimension "NCOL" not found.'
286 if (dim1_size >= 1 .and. dim2_size >= 1)
then
287 call mem_allocate(model_shape, 2,
'MODEL_SHAPE', model_mempath)
290 model_shape = [ndim1, ndim2]
297 call get_isize(
'NLAY', dis_mempath, dim1_size)
298 call get_isize(
'NCPL', dis_mempath, dim2_size)
300 if (dim1_size <= 0)
then
302 'Required input dimension "NLAY" not found.'
306 if (dim2_size <= 0)
then
308 'Required input dimension "NCPL" not found.'
312 if (dim1_size >= 1 .and. dim2_size >= 1)
then
313 call mem_allocate(model_shape, 2,
'MODEL_SHAPE', model_mempath)
316 model_shape = [ndim1, ndim2]
321 call get_isize(
'NODES', dis_mempath, dim1_size)
323 if (dim1_size <= 0)
then
325 'Required input dimension "NODES" not found.'
329 if (dim1_size >= 1)
then
330 call mem_allocate(model_shape, 1,
'MODEL_SHAPE', model_mempath)
332 model_shape = [ndim1]
336 case (
'DISU6',
'DISV1D6')
338 if (ftype ==
'DISU6')
then
340 else if (ftype ==
'DISV1D6')
then
344 call get_isize(
'NODES', dis_mempath, dim1_size)
346 if (dim1_size <= 0)
then
348 'Required input dimension "NODES" not found.'
353 call mem_allocate(model_shape, 1,
'MODEL_SHAPE', model_mempath)
355 model_shape = [ndim1]
357 errmsg =
'Unknown discretization type. IDM cannot set shape for "' &
365 ncelldim =
size(model_shape)
377 character(len=*) :: str
378 character(len=LINELENGTH) :: compare_str
381 findloop:
do i = 1,
size(array)
382 compare_str = array(i)
383 if (compare_str == str)
then
404 character(len=*),
intent(inout) :: filename
405 character(len=*),
intent(in) :: tagname
406 character(len=*),
intent(in) :: input_mempath
407 character(len=*),
intent(in) :: input_fname
408 logical(LGP) :: found
411 integer(I4B) :: isize
417 call get_isize(tagname, input_mempath, isize)
421 errmsg =
'Multiple FILEIN keywords detected for tag "'//trim(tagname)// &
422 '" in OPTIONS block. Only one entry allowed.'
427 call mem_setptr(fnames, tagname, input_mempath)
438 character(len=*),
intent(inout) :: mf6_name
439 integer(I4B),
intent(in) :: maxlen
440 character(len=*),
intent(in) :: name_type
441 character(len=LINELENGTH) :: input_str
446 input_str = input_name
447 ilen = len_trim(input_str)
448 if (ilen > maxlen)
then
449 write (
errmsg,
'(a,i0,a)') &
450 'Input name "'//trim(input_str)//
'" exceeds maximum allowed length (', &
451 maxlen,
') for '//trim(name_type)//
'.'
456 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_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
subroutine, public inlen_check(input_name, mf6_name, maxlen, name_type)
store an error for input exceeding internal name length
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 ...