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

Fix turbine indexing on ExtLoads Restart #2226

Merged
merged 1 commit into from
May 20, 2024
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
8 changes: 6 additions & 2 deletions modules/openfast-library/src/FAST_Library.f90
Original file line number Diff line number Diff line change
Expand Up @@ -955,15 +955,15 @@ subroutine FAST_ExtInfw_Restart(iTurb_c, CheckpointRootName_c, AbortErrLev_c, dt

end subroutine FAST_ExtInfw_Restart
!==================================================================================================================================
subroutine FAST_ExtLoads_Restart(iTurb, CheckpointRootName_c, AbortErrLev_c, dt_c, numblades_c, &
subroutine FAST_ExtLoads_Restart(iTurb_c, CheckpointRootName_c, AbortErrLev_c, dt_c, numblades_c, &
n_t_global_c, ExtLd_Input_from_FAST, ExtLd_Parameter_from_FAST, ExtLd_Output_to_FAST, &
SC_DX_Input_from_FAST, SC_DX_Output_to_FAST, ErrStat_c, ErrMsg_c) BIND (C, NAME='FAST_ExtLoads_Restart')
IMPLICIT NONE
#ifndef IMPLICIT_DLLEXPORT
!DEC$ ATTRIBUTES DLLEXPORT :: FAST_ExtLoads_Restart
!GCC$ ATTRIBUTES DLLEXPORT :: FAST_ExtLoads_Restart
#endif
INTEGER(C_INT), INTENT(IN ) :: iTurb ! Turbine number
INTEGER(C_INT), INTENT(IN ) :: iTurb_c ! Turbine number
CHARACTER(KIND=C_CHAR), INTENT(IN ) :: CheckpointRootName_c(IntfStrLen)
INTEGER(C_INT), INTENT( OUT) :: AbortErrLev_c
INTEGER(C_INT), INTENT( OUT) :: numblades_c
Expand All @@ -985,8 +985,12 @@ subroutine FAST_ExtLoads_Restart(iTurb, CheckpointRootName_c, AbortErrLev_c, dt_
REAL(DbKi) :: t_initial_out
INTEGER(IntKi) :: NumTurbines_out
INTEGER(IntKi) :: CompLoadsType
integer(IntKi) :: iTurb ! turbine number: Fortran indexing (starts at 1 for first turbine)
CHARACTER(*), PARAMETER :: RoutineName = 'FAST_Restart'

! transfer turbine index number from C to Fortran indexing (0 to 1 start)
iTurb = int(iTurb_c,IntKi) + 1

CALL NWTC_Init()
! transfer the character array from C to a Fortran string:
CheckpointRootName = TRANSFER( CheckpointRootName_c, CheckpointRootName )
Expand Down