Skip to content

Initilization error and VTK outputs prevents a clean abort #250

@ebranlard

Description

@ebranlard

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
   endif

I'll send a pull request later that fixes this if people agree.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions