Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IfW: check that uniform wind file time vector is always increasing #1869

Merged
merged 1 commit into from
Nov 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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