Skip to content

Commit

Permalink
NodeOuts: fix indexing when invalid channels
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-platt committed Jul 2, 2020
1 parent cf611e3 commit 90012d5
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
11 changes: 10 additions & 1 deletion modules/aerodyn/src/AeroDyn_AllBldNdOuts_IO.f90
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ SUBROUTINE AllBldNdOuts_InitOut( InitOut, p, InputFileData, ErrStat, ErrMsg )

! Populate the header an unit lines for all blades and nodes
! First set a counter so we know where in the output array we are in
! NOTE: we populate invalid names as well (some names are not valid outputs for certain configurations). That means we will have zeros in those values.
INDX = p%NumOuts + 1 ! p%NumOuts is the number of outputs from the normal AeroDyn output. The WriteOutput array is sized to p%NumOuts + num(AllBldNdOuts)

DO IdxChan=1,p%BldNd_NumOuts
Expand Down Expand Up @@ -212,8 +213,16 @@ SUBROUTINE Calc_WriteAllBldNdOutput( p, u, m, y, OtherState, Indx, ErrStat, ErrM

SELECT CASE( p%BldNd_OutParam(IdxChan)%Indx ) ! Indx contains the information on what channel should be output
CASE (0) ! Invalid channel
! We still have headers for invalid channels. Need to account for that
DO IdxBlade=1,p%BldNd_BladesOut
DO IdxNode=1,p%NumBlNds
y%WriteOutput( OutIdx ) = 0.0_ReKi
OutIdx = OutIdx + 1
END DO
END DO
CYCLE
! ***** Undisturbed wind velocity in local blade coord system *****

! ***** Undisturbed wind velocity in local blade coord system *****
CASE ( BldNd_VUndx )
DO IdxBlade=1,p%BldNd_BladesOut
DO IdxNode=1,p%NumBlNds
Expand Down
1 change: 1 addition & 0 deletions modules/beamdyn/src/BeamDyn_BldNdOuts_IO.f90
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ SUBROUTINE BldNdOuts_InitOut( InitOut, p, ErrStat, ErrMsg )

! Populate the header an unit lines for all blades and nodes
! First set a counter so we know where in the output array we are in
! NOTE: we populate invalid names as well (some names are not valid outputs for certain configurations). That means we will have zeros in those values.
INDX = p%NumOuts + 1 ! p%NumOuts is the number of outputs from the normal BeamDyn output. The WriteOutput array is sized to p%NumOuts + num(BldNdOuts)


Expand Down
1 change: 1 addition & 0 deletions modules/elastodyn/src/ElastoDyn_AllBldNdOuts_IO.f90
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ SUBROUTINE AllBldNdOuts_InitOut( InitOut, p, ErrStat, ErrMsg )
ErrStat = ErrID_None

! First set a counter so we know where in the output array we are in
! NOTE: we populate invalid names as well (some names are not valid outputs for certain configurations). That means we will have zeros in those values.
INDX = p%NumOuts + 1 ! p%NumOuts is the number of outputs from the normal ElastoDyn output. The WriteOutput array is sized to p%NumOuts + num(AllBldNdOuts)

! Populate the header and unit lines for all blades and nodes
Expand Down

0 comments on commit 90012d5

Please sign in to comment.