Hello everyone, I have started to work on a SWATMODFLOW model with QSWATMOD and I have had problems running the model, one of the errors that it throws me is that the swatmf_out_MF_obs file does not come out (and the message below appears)
2021-12-03T14:41:13 WARNING Traceback (most recent call last):
File "C:\Users/usuario/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATMOD2\QSWATMOD2.py", line 1038, in plot_wt
post_ii_wt.wt_plot_daily(self)
File "C:\Users/usuario/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATMOD2\pyfolder\post_ii_wt.py", line 221, in wt_plot_daily
output_wt = pd.read_csv(
File "C:\PROGRA~1\QGIS31~1.11\apps\Python39\lib\site-packages\pandas\io\parsers.py", line 686, in read_csv
return _read(filepath_or_buffer, kwds)
File "C:\PROGRA~1\QGIS31~1.11\apps\Python39\lib\site-packages\pandas\io\parsers.py", line 452, in _read
parser = TextFileReader(fp_or_buf, **kwds)
File "C:\PROGRA~1\QGIS31~1.11\apps\Python39\lib\site-packages\pandas\io\parsers.py", line 946, in __init__
self._make_engine(self.engine)
File "C:\PROGRA~1\QGIS31~1.11\apps\Python39\lib\site-packages\pandas\io\parsers.py", line 1178, in _make_engine
self._engine = CParserWrapper(self.f, **self.options)
File "C:\PROGRA~1\QGIS31~1.11\apps\Python39\lib\site-packages\pandas\io\parsers.py", line 2008, in __init__
self._reader = parsers.TextReader(src, **kwds)
File "pandas\_libs\parsers.pyx", line 382, in pandas._libs.parsers.TextReader.__cinit__
File "pandas\_libs\parsers.pyx", line 674, in pandas._libs.parsers.TextReader._setup_parser_source
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\usuario\\OneDrive - Universidad de Concepción\\SIG\\SWATMODFLOW\\ITATA12_01\\SWAT-MODFLOW\\swatmf_out_MF_obs'
AND
2021-12-03T14:49:21 WARNING warning:C:\Users/usuario/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATMOD2\modules\flopy\utils\rasters.py:57: DeprecationWarning: `np.float` is a deprecated alias for the builtin `float`. To silence this warning, use `float` by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use `np.float64` here.
Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations
FLOAT32 = (float, np.float, np.float32, np.float_)
traceback: File "", line 1, in
File "C:\PROGRA~1/QGIS31~1.11/apps/qgis-ltr/./python\qgis\utils.py", line 354, in startPlugin
if not _startPlugin(packageName):
File "C:\PROGRA~1/QGIS31~1.11/apps/qgis-ltr/./python\qgis\utils.py", line 334, in _startPlugin
plugins[packageName] = package.classFactory(iface)
File "C:\Users/usuario/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATMOD2\__init__.py", line 34, in classFactory
from .QSWATMOD2 import QSWATMOD2
File "C:\PROGRA~1/QGIS31~1.11/apps/qgis-ltr/./python\qgis\utils.py", line 793, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 855, in exec_module
File "", line 228, in _call_with_frames_removed
File "C:\Users/usuario/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATMOD2\QSWATMOD2.py", line 58, in
from .dialogs import createMFmodel_dialog
File "C:\PROGRA~1/QGIS31~1.11/apps/qgis-ltr/./python\qgis\utils.py", line 793, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "", line 1058, in _handle_fromlist
File "", line 228, in _call_with_frames_removed
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 855, in exec_module
File "", line 228, in _call_with_frames_removed
File "C:\Users/usuario/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATMOD2\dialogs\createMFmodel_dialog.py", line 47, in
from QSWATMOD2.pyfolder import writeMF
File "C:\PROGRA~1/QGIS31~1.11/apps/qgis-ltr/./python\qgis\utils.py", line 793, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "", line 1058, in _handle_fromlist
File "", line 228, in _call_with_frames_removed
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 855, in exec_module
File "", line 228, in _call_with_frames_removed
File "C:\Users/usuario/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATMOD2\pyfolder\writeMF.py", line 23, in
from QSWATMOD2.modules import flopy
File "C:\PROGRA~1/QGIS31~1.11/apps/qgis-ltr/./python\qgis\utils.py", line 793, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "", line 1058, in _handle_fromlist
File "", line 228, in _call_with_frames_removed
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 855, in exec_module
File "", line 228, in _call_with_frames_removed
File "C:\Users/usuario/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATMOD2\modules\flopy\__init__.py", line 33, in
from . import modflow
File "C:\PROGRA~1/QGIS31~1.11/apps/qgis-ltr/./python\qgis\utils.py", line 793, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "", line 1058, in _handle_fromlist
File "", line 228, in _call_with_frames_removed
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 855, in exec_module
File "", line 228, in _call_with_frames_removed
File "C:\Users/usuario/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATMOD2\modules\flopy\modflow\__init__.py", line 1, in
from .mf import Modflow
File "C:\PROGRA~1/QGIS31~1.11/apps/qgis-ltr/./python\qgis\utils.py", line 793, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 855, in exec_module
File "", line 228, in _call_with_frames_removed
File "C:\Users/usuario/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATMOD2\modules\flopy\modflow\mf.py", line 10, in
from ..mbase import BaseModel
File "C:\PROGRA~1/QGIS31~1.11/apps/qgis-ltr/./python\qgis\utils.py", line 793, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 855, in exec_module
File "", line 228, in _call_with_frames_removed
File "C:\Users/usuario/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATMOD2\modules\flopy\mbase.py", line 22, in
from QSWATMOD2.modules.flopy import utils, discretization
File "C:\PROGRA~1/QGIS31~1.11/apps/qgis-ltr/./python\qgis\utils.py", line 793, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "", line 1058, in _handle_fromlist
File "", line 228, in _call_with_frames_removed
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 855, in exec_module
File "", line 228, in _call_with_frames_removed
File "C:\Users/usuario/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATMOD2\modules\flopy\utils\__init__.py", line 47, in
from .rasters import Raster
File "C:\PROGRA~1/QGIS31~1.11/apps/qgis-ltr/./python\qgis\utils.py", line 793, in _import
mod = _builtin_import(name, globals, locals, fromlist, level)
File "", line 1007, in _find_and_load
File "", line 986, in _find_and_load_unlocked
File "", line 680, in _load_unlocked
File "", line 855, in exec_module
File "", line 228, in _call_with_frames_removed
File "C:\Users/usuario/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATMOD2\modules\flopy\utils\rasters.py", line 23, in
class Raster(object):
File "C:\Users/usuario/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\QSWATMOD2\modules\flopy\utils\rasters.py", line 57, in Raster
FLOAT32 = (float, np.float, np.float32, np.float_)
File "C:\PROGRA~1\QGIS31~1.11\apps\Python39\lib\site-packages\numpy\__init__.py", line 287, in __getattr__
warnings.warn(msg, DeprecationWarning, stacklevel=2)
Another strange thing is that I get this when running the model, and then it stops and closes
Has something similar happened to someone? Use a MODFLOW model made in ModelMuse, QGIS 3.16.11, with day time unit, with 36 periods (distributed per month that is why it gives 36 periods, that perhaps makes interference when coupling the two models? at some point I thought it was a grid failure but I don't know. )
If anyone has any suggestions on what data to "watch" in MODFLOW or SWATMODLOW I would really appreciate it.
Thanking you in advance for your help,
Valery Lagos.
Hi Valery,
I found several issues with your QSWATMOD project.
First, you missed the creating “identify river cells” step. I created the “mf_riv1” layer.
The second is not likely an error, but your dhru_grid layer includes many empty objects. See figure below. It seems the process of creating the layer was not finished completely.
I set the dhru_grid size threshold to 900m2 to get objects greater than 900m2. Now you can see there is no null space.

The third is the ModelMuse software version issue. The latest version of the ModelMuse creates additional lines in the *.wel file (package) that the old one doesn’t have. So I deleted those 3 lines.

The last is about solver tolerances. The SWAT-MODFLOW model is an integrated model which is highly complex and nonlinear. I increased flux/head tolerances, iteration numbers and changed the solver input option to COMPLEX.
Here is some explanation about the NWT solver. (https://water.usgs.gov/ogw/modflow-nwt/MODFLOW-NWT-Guide/index.html?nwt_newton_solver.htm)
COMPLEX indicates that default solver input values will be defined that work well for highly nonlinear models. This would be used for models that include nonlinear stress packages, and models that consist of one or more unconfined layers representing complex geology and sw/gw interaction. The “COMPLEX” option should be used when the “MODERATE” option does not result in successful convergence. (See table 2 for the solver input values that will be used for this option.)
Hope this helps!
Seonggyu