-
Notifications
You must be signed in to change notification settings - Fork 518
Closed
Labels
Description
Bug description
If an error occurs during the fast library initialization, the routine ExitThisProgram is called, which then attempts to write the mesh for debugging if WrVTK>0. The issue is that y_FAST%NOutSteps might be zero, and then the program will crash on the following statement Twidth = int(log10(real(y_FAST%NOutSteps))) + 1 .
To Reproduce
Try to trigger an error at initialization (e.g. by reproducing #249), and set WrVTK to on.
Expected behavior
The program should abort nicely.
Suggested solution
The calls to log10 in FAST_Subs.f90 should be protected as follows:
if (y_FAST%NOutSteps==0) then
CALL SetErrStat( ErrID_Warn,'NOutStep is zero, setting Twidth to 1',ErrStat2,ErrMsg2,RoutineName)
Twidth = 1
else
Twidth = int(log10(real(y_FAST%NOutSteps))) + 1
endifI'll send a pull request later that fixes this if people agree.
Reactions are currently unavailable