39 character(len=*),
intent(in) :: sourcename
41 character(len=LENPACKAGENAME) :: sourcetype
43 character(len=LENPACKAGENAME) :: ext
49 sourcetype =
'MF6FILE'
65 character(len=*),
intent(in) :: component
67 character(len=LENCOMPONENTNAME) :: component_type
69 integer(I4B) :: i, ilen, idx
75 ilen = len_trim(component)
77 if (component(i:i) ==
'6' .or. component(i:i) ==
'-')
then
80 component_type(idx:idx) = component(i:i)
86 'IDP input error, unrecognized component: "'//trim(component)//
'"'
100 result(subcomponent_type)
103 character(len=*),
intent(in) :: component
104 character(len=*),
intent(in) :: subcomponent
106 character(len=LENCOMPONENTNAME) :: subcomponent_type
108 character(len=LENCOMPONENTNAME) :: component_type
109 integer(I4B) :: i, ilen, idx
112 subcomponent_type =
''
118 ilen = len_trim(subcomponent)
120 if (subcomponent(i:i) ==
'6' .or. subcomponent(i:i) ==
'-')
then
123 subcomponent_type(idx:idx) = subcomponent(i:i)
136 result(subcomponent_name)
140 character(len=*),
intent(in) :: component_type
141 character(len=*),
intent(in) :: subcomponent_type
142 character(len=*),
intent(in) :: sc_name
144 character(len=LENPACKAGENAME) :: subcomponent_name
147 subcomponent_name =
''
151 subcomponent_name = sc_name
154 subcomponent_name = subcomponent_type
168 character(len=*),
intent(in) :: filename
170 character(len=LENPACKAGETYPE) :: ext
179 idx = index(filename,
'.', back=.true.)
183 ext = filename(idx + 1:len_trim(filename))
190 character(len=*),
intent(in) :: shape_string
191 integer(I4B),
dimension(:),
allocatable,
intent(inout) :: array_shape
192 character(len=*),
intent(in) :: memorypath
195 integer(I4B),
pointer :: int_ptr
196 character(len=16),
dimension(:),
allocatable :: array_shape_string
197 character(len=:),
allocatable :: shape_string_copy
200 shape_string_copy = trim(shape_string)//
' '
201 call parseline(shape_string_copy, ndim, array_shape_string)
202 allocate (array_shape(ndim))
206 call mem_setptr(int_ptr, array_shape_string(i), memorypath)
207 array_shape(i) = int_ptr
212 integer(I4B),
dimension(:),
intent(in) :: mshape
213 integer(I4B),
intent(out) :: nlay
214 integer(I4B),
dimension(:),
allocatable,
intent(out) :: layer_shape
222 allocate (layer_shape(1))
223 layer_shape(1) = mshape(1)
224 else if (ndim == 2)
then
226 allocate (layer_shape(1))
227 layer_shape(1) = mshape(2)
228 else if (ndim == 3)
then
230 allocate (layer_shape(2))
231 layer_shape(1) = mshape(3)
232 layer_shape(2) = mshape(2)
249 character(len=*),
intent(in) :: ftype
250 character(len=*),
intent(in) :: fname
251 character(len=*),
intent(in) :: model_mempath
252 character(len=*),
intent(in) :: dis_mempath
253 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(inout) :: model_shape
254 integer(I4B),
pointer :: ndim1
255 integer(I4B),
pointer :: ndim2
256 integer(I4B),
pointer :: ndim3
257 integer(I4B),
pointer :: ncelldim
258 integer(I4B),
pointer :: distype
259 integer(I4B) :: dim1_size, dim2_size, dim3_size, dis_type
271 call get_isize(
'NLAY', dis_mempath, dim1_size)
272 call get_isize(
'NROW', dis_mempath, dim2_size)
273 call get_isize(
'NCOL', dis_mempath, dim3_size)
275 if (dim1_size <= 0)
then
277 'Required input dimension "NLAY" not found.'
281 if (dim2_size <= 0)
then
283 'Required input dimension "NROW" not found.'
287 if (dim3_size <= 0)
then
289 'Required input dimension "NCOL" not found.'
293 if (dim1_size >= 1 .and. dim2_size >= 1 .and. dim3_size >= 1)
then
294 call mem_allocate(model_shape, 3,
'MODEL_SHAPE', model_mempath)
298 model_shape = [ndim1, ndim2, ndim3]
308 call get_isize(
'NROW', dis_mempath, dim1_size)
309 call get_isize(
'NCOL', dis_mempath, dim2_size)
311 if (dim1_size <= 0)
then
313 'Required input dimension "NROW" not found.'
317 if (dim2_size <= 0)
then
319 'Required input dimension "NCOL" not found.'
323 if (dim1_size >= 1 .and. dim2_size >= 1)
then
324 call mem_allocate(model_shape, 2,
'MODEL_SHAPE', model_mempath)
327 model_shape = [ndim1, ndim2]
337 call get_isize(
'NLAY', dis_mempath, dim1_size)
338 call get_isize(
'NCPL', dis_mempath, dim2_size)
340 if (dim1_size <= 0)
then
342 'Required input dimension "NLAY" not found.'
346 if (dim2_size <= 0)
then
348 'Required input dimension "NCPL" not found.'
352 if (dim1_size >= 1 .and. dim2_size >= 1)
then
353 call mem_allocate(model_shape, 2,
'MODEL_SHAPE', model_mempath)
356 model_shape = [ndim1, ndim2]
362 call get_isize(
'NODES', dis_mempath, dim1_size)
364 if (dim1_size <= 0)
then
366 'Required input dimension "NODES" not found.'
370 if (dim1_size >= 1)
then
371 call mem_allocate(model_shape, 1,
'MODEL_SHAPE', model_mempath)
373 model_shape = [ndim1]
377 case (
'DISU6',
'DISV1D6')
380 if (ftype ==
'DISU6')
then
382 else if (ftype ==
'DISV1D6')
then
386 call get_isize(
'NODES', dis_mempath, dim1_size)
388 if (dim1_size <= 0)
then
390 'Required input dimension "NODES" not found.'
395 call mem_allocate(model_shape, 1,
'MODEL_SHAPE', model_mempath)
397 model_shape = [ndim1]
399 errmsg =
'Unknown discretization type. IDM cannot set shape for "' &
407 ncelldim =
size(model_shape)
423 character(len=*) :: str
424 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)
472 errmsg =
'Multiple FILEIN keywords detected for tag "'//trim(tagname)// &
473 '" in OPTIONS block. Only one entry allowed.'
478 call mem_setptr(fnames, tagname, input_mempath)
491 character(len=*),
intent(inout) :: mf6_name
492 integer(I4B),
intent(in) :: maxlen
493 character(len=*),
intent(in) :: name_type
494 character(len=LINELENGTH) :: input_str
499 input_str = input_name
500 ilen = len_trim(input_str)
501 if (ilen > maxlen)
then
502 write (
errmsg,
'(a,i0,a)') &
503 'Input name "'//trim(input_str)//
'" exceeds maximum allowed length (', &
504 maxlen,
') for '//trim(name_type)//
'.'
509 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 ...