Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor issue with zero connections #28

Open
wkitlasten opened this issue Jul 17, 2021 · 1 comment
Open

Minor issue with zero connections #28

wkitlasten opened this issue Jul 17, 2021 · 1 comment

Comments

@wkitlasten
Copy link
Contributor

I am getting a MF6 warning:

WARNING REPORT:

  1. SFR Package SFR_0 has 3 reach(es) with zero connections.
    Normal termination of simulation.

It appears the ones in question have to_rno = 0 and from_rnos = {}. They don't seem to be causing an issue, but perhaps they should be dropped?

@wkitlasten
Copy link
Contributor Author

Further digging suggests if rno = 1 does not have a downstream connection flopy fails while loading connection data (but strangely failed on line 17?). MF6 seems to run it okay:

sim=flopy.mf6.MFSimulation.load(sim_ws)
gwf=sim.get_model(my_model)

Full error report:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
D:\modelling\flopy\flopy\mf6\data\mffileaccess.py in read_list_data_from_file(self, file_handle, storage, current_key, current_line, data_line, store_internal)
   1441                         current_key=current_key,
-> 1442                         data_line=data_line,
   1443                     )[1]

D:\modelling\flopy\flopy\mf6\data\mffileaccess.py in load_list_line(self, storage, arr_line, line_num, data_loaded, build_type_list, current_key, data_index_start, data_set, ignore_optional_vars, data_line, zero_based)
   1855                                         data_line,
-> 1856                                         zero_based=zero_based,
   1857                                     )

D:\modelling\flopy\flopy\mf6\data\mffileaccess.py in _append_data_list(self, storage, data_item, arr_line, arr_line_len, data_index, var_index, repeat_count, current_key, data_line, add_to_last_line, zero_based)
   2161                         data_item,
-> 2162                         sub_amt=sub_amt,
   2163                     )

D:\modelling\flopy\flopy\mf6\data\mfdatautil.py in convert_data(data, data_dimensions, data_type, data_item, sub_amt)
     87         if data_item is not None and data_item.numeric_index:
---> 88             return int(PyListUtil.clean_numeric(data)) - sub_amt
     89         try:

ValueError: invalid literal for int() with base 10: '17    -18'

During handling of the above exception, another exception occurred:

MFDataException                           Traceback (most recent call last)
D:\modelling\flopy\flopy\mf6\mfpackage.py in load(self, block_header, fd, strict)
    860                         initial_comment,
--> 861                         external_file_info,
    862                     )

D:\modelling\flopy\flopy\mf6\data\mfdatalist.py in load(self, first_line, file_handle, block_header, pre_data_comments, external_file_info)
   1219         result = file_access.load_from_package(
-> 1220             first_line, file_handle, storage, pre_data_comments
   1221         )

D:\modelling\flopy\flopy\mf6\data\mffileaccess.py in load_from_package(self, first_line, file_handle, storage, pre_data_comments)
   1129                 current_line,
-> 1130                 self._data_line,
   1131             )

D:\modelling\flopy\flopy\mf6\data\mffileaccess.py in read_list_data_from_file(self, file_handle, storage, current_key, current_line, data_line, store_internal)
   1461                         self._simulation_data.debug,
-> 1462                         ex,
   1463                     )

MFDataException: An error occurred in data element "connectiondata" model "gwf6" package "sfr". The error occurred while loading data list from package file in the "read_list_data_from_file" method.
Additional Information:
(1) Unable to process line 17 of data list: "   17    -18
"


During handling of the above exception, another exception occurred:

MFDataException                           Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_22764/3270168176.py in <module>
      2 sim_ws=os.path.join('..','zmodels','20210717_simulation',model_name)
      3 model_ws=sim_ws
----> 4 sim=flopy.mf6.MFSimulation.load(sim_ws=sim_ws)
      5 gwf=sim.get_model(model_name)
      6 gwf.model_name=model_name

D:\modelling\flopy\flopy\mf6\modflow\mfsimulation.py in load(cls, sim_name, version, exe_name, sim_ws, strict, verbosity_level, load_only, verify_data, write_headers)
    680                 strict,
    681                 path,
--> 682                 load_only,
    683             )
    684 

D:\modelling\flopy\flopy\mf6\modflow\mfgwf.py in load(cls, simulation, structure, modelname, model_nam_file, version, exe_name, strict, model_rel_path, load_only)
    135             strict,
    136             model_rel_path,
--> 137             load_only,
    138         )

D:\modelling\flopy\flopy\mf6\mfmodel.py in load_base(cls, simulation, structure, modelname, model_nam_file, mtype, version, exe_name, strict, model_rel_path, load_only)
    799                     print("    loading package {}...".format(ftype))
    800                 # load package
--> 801                 instance.load_package(ftype, fname, pname, strict, None)
    802 
    803         # load referenced packages

D:\modelling\flopy\flopy\mf6\mfmodel.py in load_package(self, ftype, fname, pname, strict, ref_path, dict_package_name, parent_package)
   1406         )
   1407         try:
-> 1408             package.load(strict)
   1409         except ReadAsArraysException:
   1410             #  create ReadAsArrays package and load it instead

D:\modelling\flopy\flopy\mf6\mfpackage.py in load(self, strict)
   2040 
   2041         try:
-> 2042             self._load_blocks(fd_input_file, strict)
   2043         except ReadAsArraysException as err:
   2044             fd_input_file.close()

D:\modelling\flopy\flopy\mf6\mfpackage.py in _load_blocks(self, fd_input_file, strict, max_blocks)
   2226 
   2227                         cur_block.load(
-> 2228                             block_header_info, fd_input_file, strict
   2229                         )
   2230 

D:\modelling\flopy\flopy\mf6\mfpackage.py in load(self, block_header, fd, strict)
    871                             dataset.structure.name,
    872                             self.structure.name,
--> 873                             fd_block.name,
    874                         ),
    875                     )

MFDataException: An error occurred in data element "connectiondata" model "wairau_240_7" package "sfr_0". The error occurred while loading data list from package file in the "read_list_data_from_file" method.
Additional Information:
(1) Unable to process line 17 of data list: "   17    -18
"
(2) Error occurred while loading data "connectiondata" in block "connectiondata" from file "D:\modelling\zmodels\20210717_simulation\wairau_240_7\wairau_240_7.sfr.connection.dat".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant