-
Notifications
You must be signed in to change notification settings - Fork 344
Open
Milestone
Description
I'm trying to load a MF-USG model that has inflow concentrations on RCH Package. I can load the model by using forgive = True, check = False with flopy.modflow.Modflow.load. However the recharge package is not loaded.
When setting forgive = False, check = True the following error log indicates that the problem lies in the third line of the RCH package, where variable INCONC is specified.
Below the error log, I am showing some bits of the RCH package format.
I wonder if this has an easy fix, since with this setup the RCH package contains the array of rechrates for each SP followed by an array of rech concentrations.
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
C:\Users\JAVIER~1\AppData\Local\Temp/ipykernel_38636/732944418.py in <module>
40 #--- https://stackoverflow.com/questions/51734703/extract-heads-from-modflow-usg-binary-output-using-flopy
41
---> 42 gwf = flopy.modflow.Modflow.load(
43 model_name,
44 version = 'mfusg',
~\.conda\envs\flopy-develop\lib\site-packages\flopy\modflow\mf.py in load(cls, f, version, exe_name, verbose, model_ws, load_only, forgive, check)
884 else:
885 if "check" in package_load_args:
--> 886 item.package.load(
887 item.filehandle,
888 ml,
~\.conda\envs\flopy-develop\lib\site-packages\flopy\modflow\mfrch.py in load(cls, f, model, nper, ext_unit_dict, check)
493 f" loading rech stress period {iper + 1:3d}..."
494 )
--> 495 t = Util2d.load(
496 f,
497 model,
~\.conda\envs\flopy-develop\lib\site-packages\flopy\utils\util_array.py in load(cls, f_handle, model, shape, dtype, name, ext_unit_dict, array_free_format, array_format)
2838 # array_format = model.array_format
2839
-> 2840 cr_dict = Util2d.parse_control_record(
2841 f_handle.readline(),
2842 current_unit=curr_unit,
~\.conda\envs\flopy-develop\lib\site-packages\flopy\utils\util_array.py in parse_control_record(line, current_unit, dtype, ext_unit_dict, array_format)
3027 npl, fmt, width, decimal = None, None, None, None
3028 else:
-> 3029 locat = int(line[0:10].strip())
3030 if isfloat:
3031 if len(line) >= 20:
ValueError: invalid literal for int() with base 10: '1 INCONC'
RCH Package:
# MODFLOW-USGs Recharge Package
3 50 CONC
1
1 INCONC
INTERNAL 1.000000e+00 (FREE) -1 RECHARGE
1.700000e-05 1.700000e-05 1.700000e-05 1.700000e-05 1.700000e-05 1.700000e-05 1.700000e-05 1.700000e-05 1.700000e-05
1.700000e-05 1.700000e-05 1.700000e-05 1.700000e-05 1.700000e-05 1.700000e-05 1.700000e-05 1.700000e-05 1.700000e-05
1.700000e-05 1.700000e-05 1.700000e-05 1.700000e-05 1.700000e-05 1.700000e-05 1.700000e-05 1.700000e-05 1.700000e-05
.
.
.
.
1.700000e-05 1.700000e-05 1.700000e-05 1.700000e-05 1.700000e-05 1.700000e-05 1.700000e-05 1.700000e-05 0.000000e+00
1.700000e-05 1.700000e-05 1.700000e-05 1.700000e-05 1.700000e-05 1.700000e-05 1.700000e-05 1.700000e-05 1.700000e-05
1.700000e-05 1.700000e-05 1.700000e-05 1.700000e-05
INTERNAL 1.000000e+00 (FREE) -1 RECHARGE CONC
1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00
1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00
1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00 1.000000e+00
.
.
.
Metadata
Metadata
Assignees
Labels
No labels