0

I am using flopy package to run an existing model which I have change the content of well package in but when it comes to running well package in my code I got an error but I can't find the reason. Could you please help me in this regard? Thanks in advance for your answers.

Here is my simple code:

import flopy
import os
import sys
first = flopy.modflow.Modflow.load("step6.mfn", version='mf2k',exe_name="mf2k.exe", verbose =True , model_ws = "tep6._ws" , load_only=None , forgive=False , check =False )

And here is the error:

ValueError                                Traceback (most recent call last)
Input In [4], in <cell line: 4>()
      2 import os
      3 import sys
----> 4 first = flopy.modflow.Modflow.load("step6.mfn", version='mf2k',exe_name="mf2k.exe", verbose =True , model_ws = "step6._ws" , load_only=None , forgive=False , check =False )

File C:\Python27\anaconda\lib\site-packages\flopy\modflow\mf.py:883, in Modflow.load(cls, f, version, exe_name, verbose, model_ws, load_only, forgive, check)
    881 else:
    882     if "check" in package_load_args:
--> 883         item.package.load(
    884             item.filehandle,
    885             ml,
    886             ext_unit_dict=ext_unit_dict,
    887             check=False,
    888         )
    889     else:
    890         item.package.load(
    891             item.filehandle,
    892             ml,
    893             ext_unit_dict=ext_unit_dict,
    894         )

File C:\Python27\anaconda\lib\site-packages\flopy\modflow\mfwel.py:396, in ModflowWel.load(cls, f, model, nper, ext_unit_dict, check)
    393 if model.verbose:
    394     print("loading wel package file...")
--> 396 return Package.load(
    397     f,
    398     model,
    399     cls,
    400     nper=nper,
    401     check=check,
    402     ext_unit_dict=ext_unit_dict,
    403 )

File C:\Python27\anaconda\lib\site-packages\flopy\pakbase.py:1069, in Package.load(f, model, pak_type, ext_unit_dict, **kwargs)
   1065 elif itmp > 0:
   1066     current = pak_type.get_empty(
   1067         itmp, aux_names=aux_names, structured=model.structured
   1068     )
-> 1069     current = ulstrd(
   1070         f, itmp, current, model, sfac_columns, ext_unit_dict
   1071     )
   1072     if model.structured:
   1073         current["k"] -= 1

File C:\Python27\anaconda\lib\site-packages\flopy\utils\flopy_io.py:498, in ulstrd(f, nlist, ra, model, sfac_columns, ext_unit_dict)
    496         t = t[:ncol]
    497     t = tuple(t)
--> 498     ra[ii] = t
    499 else:
    500     # fixed format
    501     t = read_fixed_var(line, ncol=ncol)

ValueError: invalid literal for int() with base 10: '1.0'

0 Answers0