Skip to content

Commit

Permalink
Remove extra GetNewUnit calls from VTK.f90
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-platt committed Dec 5, 2024
1 parent 8167a45 commit 8b72ddc
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions modules/nwtc-library/src/VTK.f90
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ SUBROUTINE WrVTK_header( FileName, NumberOfPoints, NumberOfLines, NumberOfPolys,
INTEGER(IntKi) , INTENT( OUT) :: ErrStat !< error level/status of OpenFOutFile operation
CHARACTER(*) , INTENT( OUT) :: ErrMsg !< message when error occurs

CALL GetNewUnit( Un, ErrStat, ErrMsg )
Un = -1
CALL OpenFOutFile ( Un, TRIM(FileName), ErrStat, ErrMsg )
if (ErrStat >= AbortErrLev) return

Expand Down Expand Up @@ -158,10 +158,7 @@ SUBROUTINE ReadVTK_SP_info( FileName, descr, dims, origin, gridSpacing, vecLabel
closeOnReturn = .FALSE.
END IF

!$OMP critical
CALL GetNewUnit( Un, ErrStat, ErrMsg )
CALL OpenFInpFile ( Un, TRIM(FileName), ErrStat, ErrMsg )
!$OMP end critical
if (ErrStat >= AbortErrLev) return

CALL ReadCom( Un, FileName, 'File header: Module Version (line 1)', ErrStat2, ErrMsg2, 0 )
Expand Down Expand Up @@ -360,10 +357,8 @@ SUBROUTINE WrVTK_SP_header( FileName, descr, Un, ErrStat, ErrMsg )
INTEGER(IntKi) , INTENT( OUT) :: ErrStat !< error level/status of OpenFOutFile operation
CHARACTER(*) , INTENT( OUT) :: ErrMsg !< message when error occurs

!$OMP critical
CALL GetNewUnit( Un, ErrStat, ErrMsg )
Un = -1
CALL OpenFOutFile ( Un, TRIM(FileName), ErrStat, ErrMsg )
!$OMP end critical
if (ErrStat >= AbortErrLev) return

WRITE(Un,'(A)') '# vtk DataFile Version 3.0'
Expand Down

0 comments on commit 8b72ddc

Please sign in to comment.