Unset variable causes crash but not set in any generated code

3 posts / 0 new
Last post
Unset variable causes crash but not set in any generated code

I am using the SAM SDK (ver. 186) to run a basic model via the JNI in a Java web servlet environment (wind/levpartflip with default parameters). However, I cannot get it to run; it crashes with the following notice message form the SAM SDK:

SAM module log [levpartflip;-1.0] [NOTICE]: precheck input: variable 'gen' required but not assigned

Furthermore, when examining generated code/input from SAM itself (2017.9.5) running a similar model, I see no sign of a 'gen' variable. I thus find it impossible to intuit what this variable is used for, how it should be set, or why it must be set.

Any guidance would be appreciated.

Edit: Only a few minutes after completing this post, I tried running the SAM simulation again and it, for whatever reason and without any changes to code or data, works. Very bizarre. I'll update again if I encounter the same issue.

Paul Gilman

The 'gen' variable is the hourly or subhourly electrical output of the system over one year. It is an output of each of SAM's performance models (Detailed PV, PVWatts, Physical Trough, etc.) and an input to the financial models.

Best regards,


I see. The issue, then, was likely not running the performance module before the finance module. Thank you for the reply.

Theme by Danetsoft and Danang Probo Sayekti inspired by Maksimer