Regarding python error in QSWATMOD2 plugin

31 views
Skip to first unread message

Lenka Saikumar

unread,
Aug 4, 2025, 6:19:06 AMAug 4
to SWAT-MODFLOW

Respected sir , I am working on the swat modflow software in QGIS.After preprocessing ,in simulation while checking the YES box for irrigation(pumping from MODFLOW)  it shows this python error.I used the reference file that is QSWATMODFLOW tutorial only . i think the tutorial zip file does not contain the well shapefiles ,observed discharge csv file.   could solve this problem.

i used latest version of the QSWATMOD2 plugin and QGIS is 3.28.10


 line 99, in create_conv_runoff

              wel_max = int(data[0][0])
             UnboundLocalError: local variable 'data' referenced before assignment

Seonggyu Park

unread,
Sep 15, 2025, 1:11:46 AMSep 15
to SWAT-MODFLOW
Hi,

To activate dynamic irrigation with pumping from MODFLOW, you need a well package in your MODFLOW model. QSWATMOD doesn’t support creating the well package directly. You can also create the observed discharge CSV file using the example file as a reference.

Best,
Seonggyu
Reply all
Reply to author
Forward
0 new messages