Skip to content

Commit

Permalink
Fix segfault for DBEMT_Mod==DBEMT_Frozen
Browse files Browse the repository at this point in the history
DBEMT_Init wasn't getting called
  • Loading branch information
andrew-platt committed Sep 18, 2024
1 parent 8ef7198 commit 7305adb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion modules/aerodyn/src/BEMT.f90
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ subroutine BEMT_Init( InitInp, u, p, x, xd, z, OtherState, AFInfo, y, misc, Inte
if (errStat >= AbortErrLev) return

InitInp_DBEMT%DBEMT_Mod = p%DBEMT_Mod
if ( p%DBEMT_Mod > DBEMT_none ) then
if ( p%DBEMT_Mod > DBEMT_none .or. p%DBEMT_Mod == DBEMT_Frozen ) then
InitInp_DBEMT%DBEMT_Mod = p%DBEMT_Mod
InitInp_DBEMT%numBlades = p%numBlades
InitInp_DBEMT%numNodes = p%numBladeNodes
Expand Down
10 changes: 6 additions & 4 deletions modules/aerodyn/src/DBEMT.f90
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,11 @@ subroutine DBEMT_ValidateInitInp(interval, InitInp, errStat, errMsg)
errMsg = ""

if ( interval <= sqrt(epsilon(1.0_ReKi)) ) call SetErrStat( ErrID_Fatal, " The timestep size for DBEMT (interval) must be larger than sqrt(epsilon).", ErrStat, ErrMsg, RoutineName)
if ( (InitInp%DBEMT_Mod .ne. DBEMT_tauConst) .and. (InitInp%DBEMT_Mod .ne. DBEMT_tauVaries) .and. (InitInp%DBEMT_Mod .ne. DBEMT_cont_tauConst)) then
call SetErrStat( ErrID_Fatal, " DBEMT_Mod must be set to 1, 2, or 3.", ErrStat, ErrMsg, RoutineName)
end if
select case(InitInp%DBEMT_Mod)
case (DBEMT_frozen, DBEMT_tauConst, DBEMT_tauVaries, DBEMT_cont_tauConst)
case default
call SetErrStat( ErrID_Fatal, " DBEMT_Mod must be set to -1, 1, 2, or 3.", ErrStat, ErrMsg, RoutineName)
end select

if (InitInp%numBlades < 1) call SetErrStat( ErrID_Fatal, " InitInp%numBlades must set to 1 or more.", ErrStat, ErrMsg, RoutineName)
if (InitInp%numNodes < 2) call SetErrStat( ErrID_Fatal, " InitInp%numNodes must set to 2 or more.", ErrStat, ErrMsg, RoutineName)
Expand Down Expand Up @@ -922,4 +924,4 @@ subroutine DBEMT_End( u, p, x, OtherState, m, ErrStat, ErrMsg )

END SUBROUTINE DBEMT_End

end module DBEMT
end module DBEMT

0 comments on commit 7305adb

Please sign in to comment.