Skip to content

Loading an existing mfusg with voronoi crashes #896

@a0wunsch

Description

@a0wunsch

When an existing mfusg model with voronoi mesh (created outside of flopy) is loaded to flopy, results in error. If I read this correctly, then associated with the recharge package:

e.g.:
m1=flopy.modflow.Modflow.load(model_name+".nam",model_ws=model_dir,verbose=True,check=False,exe_name="mfusg.exe",version='mfusg')

verbose indicates that everything is read correctly ("...success" feedback on DISU, BAS6 etc), but ends with this. Seems like Util2d.load expects a row-column array and crashes with unstructured:


adding Package:  OC
   OC   package load...success
loading rch package file...
   loading rech stress period   1...

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-26-90e7ddad9ac4> in <module>
      6 
      7 
----> 8 m1=flopy.modflow.Modflow.load(model_name+".nam",model_ws=model_dir,verbose=True,check=False,exe_name="mfusg.exe",version='mfusg')
      9 

~\Anaconda3\lib\site-packages\flopy\modflow\mf.py in load(f, version, exe_name, verbose, model_ws, load_only, forgive, check)
    797                             item.package.load(item.filehandle, ml,
    798                                               ext_unit_dict=ext_unit_dict,
--> 799                                               check=False)
    800                         else:
    801                             item.package.load(item.filehandle, ml,

~\Anaconda3\lib\site-packages\flopy\modflow\mfrch.py in load(f, model, nper, ext_unit_dict, check)
    408                         print(txt)
    409                     t = Util2d.load(f, model, (nrow, ncol), np.float32, 'rech',
--> 410                                     ext_unit_dict)
    411                 else:
    412                     parm_dict = {}

~\Anaconda3\lib\site-packages\flopy\utils\util_array.py in load(f_handle, model, shape, dtype, name, ext_unit_dict, array_free_format, array_format)
   2699 
   2700         elif cr_dict['type'] == 'internal':
-> 2701             data = Util2d.load_txt(shape, f_handle, dtype, cr_dict['fmtin'])
   2702             u2d = Util2d(model, shape, dtype, data, name=name,
   2703                          iprn=cr_dict['iprn'], fmtin="(FREE)",

~\Anaconda3\lib\site-packages\flopy\utils\util_array.py in load_txt(shape, file_in, dtype, fmtin)
   2376         elif len(shape) == 2:
   2377             nrow, ncol = shape
-> 2378             num_items = nrow * ncol
   2379         else:
   2380             raise ValueError(

TypeError: unsupported operand type(s) for *: 'NoneType' and 'int'

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions