Skip to content

Commit

Permalink
IfW: check that uniform wind file time vector is always increasing
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-platt committed Nov 10, 2023
1 parent fc08556 commit 624b7a0
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 624b7a0

Please sign in to comment.