Skip to content

Commit

Permalink
Merge pull request OpenFAST#1869 from andrew-platt/b/IfW_UniformCheck…
Browse files Browse the repository at this point in the history
…TimeVector
  • Loading branch information
deslaughter authored Nov 11, 2023
2 parents fc08556 + 624b7a0 commit ae56ab1
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions modules/inflowwind/src/InflowWind_IO.f90
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ subroutine IfW_UniformWind_Init(InitInp, SumFileUnit, UF, FileDat, ErrStat, ErrM
call SetErrStat(ErrID_Fatal, TmpErrMsg, ErrStat, ErrMsg, RoutineName)
end if
end do
if (ErrStat >= AbortErrLev) return

!----------------------------------------------------------------------------
! Find out information on the timesteps and range
Expand All @@ -277,6 +278,24 @@ subroutine IfW_UniformWind_Init(InitInp, SumFileUnit, UF, FileDat, ErrStat, ErrM
WindFileDT = 0.0_ReKi
end if

!----------------------------------------------------------------------------
! Check that time is always increasing
!----------------------------------------------------------------------------

! Check that last timestep is always increasing
if (UF%DataSize > 2) then
do I = 2, UF%DataSize
if (UF%Time(I)<=UF%Time(I-1)) then
TmpErrMsg = ' Time vector must always increase in the uniform wind file. Error around wind step ' &
//TRIM(Num2LStr(I))//' at time '//TRIM(Num2LStr(UF%Time(I)))//' in wind file ' &
//TRIM(InitInp%WindFileName)//'.'
call SetErrStat(ErrID_Fatal, TmpErrMsg, ErrStat, ErrMsg, RoutineName)
exit
endif
end do
if (ErrStat >= AbortErrLev) return
endif

!----------------------------------------------------------------------------
! Store wind file metadata
!----------------------------------------------------------------------------
Expand Down

0 comments on commit ae56ab1

Please sign in to comment.