From 7305adb6707b635a40833d0b164a476e68d2a82d Mon Sep 17 00:00:00 2001 From: andrew-platt Date: Wed, 18 Sep 2024 13:33:28 -0600 Subject: [PATCH] Fix segfault for DBEMT_Mod==DBEMT_Frozen DBEMT_Init wasn't getting called --- modules/aerodyn/src/BEMT.f90 | 2 +- modules/aerodyn/src/DBEMT.f90 | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/modules/aerodyn/src/BEMT.f90 b/modules/aerodyn/src/BEMT.f90 index b312f64b6..f1eb5b1b9 100644 --- a/modules/aerodyn/src/BEMT.f90 +++ b/modules/aerodyn/src/BEMT.f90 @@ -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 diff --git a/modules/aerodyn/src/DBEMT.f90 b/modules/aerodyn/src/DBEMT.f90 index 0dc4a55e5..4b8d001d0 100644 --- a/modules/aerodyn/src/DBEMT.f90 +++ b/modules/aerodyn/src/DBEMT.f90 @@ -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) @@ -922,4 +924,4 @@ subroutine DBEMT_End( u, p, x, OtherState, m, ErrStat, ErrMsg ) END SUBROUTINE DBEMT_End -end module DBEMT \ No newline at end of file +end module DBEMT