Sensitivity analysis errors

227 views
Skip to first unread message

Arantxa Ortiz Elorza

unread,
Mar 25, 2025, 8:33:38 AMMar 25
to SWAT+ Toolbox

Dear all, 

I am trying to run a sensitivity analysis in my basin but I keep having errors. Attach in the image.

I have made sure that the output files are not open.

I have selected the predefined parameter sets with the map selection so the parameters and objects should be okay.

I do not know what is the error I keep having. I imagine that it is because when a parameter changes (relative or percent) since it is applied to the initial value, when applying the change, the final value is out of range. But I do not know the initial value so I do not know what parameter is giving me the error. I am thinking this because, the sensitivity analysis starts and it continues until 10% or so (I have made various tries and sometimes is 10 others 7 others 6..., since the process starts and makes some progress this is what I thought)

 

Is it possible that in this error message appears a part from the verifications, what parameter exactly is giving the problem? 

If this is the problem, it would be okay if instead of stopping the sensitivity analysis, the notification would be something like: x parameter is out of range when applying y% of change. Do you want to ignore this change? and if I click on yes, it ignores the change that it is giving me the error and continues with the sensitivity analysis.

I am imagining something like a try except function in python.

This only would work if the problem is what I have explained, otherwise I do not know what the problem is and how to solve it.

Can anybody help me identifying the problem? Could it be what I explained? How do I solve it?

 

Thank you

 

Arantxa

sensitivity_error2.png
senstivity_error1.png

Celray James

unread,
Mar 25, 2025, 12:57:03 PMMar 25
to SWAT+ Toolbox
I already see something fishy with the canmx line.

Here is how to find what is going wrong
.
  • At the top of the message, it will tell you which process has crashed p1 through pn depending on how many processes. Let us say p3 is the one with the issue
  • Go to the current scenario in File Explorer and go into .tmp directory, you will find folders p1, p2, p3, ... pn. Open p3.
  • Paste the debug executable and run it through Command Prompt (or PowerShell).
  • It will crash but will give you debug information which will tell you what parameter is causing the issue.

The error happens in the SWAT+ Executable running in one of the parallel processes and SWAT+ Toolbox is just reporting context to help you trouble shoot.

You propose the try - except approach: While this may allow the run to continue, you cannot later calculate sensitivities and rank parameters because you already define the 'problem' and then you run the sample while keeping performance values. if anything goes wrong in the process, you have to restart the entire process because all the other runs are no longer applicable as you need a complete set of sampled parameters and their corresponding performance metrics.

Normally out of bounds parameters should be set to minimum or maximum based on cal_parms.cal automatically but this does not seem to work correctly all the time. The moment you try something that will be out of bounds, SWAT+ crashes. Check pictures below. Now It is easy to handle the 'replace' change in SWAT+ Toolbox and say, "you cannot use this range etc...". but when we go to spatially distributed parameters, it should be handled by SWAT+ not SPT because SWAT+ is the one applying the parameters to each object. So you see, SPT can only tell where the error is coming from, and you can dig to find what is going wrong. Hopefully we can fix these issues in the executable in the future.

Screenshot 2025-03-25 164538.png

Screenshot 2025-03-25 165105.png

Mario Bianco

unread,
Apr 22, 2025, 12:13:22 PMApr 22
to SWAT+ Toolbox
Hello, James

many thanks for your feedback. I am having the very same same issue as Arantxa, what "debug executable" are you referring to in your message?
I would really appreciate if could share a link to the executable file.

Furthermore, I don't see in my Error message (which is same message as the one which Arantxa posted, although of course it refers different parameters, cn2 and on_n in my case) the process which has crashed. Should I look for it anywhere else?

Many thanks,

Celray James

unread,
Apr 22, 2025, 12:22:18 PMApr 22
to SWAT+ Toolbox
Dear Mario,

Download the debug executable from the SWAT+ Website, you will then need to paste that debug version in the offending process folder (inside the .tmp/p1 or .tmp/p2, etc) the tmp folder is found nect to your txtinout directory in the SPT directory structure. That way you can see which parameter is causing the issue.

Kind Regards!

坂直樹

unread,
May 1, 2025, 9:55:23 AMMay 1
to SWAT+ Toolbox
Hello, I am in same situation as Mario, but I would like to ask fundamental question.
I want to know what kind of roles p1~p10 folders have for conducting sensitivity analysis.
I understood I have to copy and paste debug executable file, but should I run it inside the .tmp/p1 or .tmp/p2, etc?

2025年4月23日水曜日 1:22:18 UTC+9 Celray James:
Reply all
Reply to author
Forward
0 new messages