Manually editing the parameter list (calibration.cal)

43 views
Skip to first unread message

Afonso Augusto Magalhães de Araujo

unread,
Aug 21, 2025, 5:22:51 PMAug 21
to SWAT+ Toolbox
Dear all, I'm having a lot of difficulty editing parameters through the interface, particularly as the parameters become calibrated and therefore become fixed as you move downstream. Could someone tell me if it's possible to edit the parameters table directly in the files on disk, instead of through the interface? One alternative would be to simple directly edit the "calibration.cal" file. However, how can I make the SWAT+Toolbox interface "see", or consider this manually edited file during calibration?

I appreciate any help, including other "smart" practices to speed up the process. Thank you.
Afonso

Mario Fomaca Jr

unread,
Sep 1, 2025, 8:36:23 AMSep 1
to SWAT+ Toolbox

I have already calibrated a model using SWAT+ CUP. To test it in SWAT+ Toolbox, what I did was copy the calibration.cal file from my SWAT+ CUP project and paste it into the calibration folder of the SWAT+ Toolbox (something like: ...\Scenarios\Toolbox\Calibration\calibration.cal), replacing the original file.

Make sure to remove all parameters listed in SWAT+ Toolbox so they do not overwrite your manually edited calibration.cal file.

Then, run the model in the Toolbox using the Run Model tab. If you run it through the Calibration tab, the Toolbox will modify your manually edited calibration.cal file.

This was the way I managed to run my model in the Toolbox using a calibration that came from outside the Toolbox. If anyone knows another way or if this is incorrect, please feel free to comment here.


Mario

Afonso Augusto Magalhães de Araujo

unread,
Sep 8, 2025, 10:25:17 AMSep 8
to SWAT+ Toolbox
Dear Mario, First of all, thank you for your response. It took me a while to see it, as I'm immersed in the many challenges of using Toolbox. With SWAT_CUP I also faced challenges, but it was much more effective. Unfortunately, I've already made the choice and there's no going back.

I believe your suggestion is not wrong. I just haven't yet understood its effectiveness for what I really need, which is for the calibration algorithm to "see" these parameters. There's a huge inefficiency in entering and editing the parameter set in the interface. It's also very unclear what's actually happening.

In the case of SWAT CUP, we simply need to have the set of parameters in a text file and insert them directly into the structure, which is simple but very well-defined and transparent (fast and effective). Despite being a super and commendable effort, the Toolbox interface,  is rigid, slow, unstable (crashes frequently), and very obscure (sorry!).

The way I managed to speed up parameter insertion a bit by editing the file (parameterGroupSets.csv), in: "SWATPlus\SWATPlusToolbox\assets\config\pars" has greatly improved my life. However, I still rely on the tool to set the LSUs via "map selection" which is very bad (it requires a lot of patience and skill).

Another huge challenge and mystery I'm trying to unravel is figuring out how to track/record the best run that generated the best fit (Nash). Sometimes the Nash increases and after decreases, and... I can't track this, meaning the best run is lost. I tried saving the calibration.cal, but that didn't reproduce the good result I had. If anyone has a good tip, I'd be happy.

Celray James

unread,
Sep 17, 2025, 4:14:03 PMSep 17
to SWAT+ Toolbox
A few things to note.
  • Mario is correct. if you want to run the model with manually edited parameters, you must run the model using the Run Section. Running the model in Calibration section assumes you want to apply the current parameters.
  • In the Calibration Section, the 'Orange' Columns are editable. which means, you can change any parameter value manually by clicking on the orange column value and typing in your own. The moment you click run, these parameters will overwrite any that were existing in the calibration.cal
  • When doing manual calibration, currently you need to keep track of which parameter set is giving you best performance, Automatic Calibration saves this information automatically in the green column of the auto calibration section. We plan to add ability to save parameter set so it is easy to restore better parameter sets when doing manual calibration.
  • Apart from map, you can also add object numbers by using comma separated list. keep in mind that if it is for HRU parameter, the comma separated list should be that of HRUs (not LSUs)
  • As for crashes, the common cause is when trying to use parameter values out of range. some people will add parameters like soil z and put range as 0 - 3500 using replace. this leaves room during sensitivity analysis (or calibration) to have soil depth 0mm which crashes the model. However, I strongly recommend reporting such crashes along with the dataset that developers may repeat and fix them.
On another note, we will consider ability to read parameters from calibration.cal as suggested.

Kind Regards,
Celray James Chawanda
Reply all
Reply to author
Forward
0 new messages