Skip to content

Commit

Permalink
BREAKS OF: reduced tolerance for mode shape coefficients
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhar-abbas committed Feb 21, 2022
1 parent 9ed8101 commit b997533
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions OpenFAST/modules/elastodyn/src/ElastoDyn_IO.f90
Original file line number Diff line number Diff line change
Expand Up @@ -4714,19 +4714,26 @@ SUBROUTINE ValidateModeShapeCoeffs( Coeffs, ShpDesc, ErrStat, ErrMsg )
CHARACTER(*), INTENT(IN) :: ShpDesc !< Description of the mode shape for the error message
INTEGER(IntKi), INTENT(OUT) :: ErrStat !< Error status
CHARACTER(*), INTENT(OUT) :: ErrMsg !< Error message

! local variables
REAL(ReKi) :: Displ ! Blade tip/tower top displacement for a mode shape
REAL(ReKi) :: tol


! Check that the mode shape coefficients add to 1.0:

Displ = SUM( Coeffs )
! bjj this new check seems to be a bit too restrictive for the input data:
! IF ( .NOT. EqualRealNos( Displ, 1.0_ReKi ) ) THEN
IF ( ABS( Displ - 1.0_ReKi ) > 0.0015_ReKi ) THEN
IF (maxval( Coeffs ) > 1e4_ReKi )THEN ! Large coefficients might cause problems with precision
tol = 0.01_ReKi
ELSE
tol = 0.0015_ReKi
ENDIF

IF ( ABS( Displ - 1.0_ReKi ) > tol ) THEN
ErrStat = ErrID_Fatal
ErrMsg = ' Mode shape coefficients for '//TRIM(ShpDesc)//' must add to 1.0.'
ErrMsg = ' Mode shape coefficients for '//TRIM(ShpDesc)//' must add to 1.0 but they equal'//TRIM( Num2LStr( Displ ))//'.'
ELSE
ErrStat = ErrID_None
ErrMsg = ''
Expand Down

0 comments on commit b997533

Please sign in to comment.