Skip to content

Commit

Permalink
Fix HydroDyn summary file nodal data is incorrect when Member is flip…
Browse files Browse the repository at this point in the history
…ped (#998)

* HD: fix summary file nodal data (Closes #990)

* HD: fix size of node index
  • Loading branch information
ebranlard authored Feb 15, 2022
1 parent acfc500 commit ddba7a6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions modules/hydrodyn/src/Morison.f90
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ SUBROUTINE WriteSummaryFile( UnSum, g, MSL2SWL, WtrDpth, numJoints, numNodes, no
INTEGER, INTENT ( OUT ) :: errStat ! returns a non-zero value when an error occurs
CHARACTER(*), INTENT ( OUT ) :: errMsg ! Error message if errStat /= ErrID_None

INTEGER :: I, J
INTEGER :: I, J, II
REAL(ReKi) :: l ! length of an element
LOGICAL :: filledFlag ! flag indicating if element is filled/flooded
CHARACTER(2) :: strFmt
Expand Down Expand Up @@ -811,7 +811,12 @@ SUBROUTINE WriteSummaryFile( UnSum, g, MSL2SWL, WtrDpth, numJoints, numNodes, no
! need to add MSL2SWL offset from this because the Positons are relative to SWL, but we should report them relative to MSL here
pos = nodes(c)%Position
pos(3) = pos(3) + MSL2SWL
write( UnSum, '(1X,I5,(2X,I10),3(2X,F10.4),4(2X,ES10.3),2(6X,L6),7(2X,ES10.3),3(7x,A5))' ) c, members(j)%MemberID, pos, members(j)%R(i), members(j)%R(i)-members(j)%Rin(i), members(j)%tMG(i), members(j)%MGdensity(i), members(j)%PropPot, fillFlag, members(j)%m_fb_u(i)+members(j)%m_fb_l(i), members(j)%Cd(i), members(j)%Ca(i), members(j)%Cp(i), members(j)%AxCd(i), members(j)%AxCa(i), members(j)%AxCp(i), ' - ', ' - ', ' - '
if (members(j)%flipped) then
II=members(j)%NElements+2-I
else
II=I
endif
write( UnSum, '(1X,I5,(2X,I10),3(2X,F10.4),4(2X,ES10.3),2(6X,L6),7(2X,ES10.3),3(7x,A5))' ) c, members(j)%MemberID, pos, members(j)%R(ii), members(j)%R(ii)-members(j)%Rin(ii), members(j)%tMG(ii), members(j)%MGdensity(ii), members(j)%PropPot, fillFlag, members(j)%m_fb_u(ii)+members(j)%m_fb_l(ii), members(j)%Cd(ii), members(j)%Ca(ii), members(j)%Cp(ii), members(j)%AxCd(ii), members(j)%AxCa(ii), members(j)%AxCp(ii), ' - ', ' - ', ' - '
end do
end do

Expand Down Expand Up @@ -1267,7 +1272,7 @@ subroutine AllocateMemberDataArrays( member, memberLoads, errStat, errMsg )

errStat = ErrID_None
errMSg = ''
call AllocAry(member%NodeIndx , member%NElements, 'member%NodeIndx' , errStat2, errMsg2); call SetErrStat(errStat2, errMsg2, errStat, errMsg, routineName)
call AllocAry(member%NodeIndx , member%NElements+1, 'member%NodeIndx' , errStat2, errMsg2); call SetErrStat(errStat2, errMsg2, errStat, errMsg, routineName)
call AllocAry(member%dRdl_mg , member%NElements, 'member%dRdl_mg' , errStat2, errMsg2); call SetErrStat(errStat2, errMsg2, errStat, errMsg, routineName)
call AllocAry(member%dRdl_in , member%NElements, 'member%dRdl_in' , errStat2, errMsg2); call SetErrStat(errStat2, errMsg2, errStat, errMsg, routineName)
call AllocAry(member%floodstatus , member%NElements, 'member%floodstatus' , errStat2, errMsg2); call SetErrStat(errStat2, errMsg2, errStat, errMsg, routineName)
Expand Down

0 comments on commit ddba7a6

Please sign in to comment.