37 character(len=*),
intent(in) :: sourcename
39 character(len=LENPACKAGENAME) :: sourcetype
41 character(len=LENPACKAGENAME) :: ext
47 sourcetype =
'MF6FILE'
66 character(len=*),
intent(in) :: component
68 character(len=LENCOMPONENTNAME) :: component_type
70 integer(I4B) :: i, ilen, idx
76 ilen = len_trim(component)
78 if (component(i:i) ==
'6' .or. component(i:i) ==
'-')
then
81 component_type(idx:idx) = component(i:i)
87 'IDP input error, unrecognized component: "'//trim(component)//
'"'
104 result(subcomponent_type)
107 character(len=*),
intent(in) :: component
108 character(len=*),
intent(in) :: subcomponent
110 character(len=LENCOMPONENTNAME) :: subcomponent_type
112 character(len=LENCOMPONENTNAME) :: component_type
113 integer(I4B) :: i, ilen, idx
116 subcomponent_type =
''
122 ilen = len_trim(subcomponent)
124 if (subcomponent(i:i) ==
'6' .or. subcomponent(i:i) ==
'-')
then
127 subcomponent_type(idx:idx) = subcomponent(i:i)
143 result(subcomponent_name)
147 character(len=*),
intent(in) :: component_type
148 character(len=*),
intent(in) :: subcomponent_type
149 character(len=*),
intent(in) :: sc_name
151 character(len=LENPACKAGENAME) :: subcomponent_name
154 subcomponent_name =
''
158 subcomponent_name = sc_name
161 subcomponent_name = subcomponent_type
178 character(len=*),
intent(in) :: filename
180 character(len=LENPACKAGETYPE) :: ext
189 idx = index(filename,
'.', back=.true.)
193 ext = filename(idx + 1:len_trim(filename))
203 character(len=*),
intent(in) :: shape_string
204 integer(I4B),
dimension(:),
allocatable,
intent(inout) :: array_shape
205 character(len=*),
intent(in) :: memorypath
208 integer(I4B),
pointer :: int_ptr
209 character(len=16),
dimension(:),
allocatable :: array_shape_string
210 character(len=:),
allocatable :: shape_string_copy
213 shape_string_copy = trim(shape_string)//
' '
214 call parseline(shape_string_copy, ndim, array_shape_string)
215 allocate (array_shape(ndim))
219 call mem_setptr(int_ptr, array_shape_string(i), memorypath)
220 array_shape(i) = int_ptr
238 character(len=*),
intent(in) :: ftype
239 character(len=*),
intent(in) :: fname
240 character(len=*),
intent(in) :: model_mempath
241 character(len=*),
intent(in) :: dis_mempath
242 integer(I4B),
dimension(:),
pointer,
contiguous,
intent(inout) :: model_shape
243 integer(I4B),
pointer :: ndim1
244 integer(I4B),
pointer :: ndim2
245 integer(I4B),
pointer :: ndim3
246 integer(I4B),
pointer :: ncelldim
247 integer(I4B),
pointer :: distype
248 integer(I4B) :: dim1_size, dim2_size, dim3_size, dis_type
260 call get_isize(
'NLAY', dis_mempath, dim1_size)
261 call get_isize(
'NROW', dis_mempath, dim2_size)
262 call get_isize(
'NCOL', dis_mempath, dim3_size)
264 if (dim1_size <= 0)
then
266 'Required input dimension "NLAY" not found.'
270 if (dim2_size <= 0)
then
272 'Required input dimension "NROW" not found.'
276 if (dim3_size <= 0)
then
278 'Required input dimension "NCOL" not found.'
282 if (dim1_size >= 1 .and. dim2_size >= 1 .and. dim3_size >= 1)
then
283 call mem_allocate(model_shape, 3,
'MODEL_SHAPE', model_mempath)
287 model_shape = [ndim1, ndim2, ndim3]
297 call get_isize(
'NROW', dis_mempath, dim1_size)
298 call get_isize(
'NCOL', dis_mempath, dim2_size)
300 if (dim1_size <= 0)
then
302 'Required input dimension "NROW" not found.'
306 if (dim2_size <= 0)
then
308 'Required input dimension "NCOL" 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]
326 call get_isize(
'NLAY', dis_mempath, dim1_size)
327 call get_isize(
'NCPL', dis_mempath, dim2_size)
329 if (dim1_size <= 0)
then
331 'Required input dimension "NLAY" not found.'
335 if (dim2_size <= 0)
then
337 'Required input dimension "NCPL" not found.'
341 if (dim1_size >= 1 .and. dim2_size >= 1)
then
342 call mem_allocate(model_shape, 2,
'MODEL_SHAPE', model_mempath)
345 model_shape = [ndim1, ndim2]
351 call get_isize(
'NODES', dis_mempath, dim1_size)
353 if (dim1_size <= 0)
then
355 'Required input dimension "NODES" not found.'
359 if (dim1_size >= 1)
then
360 call mem_allocate(model_shape, 1,
'MODEL_SHAPE', model_mempath)
362 model_shape = [ndim1]
366 case (
'DISU6',
'DISV1D6')
369 if (ftype ==
'DISU6')
then
371 else if (ftype ==
'DISV1D6')
then
375 call get_isize(
'NODES', dis_mempath, dim1_size)
377 if (dim1_size <= 0)
then
379 'Required input dimension "NODES" not found.'
384 call mem_allocate(model_shape, 1,
'MODEL_SHAPE', model_mempath)
386 model_shape = [ndim1]
388 errmsg =
'Unknown discretization type. IDM cannot set shape for "' &
396 ncelldim =
size(model_shape)
416 character(len=*) :: str
417 character(len=LINELENGTH) :: compare_str
424 findloop:
do i = 1,
size(array)
425 compare_str = array(i)
426 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)
469 errmsg =
'Multiple FILEIN keywords detected for tag "'//trim(tagname)// &
470 '" in OPTIONS block. Only one entry allowed.'
475 call mem_setptr(fnames, tagname, input_mempath)
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_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 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 ...