Skip to content

Commit

Permalink
Remove DBG_OUTS from AD15
Browse files Browse the repository at this point in the history
This will reduce merge conflicts with PR OpenFAST#373
  • Loading branch information
andrew-platt committed Jun 26, 2020
1 parent 86dc893 commit 06161b0
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 330 deletions.
108 changes: 1 addition & 107 deletions modules/aerodyn/src/AeroDyn.f90
Original file line number Diff line number Diff line change
Expand Up @@ -83,13 +83,8 @@ subroutine AD_SetInitOut(p, InputFileData, InitOut, errStat, errMsg)

integer(IntKi) :: i, j, k, f
integer(IntKi) :: NumCoords
#ifdef DBG_OUTS
integer(IntKi) :: m
character(6) ::chanPrefix
character(3) :: TmpChar
#endif
! Initialize variables for this routine

! Initialize variables for this routine
errStat = ErrID_None
errMsg = ""

Expand All @@ -103,86 +98,10 @@ subroutine AD_SetInitOut(p, InputFileData, InitOut, errStat, errMsg)

if (ErrStat >= AbortErrLev) return


#ifdef DBG_OUTS
! Loop over blades and nodes to populate the output channel names and units

do k=1,p%numBlades
do j=1, p%NumBlNds

m = (k-1)*p%NumBlNds*p%NBlOuts + (j-1)*p%NBlOuts

WRITE (TmpChar,'(I3.3)') j
chanPrefix = "B"//trim(num2lstr(k))//"N"//TmpChar
InitOut%WriteOutputHdr( m + 1 ) = trim(chanPrefix)//"Twst"
InitOut%WriteOutputUnt( m + 1 ) = ' (deg) '
InitOut%WriteOutputHdr( m + 2 ) = trim(chanPrefix)//"Psi"
InitOut%WriteOutputUnt( m + 2 ) = ' (deg) '
InitOut%WriteOutputHdr( m + 3 ) = trim(chanPrefix)//"Vx"
InitOut%WriteOutputUnt( m + 3 ) = ' (m/s) '
InitOut%WriteOutputHdr( m + 4 ) = trim(chanPrefix)//"Vy"
InitOut%WriteOutputUnt( m + 4 ) = ' (m/s) '
InitOut%WriteOutputHdr( m + 5 ) = ' '//trim(chanPrefix)//"AIn"
InitOut%WriteOutputUnt( m + 5 ) = ' (-) '
InitOut%WriteOutputHdr( m + 6 ) = ' '//trim(chanPrefix)//"ApIn"
InitOut%WriteOutputUnt( m + 6 ) = ' (-) '
InitOut%WriteOutputHdr( m + 7 ) = trim(chanPrefix)//"Vrel"
InitOut%WriteOutputUnt( m + 7 ) = ' (m/s) '
InitOut%WriteOutputHdr( m + 8 ) = ' '//trim(chanPrefix)//"Phi"
InitOut%WriteOutputUnt( m + 8 ) = ' (deg) '
InitOut%WriteOutputHdr( m + 9 ) = ' '//trim(chanPrefix)//"AOA"
InitOut%WriteOutputUnt( m + 9 ) = ' (deg) '
InitOut%WriteOutputHdr( m + 10 ) = ' '//trim(chanPrefix)//"Cl"
InitOut%WriteOutputUnt( m + 10 ) = ' (-) '
InitOut%WriteOutputHdr( m + 11 ) = ' '//trim(chanPrefix)//"Cd"
InitOut%WriteOutputUnt( m + 11 ) = ' (-) '
InitOut%WriteOutputHdr( m + 12 ) = ' '//trim(chanPrefix)//"Cm"
InitOut%WriteOutputUnt( m + 12 ) = ' (-) '
InitOut%WriteOutputHdr( m + 13 ) = ' '//trim(chanPrefix)//"Cx"
InitOut%WriteOutputUnt( m + 13 ) = ' (-) '
InitOut%WriteOutputHdr( m + 14 ) = ' '//trim(chanPrefix)//"Cy"
InitOut%WriteOutputUnt( m + 14 ) = ' (-) '
InitOut%WriteOutputHdr( m + 15 ) = ' '//trim(chanPrefix)//"Cn"
InitOut%WriteOutputUnt( m + 15 ) = ' (-) '
InitOut%WriteOutputHdr( m + 16 ) = ' '//trim(chanPrefix)//"Ct"
InitOut%WriteOutputUnt( m + 16 ) = ' (-) '
InitOut%WriteOutputHdr( m + 17 ) = ' '//trim(chanPrefix)//"Fl"
InitOut%WriteOutputUnt( m + 17 ) = ' (N/m) '
InitOut%WriteOutputHdr( m + 18 ) = ' '//trim(chanPrefix)//"Fd"
InitOut%WriteOutputUnt( m + 18 ) = ' (N/m) '
InitOut%WriteOutputHdr( m + 19 ) = ' '//trim(chanPrefix)//"M"
InitOut%WriteOutputUnt( m + 19 ) = ' (N/m^2) '
InitOut%WriteOutputHdr( m + 20 ) = ' '//trim(chanPrefix)//"Fx"
InitOut%WriteOutputUnt( m + 20 ) = ' (N/m) '
InitOut%WriteOutputHdr( m + 21 ) = ' '//trim(chanPrefix)//"Fy"
InitOut%WriteOutputUnt( m + 21 ) = ' (N/m) '
InitOut%WriteOutputHdr( m + 22 ) = ' '//trim(chanPrefix)//"Fn"
InitOut%WriteOutputUnt( m + 22 ) = ' (N/m) '
InitOut%WriteOutputHdr( m + 23 ) = ' '//trim(chanPrefix)//"Ft"
InitOut%WriteOutputUnt( m + 23 ) = ' (N/m) '
InitOut%WriteOutputHdr( m + 24 ) = ' '//trim(chanPrefix)//"Gam"
InitOut%WriteOutputUnt( m + 24 ) = ' (m^2/s) '
InitOut%WriteOutputHdr( m + 25 ) = ' '//trim(chanPrefix)//"Uin"
InitOut%WriteOutputUnt( m + 25 ) = ' (m/s) '
InitOut%WriteOutputHdr( m + 26 ) = ' '//trim(chanPrefix)//"Uit"
InitOut%WriteOutputUnt( m + 26 ) = ' (m/s) '
InitOut%WriteOutputHdr( m + 27 ) = ' '//trim(chanPrefix)//"Uir"
InitOut%WriteOutputUnt( m + 27 ) = ' (m/s) '
InitOut%WriteOutputHdr( m + 28 ) = ' '//trim(chanPrefix)//"Clst"
InitOut%WriteOutputUnt( m + 28 ) = ' (-) '
InitOut%WriteOutputHdr( m + 29 ) = ' '//trim(chanPrefix)//"Cdst"
InitOut%WriteOutputUnt( m + 29 ) = ' (-) '
InitOut%WriteOutputHdr( m + 30 ) = ' '//trim(chanPrefix)//"Cmst"
InitOut%WriteOutputUnt( m + 30 ) = ' (-) '

end do
end do
#else
do i=1,p%NumOuts
InitOut%WriteOutputHdr(i) = p%OutParam(i)%Name
InitOut%WriteOutputUnt(i) = p%OutParam(i)%Units
end do
#endif


InitOut%Ver = AD_Ver
Expand Down Expand Up @@ -320,9 +239,6 @@ subroutine AD_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitOut
! Display the module information

call DispNVD( AD_Ver )
#ifdef DBG_OUTS
call WrScr(' - Compiled with DBG_OUTS')
#endif


p%NumBlades = InitInp%NumBlades ! need this before reading the AD input file so that we know how many blade files to read
Expand Down Expand Up @@ -564,11 +480,7 @@ subroutine Init_MiscVars(m, p, u, y, errStat, errMsg)
m%SigmaCavitCrit = 0.0_ReKi
m%CavitWarnSet = .false.
! arrays for output
#ifdef DBG_OUTS
allocate( m%AllOuts(0:p%NumOuts), STAT=ErrStat2 ) ! allocate starting at zero to account for invalid output channels
#else
allocate( m%AllOuts(0:MaxOutPts), STAT=ErrStat2 ) ! allocate starting at zero to account for invalid output channels
#endif
if (ErrStat2 /= 0) then
call SetErrStat( ErrID_Fatal, "Error allocating AllOuts.", errStat, errMsg, RoutineName )
return
Expand Down Expand Up @@ -1026,12 +938,6 @@ subroutine SetParameters( InitInp, InputFileData, p, ErrStat, ErrMsg )

!p%RootName = TRIM(InitInp%RootName)//'.AD' ! set earlier to it could be used

#ifdef DBG_OUTS
p%NBlOuts = 30
p%numOuts = p%NumBlNds*p%NumBlades*p%NBlOuts
p%NTwOuts = 0

#else
p%numOuts = InputFileData%NumOuts
p%NBlOuts = InputFileData%NBlOuts
p%BlOutNd = InputFileData%BlOutNd
Expand All @@ -1047,7 +953,6 @@ subroutine SetParameters( InitInp, InputFileData, p, ErrStat, ErrMsg )
call setErrStat(ErrStat2,ErrMsg2,ErrStat,ErrMsg,RoutineName)
if (ErrStat >= AbortErrLev) return

#endif

end subroutine SetParameters
!----------------------------------------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -1296,24 +1201,15 @@ subroutine AD_CalcOutput( t, u, p, x, xd, z, OtherState, y, m, ErrStat, ErrMsg )
! get values to output to file:
!-------------------------------------------------------
if (p%NumOuts > 0) then
#ifdef DBG_OUTS
call Calc_WriteDbgOutput( p, u, m, y, OtherState, xd, ErrStat2, ErrMsg2 )
#else
call Calc_WriteOutput( p, u, m, y, OtherState, xd, indx, ErrStat2, ErrMsg2 )
#endif
call SetErrStat(ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)

!...............................................................................................................................
! Place the selected output channels into the WriteOutput(:) array with the proper sign:
!...............................................................................................................................

do i = 1,p%NumOuts ! Loop through all selected output channels
#ifdef DBG_OUTS
y%WriteOutput(i) = m%AllOuts( i )
#else
y%WriteOutput(i) = p%OutParam(i)%SignM * m%AllOuts( p%OutParam(i)%Indx )
#endif

end do ! i - All selected output channels

end if
Expand Down Expand Up @@ -1586,9 +1482,7 @@ subroutine GeomWithoutSweepPitchTwist(p,u,m,thetaBladeNds,ErrStat,ErrMsg)
call LAPACK_gemm( 'n', 't', 1.0_R8Ki, u%BladeRootMotion(k)%Orientation(:,:,1), u%HubMotion%Orientation(:,:,1), 0.0_R8Ki, orientation, errStat2, errMsg2)
call SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)
theta = EulerExtract( orientation ) !hub_theta_root(k)
#ifndef DBG_OUTS
m%AllOuts( BPitch( k) ) = -theta(3)*R2D ! save this value of pitch for potential output
#endif
theta(3) = 0.0_ReKi
m%hub_theta_x_root(k) = theta(1) ! save this value for FAST.Farm

Expand Down
Loading

0 comments on commit 06161b0

Please sign in to comment.