SamUL Error Catching

2 posts / 0 new
Last post
SamUL Error Catching

I have an script to batch model simulations for a group of weather files. Some of the weather files do not have sufficient data to run the model and SAM produces a pop-up error. Is there a way to catch this error and allow the script to continue without needing to click the close button?


Paul Gilman

Hi Ben,

For now (as of SAM 2013.1.15) the Simulate() function does not return a value, so you cannot use it to catch simulation errors.

The MPSimulate() function returns false when a simulation fails. It is intended for multi-processor simulations, but in its current form can run more slowly than Simulate().

See the Multiprocessing script in the sample file SamUL Samples.zsam for an example of how to use MPSimulate().

Best regards,

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer