Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add !$ OMP critical around file opening for VTK #2340

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions modules/nwtc-library/src/VTK.f90
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,10 @@ 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 @@ -358,8 +360,10 @@ 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 )
CALL OpenFOutFile ( Un, TRIM(FileName), ErrStat, ErrMsg )
!$OMP end critical
if (ErrStat >= AbortErrLev) return

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