Skip to content

Commit

Permalink
Merge pull request #2226 from ndevelder/extloadsfix-dev
Browse files Browse the repository at this point in the history
Fix turbine indexing on ExtLoads Restart
  • Loading branch information
andrew-platt authored May 20, 2024
2 parents d1f17a2 + 232bc39 commit 6f2928e
Showing 1 changed file with 6 additions and 2 deletions.
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

0 comments on commit 6f2928e

Please sign in to comment.