Skip to content

Commit

Permalink
Remove extra GetNewUnit calls from AD14
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-platt committed Nov 28, 2024
1 parent fcdc634 commit 981512c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
12 changes: 2 additions & 10 deletions modules/aerodyn14/src/AeroSubs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ SUBROUTINE AD14_GetInput(InitInp, P, x, xd, z, m, y, ErrStat, ErrMess )
ErrStat = ErrID_None
ErrMess = ''

! Function definition

call GetNewUnit(UnIn, ErrStatLcl, ErrMessLcl)

!-------------------------------------------------------------------------------------------------
! Open the AeroDyn input file
!-------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -747,9 +743,6 @@ SUBROUTINE ADOut(InitInp, P, m, AD14_Ver, FileName, ErrStat, ErrMess )
ErrStat = ErrID_None
ErrMess = ""

! Function definition

CALL GetNewUnit( UnOut, ErrStat, ErrMess )
CALL OpenFOutFile( UnOut, FileName, ErrStatLcl, ErrMessLcl)
CALL SetErrStat(ErrStatLcl,ErrMessLcl,ErrStat,ErrMess,'ADOut' )
IF ( ErrStat >= AbortErrLev ) THEN
Expand Down Expand Up @@ -1026,7 +1019,6 @@ SUBROUTINE READFL(InitInp, P, x, xd, z, m, y, ErrStat, ErrMess )
ErrStat = ErrID_None
ErrMess = ""

CALL GetNewUnit(NUNIT, ErrStat, ErrMess)
p%AirFoil%NumCL = 0

! The first loop checks existence and file length to set NumCL
Expand Down Expand Up @@ -1372,7 +1364,7 @@ SUBROUTINE READTwr(UnIn, InitInp, P, x, xd, z, m, y, ErrStat, ErrMess )
!====================================================================================================
IMPLICIT NONE
! Passed Variables:
INTEGER, INTENT(IN) :: UnIn
INTEGER, INTENT(INOUT) :: UnIn
TYPE(AD14_InitInputType), INTENT(INOUT) :: InitInp
TYPE(AD14_ParameterType), INTENT(INOUT) :: p ! Parameters
TYPE(AD14_ContinuousStateType), INTENT(INOUT) :: x ! Initial continuous states
Expand Down Expand Up @@ -4465,7 +4457,7 @@ SUBROUTINE DynDebug (Time, P, x, xd, z, m, y, ErrStat, ErrMess, RHScos, RHSsin)

INTEGER :: i
INTEGER :: NumOut
INTEGER, PARAMETER :: UnDyn = 80
INTEGER :: UnDyn

CHARACTER(50) :: Frmt

Expand Down
2 changes: 0 additions & 2 deletions modules/aerodyn14/src/GenSubs.f90
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,6 @@ SUBROUTINE ElemOpen (ElemFile, P, m, ErrStat, ErrMsg, AD14_Ver )


IF (m%ElOut%NumWndElOut > 0) THEN
CALL GetNewUnit(P%UnWndOut)
CALL OpenFOutFile (P%UnWndOut, TRIM(ElemFile)//'.wind', ErrStat, ErrMsg)
IF (ErrStat /= ErrID_None) RETURN
WRITE (P%UnWndOut,"( 'This file was generated by ' , A , ' on ' , A , ' at ' , A , '.' )") &
Expand All @@ -440,7 +439,6 @@ SUBROUTINE ElemOpen (ElemFile, P, m, ErrStat, ErrMsg, AD14_Ver )

! Open the Element Print file if requested
IF (p%ELEMPRN) THEN
CALL GetNewUnit(P%UnElem)
CALL OpenFOutFile (p%UnElem, TRIM(ElemFile), ErrStat, ErrMsg)
IF (ErrStat >= AbortErrLev) RETURN
WRITE (p%UnElem,"(/, 'This file was generated by ' , A , ' on ' , A , ' at ' , A , '.' )") &
Expand Down

0 comments on commit 981512c

Please sign in to comment.