From 6ba3391522f9c42f77d93d8bcb92c60ddd35d9b1 Mon Sep 17 00:00:00 2001 From: Bonnie Jonkman Date: Wed, 26 Jul 2023 10:02:26 -0600 Subject: [PATCH] Linear trim solution: add error check Since the trim solution seems to always converge on the first step when NLinTimes == 1 (see https://github.com/OpenFAST/openfast/issues/857), I added a warning and overwrite NLinTimes to be 2 instead. This should be removed when #857 is fixed --- modules/openfast-library/src/FAST_Subs.f90 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/openfast-library/src/FAST_Subs.f90 b/modules/openfast-library/src/FAST_Subs.f90 index 945a5926de..f2a4adc393 100644 --- a/modules/openfast-library/src/FAST_Subs.f90 +++ b/modules/openfast-library/src/FAST_Subs.f90 @@ -3254,6 +3254,12 @@ SUBROUTINE FAST_ReadPrimaryFile( InputFile, p, m_FAST, OverrideAbortErrLev, ErrS RETURN end if + ! temporary work-around for error with CalcSteady + if (p%CalcSteady .and. p%NLinTimes == 1 ) then + call SetErrStat(ErrID_Info, "Setting NLinTimes to 2 to avoid problem with CalcSteady with only one time.", ErrStat,ErrMsg,RoutineName) + p%NLinTimes = 2 + end if + ! LinInputs - Include inputs in linearization (switch) {0=none; 1=standard; 2=all module inputs (debug)} CALL ReadVar( UnIn, InputFile, p%LinInputs, "LinInputs", "Include inputs in linearization (switch) {0=none; 1=standard; 2=all module inputs (debug)}", ErrStat2, ErrMsg2, UnEc) CALL SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)