QSWATMOD UnboundLocalError: var 'delr'

241 views
Skip to first unread message

Dongseok Yang

unread,
Feb 22, 2021, 8:28:42 PM2/22/21
to SWAT-MODFLOW
I am keep facing problem about the local variable 'delr' while linking_process.py script being executed.
Is there something wrong from my setting or should I use different version?
2021-02-22_18-12-12.png

Seonggyu Park

unread,
Feb 26, 2021, 10:40:47 AM2/26/21
to SWAT-MODFLOW
Hi,

I guess QSWATMOD couldn't read *.dis information properly. Could you please share your *.dis file? I will check it out and fix this issue in the next version.

Thanks,
Seonggyu

Dongseok Yang

unread,
Mar 2, 2021, 1:30:57 AM3/2/21
to SWAT-MODFLOW
Does this problem can be avoided when I use previous version of the qswatmod?
I'm only trying to use the qswatmod to build modflow model. I use .exe engine on dos system.

2021년 2월 27일 토요일 오전 12시 40분 47초 UTC+9에 env...@gmail.com님이 작성:

Seonggyu Park

unread,
Mar 2, 2021, 12:56:33 PM3/2/21
to SWAT-MODFLOW
I just checked your *.dis file, but couldn't find any problems there. I am sorry. Could you please share your project folder and qgis file? It would be nice to check through a linking workflow.

Thanks,
Seonggyu

Dongseok Yang

unread,
Mar 3, 2021, 8:26:32 PM3/3/21
to SWAT-MODFLOW
First, I'm letting you know this problem is solved "simply".
The problem was location of MODFLOW folder which should be in the same level as SWAT txtinout folder.
for example, my previous file structure was like this :
    ┌DEM : DEM input file for QSWATMOD
    ┣ Shapes : SHP files from SWAT model which goes to QSWATMOD
    ┣ test_01 : QSWATMOD project folder
    │       └ MODFLOW : MODFLOW model folder build from QSWATMOD
    ┣ swatmodflow.qgz : QSWATMOD project file
    └ TxtinOut : SWAT model txtinout folder

this should be like this :
    ┌DEM : DEM input file for QSWATMOD
    ┣ Shapes : SHP files from SWAT model which goes to QSWATMOD
    ┣ test_01 : QSWATMOD project folder
    ┣ MODFLOW : MODFLOW model folder build from QSWATMOD
    ┣ swatmodflow.qgz : QSWATMOD project file
    └ TxtinOut : SWAT model txtinout folder

I hope no one face the problem, but if you sometime faces unknown variable or sth else that can not be solved spontaeously, please check the file location and directory.

Thank you.


2021년 3월 3일 수요일 오전 2시 56분 33초 UTC+9에 env...@gmail.com님이 작성:

Ram Kiran Padilam

unread,
Mar 9, 2021, 3:25:42 AM3/9/21
to SWAT-MODFLOW

I am getting the same error at 96% during the linking process UnboundLocalError: var 'delr' .I have created an modflow model in the qswatmod and created the respective folders as stated above i am attaching the folder and error screen shot
Screenshot (3164).png
Screenshot (2883).png
Screenshot (2882).png

Dongseok Yang

unread,
Mar 9, 2021, 9:15:24 PM3/9/21
to SWAT-MODFLOW
I really have no clue why this happening, according to Seonggyu, my problem was solved when directory location is changed. I didn't test another watershed yet, but sooner or later after trying other one, and if I face same problem, I will let you know.
And as of now, Seonggyu should take a look for your case.

2021년 3월 9일 화요일 오후 5시 25분 42초 UTC+9에 plramk...@gmail.com님이 작성:

Seonggyu Park

unread,
Mar 10, 2021, 9:13:02 AM3/10/21
to SWAT-MODFLOW
Hi,

it looks like you didn't import your MODFLOW directory. You need to specify the path to your MODFLOW model like the "SWAT txtinout folder" then identify your river. In your case,  select "use only MODFLOW river package".

Seonggyu

Ram Kiran Padilam

unread,
Mar 11, 2021, 10:56:09 PM3/11/21
to SWAT-MODFLOW
I have runned the model for three times still facing the same issue. 
Screenshot (3240).png
Screenshot (3237).png
Screenshot (3174).png
Screenshot (3238).png

Seonggyu Park

unread,
Mar 12, 2021, 11:24:09 AM3/12/21
to SWAT-MODFLOW
Please, specify the path to your MODFLOW folder.

InkedScreenshot (3237)_LI.jpg

Identify your River cell then start the linking process.
Capture1.JPG

Ram Kiran Padilam

unread,
Mar 15, 2021, 5:32:02 AM3/15/21
to SWAT-MODFLOW
thank you brother the linkage and model run is done successfully but i encountered  with some errors 
1.failed to meet solver convergence criteria 
2. error while opening ,ground water - surface water interactions 

Screenshot (3296).png
Screenshot (3295).png
Screenshot (3267).png
Screenshot (3294).png

Ram Kiran Padilam

unread,
Mar 15, 2021, 5:42:58 AM3/15/21
to SWAT-MODFLOW

I have created swat and modflow individually coupled the model while viewing output for water balance it showed could not convert string to float: '94.24************' I am attaching the error pic and output.std file 
output.std
Screenshot (3298).png

rael nyakundi

unread,
May 22, 2021, 11:57:32 PM5/22/21
to SWAT-MODFLOW
Hi there , I am facing the same error here, did you find any help?
Reply all
Reply to author
Forward
0 new messages