Routing sink category not found as a source

295 views
Skip to first unread message

Mok Even

unread,
Apr 3, 2023, 7:20:43 AM4/3/23
to QSWAT+
Dear all,

I am using QSWAT+ 2.3.4 for simulations. I added reservoirs as lake shapefile during the process of delineate watershed. Then I got an error when I was creating HRUs (refer to error message below): 
Internal error: routing sink category CH id 190 not found as a source
Internal error: routing sink category CH id 29 not found as a source
Internal error: routing sink category CH id 181 not found as a source

Later, I failed to import my GIS data into SWAT+ Editor and received this message below:

Traceback (most recent call last):
  File "actions\import_gis.py", line 132, in insert_default
  File "actions\import_gis.py", line 752, in insert_recall
KeyError: 181

I couldn't find the solution to this problem and I would be very grateful for any help. Thank you in advance.

kind regards,
Even 
SWAT error msg1.jpg
SWAT error msg2.jpg

Mehmet BEŞİKTAŞ

unread,
Apr 3, 2023, 9:39:14 AM4/3/23
to QSWAT+
Dear Even

The error message you received when creating HRUs in QSWAT+ suggests that there might be an issue with the routing sink category for the channels in your reservoirs. The error message indicates that the routing sink category CH id 190, 29, and 181 were not found as a source. This could happen if the channel IDs for your reservoirs are not correctly defined or if they are not connected to the main channel network.

To resolve this issue, you can try the following steps:

Check the routing sink category of the channels in your reservoir shapefile. Make sure that they are correctly defined and that they are connected to the main channel network.


Check the channel IDs for your reservoirs. Make sure that they are unique and that they do not conflict with other channel IDs in your watershed.


Verify that the shapefile for your reservoirs is correctly formatted and that it can be read by QSWAT+.

Regarding the error message you received when importing your GIS data into SWAT+ Editor, it appears to be related to the same issue as the error message you received when creating HRUs. The error message indicates that the key value 181 was not found. It is likely that this key value refers to the routing sink category for a channel in your reservoir shapefile that was not correctly defined or connected to the main channel network.

To resolve this issue, you can try the same steps listed above.
Regards
Mehmet

Emma Nilsson

unread,
Apr 24, 2023, 10:25:33 AM4/24/23
to QSWAT+
Hi, 

Even, did you manage to solve your problem using Mehmet's suggestions or in any other way? I am having a similar problem with the error message  "Internal error: routing sink category CH id xx not found as a source" popping up when creting HRUs (I haven't yet started working in SWAT+ editor but I imagine I will have similar issues as you when I get there). 

Mehmet, I tried following your suggestions to fix the error but realised that I don't fully understand what you mean. For example, what is the "routing sink category" and where can I find it? In my "Pt sources and reservoirs"-shapefile created when creating HRUs, or in the reservoir shapefile I added during watershed delinetaion? In netiher of those shapefile's attribute tables is there a field called routing sink or similar. 

Any help would be greatly appreciated! 
Emma 

Arantxa Ortiz

unread,
Oct 25, 2023, 4:04:17 AM10/25/23
to QSWAT+
Hi,
I have a similar problem as Emma, I do not know what routing sink category means nor where to find it. Where should I look for the problem?

Thank you

Arantxa

Chris George

unread,
Oct 25, 2023, 7:04:57 AM10/25/23
to Arantxa Ortiz, QSWAT+
This message's language is perhaps a bit technical, but it is reported
as an internal error which means something has gone wrong in the code
and may not be the user's fault (unless they ignored earlier errors).
The routing table produced by QSWAT+ maps sources of flow to sinks.
Categories are kinds of such sources and sinks, like channels, points or
reservoirs. The error means that the routing table has an entry
identifying a channel with the given number as a sink, so there is a
flow into it, but it does not appear as a source, so there is no flow
out of it. This is clearly an inconsistency in the model.

The most common reason I have seen for such messages is a bug in QGIS
3.28 when a lake shapefile is used. You should QGIS 3.22.

Chris

On 10/25/2023 9:04 AM, Arantxa Ortiz wrote:
> Hi, I have a similar problem as Emma, I do not know what routing sink
> category means nor where to find it. Where should I look for the
> problem? Thank you Arantxa El lunes, 24 de abril de 2023 a las 16: 25:
>  33 UTC+2, QSWAT+ escribió: Hi, Even, did
> ZjQcmQRYFpfptBannerStart
> This Message Is From an External Sender
> This message came from outside your organization.
> ZjQcmQRYFpfptBannerEnd
> --
> You received this message because you are subscribed to the Google
> Groups "QSWAT+" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to qswatplus+...@googlegroups.com
> <mailto:qswatplus+...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/qswatplus/3317ed93-0ead-4b0a-9b9f-fb9941d82c06n%40googlegroups.com <https://urldefense.com/v3/__https://groups.google.com/d/msgid/qswatplus/3317ed93-0ead-4b0a-9b9f-fb9941d82c06n*40googlegroups.com?utm_medium=email&utm_source=footer__;JQ!!KwNVnqRv!HaDFR0zKz83CIXjmDcUmQQ04q19OW0m-XuO1BH5htYZp7pAO_jsWxOhWu7DhLqvkqa0cNWYWIH6brd56MbF_SWgLWA$>.

Arantxa Ortiz

unread,
Oct 25, 2023, 7:23:37 AM10/25/23
to QSWAT+
Dear Chris,
Thank you for the answer. Nevertheless, I am using QGIS 3.22 as you recomended and I have this error. I do not have the error if I make the threashold for the channels and streams bigger, but then, the channels and streams in the watershed are very scarce. What can I do to put the threashold lower and use lakes, without having this error? 

Thank you

Arantxa

Capture3.PNG

Paulo Amaral

unread,
Aug 7, 2024, 7:50:54 AM8/7/24
to QSWAT+
Hi,
Has anyone managed to solve this problem? I'm facing the same problem with the new version of Swat+, released in the summer of 2024 (July/2024).
Regards,
Paulo
Reply all
Reply to author
Forward
0 new messages