Skip to content

Commit

Permalink
Merge pull request #1802 from andrew-platt/f/SD_99outs
Browse files Browse the repository at this point in the history
Increase SubDyn output to allow NMOutputs up to 99
  • Loading branch information
andrew-platt authored Oct 11, 2023
2 parents 51afbb1 + bd1edc9 commit 0b5fe67
Show file tree
Hide file tree
Showing 4 changed files with 32,916 additions and 3,690 deletions.
2 changes: 1 addition & 1 deletion modules/subdyn/src/SubDyn.f90
Original file line number Diff line number Diff line change
Expand Up @@ -1352,7 +1352,7 @@ SUBROUTINE SD_Input(SDInputFile, Init, p, ErrStat,ErrMsg)
CALL ReadCom ( UnIn, SDInputFile, ' Member Output List SECTION ',ErrStat2, ErrMsg2, UnEc ); if(Failed()) return
CALL ReadIVar( UnIn, SDInputFile, p%NMOutputs, 'NMOutputs', 'Number of Members whose output must go into OutJckF and/or FAST .out',ErrStat2, ErrMsg2, UnEc )
if (Failed()) return
IF (Check ( (p%NMOutputs < 0) .OR. (p%NMOutputs > p%NMembers) .OR. (p%NMOutputs > 9), 'NMOutputs must be >=0 and <= minimim(NMembers,9)')) return
IF (Check ( (p%NMOutputs < 0) .OR. (p%NMOutputs > p%NMembers) .OR. (p%NMOutputs > 99), 'NMOutputs must be >=0 and <= minimim(NMembers,99)')) return

CALL ReadCom( UnIn, SDInputFile, ' Output Member Headers',ErrStat2, ErrMsg2, UnEc) ; if(Failed()) return
CALL ReadCom( UnIn, SDInputFile, ' Output Member Units' ,ErrStat2, ErrMsg2, UnEc) ; if(Failed()) return
Expand Down
17 changes: 11 additions & 6 deletions modules/subdyn/src/SubDyn_Output.f90
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ MODULE SubDyn_Output
USE NWTC_Library
USE SubDyn_Types
USE SD_FEM
USE SubDyn_Output_Params, only: MNfmKe, MNfmMe, MNTDss, MNRDe, MNTRAe, IntfSS, IntfTRss, IntfTRAss, ReactSS
USE SubDyn_Output_Params, only: MNfmKe, MNfmMe, MNTDss, MNRDe, MNTRAe, IntfSS, IntfTRss, IntfTRAss, ReactSS, OutStrLenM1
USE SubDyn_Output_Params, only: ParamIndxAry, ParamUnitsAry, ValidParamAry, SSqm01, SSqmd01, SSqmdd01

IMPLICIT NONE

! The maximum number of output channels which can be output by the code.
INTEGER(IntKi),PUBLIC, PARAMETER :: MaxOutPts = 2265
INTEGER(IntKi),PUBLIC, PARAMETER :: MaxOutPts = 21705

PRIVATE
! ..... Public Subroutines ...................................................................................................
Expand Down Expand Up @@ -702,7 +702,7 @@ SUBROUTINE SDOut_ChkOutLst( OutList, p, ErrStat, ErrMsg )
InvalidOutput(SSqmdd01+k-1) = .true.
END DO

DO I=1,9
DO I=1,99
!I know el # and whether it is 1st node or second node
if (I <= p%NMOutputs) then
INDX=p%MOutLst(I)%NOutCnt+1
Expand Down Expand Up @@ -757,22 +757,27 @@ SUBROUTINE SDOut_ChkOutLst( OutList, p, ErrStat, ErrMsg )
p%OutParam(I)%SignM = -1 ! ex, '-TipDxc1' causes the sign of TipDxc1 to be switched.
OutListTmp = OutListTmp(2:)
ELSE IF ( INDEX( 'mM', OutListTmp(1:1) ) > 0 ) THEN ! We'll assume this is a variable name for now, (if not, we will check later if OutListTmp(2:) is also a variable name)
CheckOutListAgain = .TRUE.
CheckOutListAgain = .TRUE.
p%OutParam(I)%SignM = 1
ELSE
p%OutParam(I)%SignM = 1
END IF

if ( INDEX( 'mM', OutListTmp(1:1) ) > 0 .and. INDEX( '0123456789', OutListTmp(2:2) ) > 0 .and. INDEX( 'nN', OutListTmp(3:3) ) > 0 ) then ! an old-style output without the leading zero on the member number
OutListTmp = OutListTmp(1:1)//'0'//OutListTmp(2:)
CheckOutListAgain = .FALSE.
end if

CALL Conv2UC( OutListTmp ) ! Convert OutListTmp to upper case


Indx = IndexCharAry( OutListTmp(1:9), ValidParamAry )
Indx = IndexCharAry( OutListTmp(1:OutStrLenM1), ValidParamAry )

IF ( CheckOutListAgain .AND. Indx < 1 ) THEN ! Let's assume that "M" really meant "minus" and then test again
p%OutParam(I)%SignM = -1 ! ex, 'MTipDxc1' causes the sign of TipDxc1 to be switched.
OutListTmp = OutListTmp(2:)

Indx = IndexCharAry( OutListTmp(1:9), ValidParamAry )
Indx = IndexCharAry( OutListTmp(1:10), ValidParamAry )
END IF

IF ( Indx > 0 ) THEN
Expand Down
Loading

0 comments on commit 0b5fe67

Please sign in to comment.