Skip to content

Commit

Permalink
nwtclibs: add name to all OMP critical sections
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-platt committed Dec 5, 2024
1 parent 8b72ddc commit bb07073
Showing 1 changed file with 16 additions and 16 deletions.
32 changes: 16 additions & 16 deletions modules/nwtc-library/src/NWTC_IO.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2332,7 +2332,7 @@ SUBROUTINE OpenBInpFile ( Un, InFile, ErrStat, ErrMsg )
END IF

! Open input file. Make sure it worked.
!$OMP critical
!$OMP critical(openfile)
if (Un<=0) call GetNewUnit(Un,ErrStat,ErrMsg)
if (ErrStat==ErrID_None) then
OPEN( Un, FILE=TRIM( InFile ), STATUS='OLD', FORM='UNFORMATTED', ACCESS='STREAM', IOSTAT=ErrStat, ACTION='READ' )
Expand All @@ -2345,7 +2345,7 @@ SUBROUTINE OpenBInpFile ( Un, InFile, ErrStat, ErrMsg )
ErrMsg = ''
END IF
endif
!$OMP end critical
!$OMP end critical(openfile)

RETURN
END SUBROUTINE OpenBInpFile
Expand All @@ -2364,7 +2364,7 @@ SUBROUTINE OpenBOutFile ( Un, OutFile, ErrStat, ErrMsg )
ErrMsg = ""

! Open output file. Make sure it worked.
!$OMP critical
!$OMP critical(openfile)
if (Un<=0) call GetNewUnit(Un,ErrStat,ErrMsg)
if (ErrStat==ErrID_None) then
OPEN( Un, FILE=TRIM( OutFile ), STATUS='UNKNOWN', FORM='UNFORMATTED' , ACCESS='STREAM', IOSTAT=ErrStat, ACTION='WRITE' )
Expand All @@ -2378,7 +2378,7 @@ SUBROUTINE OpenBOutFile ( Un, OutFile, ErrStat, ErrMsg )
ErrMsg = ''
END IF
endif
!$OMP end critical
!$OMP end critical(openfile)

RETURN
END SUBROUTINE OpenBOutFile
Expand Down Expand Up @@ -2442,7 +2442,7 @@ SUBROUTINE OpenFInpFile ( Un, InFile, ErrStat, ErrMsg )
ELSE

! Open input file. Make sure it worked.
!$OMP critical
!$OMP critical(openfile)
if (Un<=0) call GetNewUnit(Un,ErrStat,ErrMsg)
if (ErrStat==ErrID_None) then
OPEN( Un, FILE=TRIM( InFile ), STATUS='OLD', FORM='FORMATTED', IOSTAT=IOS, ACTION='READ' )
Expand All @@ -2451,7 +2451,7 @@ SUBROUTINE OpenFInpFile ( Un, InFile, ErrStat, ErrMsg )
CALL SetErrStat( ErrID_Fatal, 'Cannot open file "'//TRIM( InFile )//'".', ErrStat,ErrMsg,RoutineName)
END IF
endif
!$OMP end critical
!$OMP end critical(openfile)

END IF

Expand All @@ -2474,7 +2474,7 @@ SUBROUTINE OpenFOutFile ( Un, OutFile, ErrStat, ErrMsg )
ErrMsg = ""

! Open output file. Make sure it worked.
!$OMP critical
!$OMP critical(openfile)
if (Un<=0) call GetNewUnit(Un,ErrStat,ErrMsg)
if (ErrStat==ErrID_None) then
OPEN( Un, FILE=TRIM( OutFile ), STATUS='UNKNOWN', FORM='FORMATTED', IOSTAT=IOS, ACTION="WRITE" )
Expand All @@ -2488,7 +2488,7 @@ SUBROUTINE OpenFOutFile ( Un, OutFile, ErrStat, ErrMsg )
ErrMsg = ""
END IF
endif
!$OMP end critical
!$OMP end critical(openfile)

RETURN
END SUBROUTINE OpenFOutFile
Expand All @@ -2514,7 +2514,7 @@ SUBROUTINE OpenFUnkFile ( Un, OutFile, FailAbt, Failed, Exists, ErrStat, ErrMsg
INQUIRE ( FILE=TRIM( OutFile ) , EXIST=Exists )

! Open output file. Make sure it worked.
!$OMP critical
!$OMP critical(openfile)
if (Un<=0) call GetNewUnit(Un,ErrStat,ErrMsg)
if (ErrStat==ErrID_None) then
OPEN( Un, FILE=TRIM( OutFile ), STATUS='UNKNOWN', FORM='FORMATTED', IOSTAT=IOS )
Expand All @@ -2530,7 +2530,7 @@ SUBROUTINE OpenFUnkFile ( Un, OutFile, FailAbt, Failed, Exists, ErrStat, ErrMsg
ErrMsg = ''
END IF
endif
!$OMP end critical
!$OMP end critical(openfile)

RETURN
END SUBROUTINE OpenFUnkFile
Expand All @@ -2553,7 +2553,7 @@ SUBROUTINE OpenFUnkFileAppend ( Un, OutFile, ErrStat, ErrMsg )
inquire(file=TRIM( OutFile ), exist=FileExists)

! Open output file. Make sure it worked.
!$OMP critical
!$OMP critical(openfile)
if (Un<=0) call GetNewUnit(Un,ErrStat2,ErrMsg2)
if (ErrStat2/=ErrID_None) then
IF ( PRESENT(ErrStat) ) ErrStat = ErrStat2
Expand Down Expand Up @@ -2581,7 +2581,7 @@ SUBROUTINE OpenFUnkFileAppend ( Un, OutFile, ErrStat, ErrMsg )
IF ( PRESENT(ErrMsg) ) ErrMsg = ""
END IF
endif
!$OMP end critical
!$OMP end critical(openfile)

RETURN
END SUBROUTINE OpenFUnkFileAppend ! ( Un, OutFile [, ErrStat] [, ErrMsg] )
Expand Down Expand Up @@ -2646,7 +2646,7 @@ SUBROUTINE OpenUInfile ( Un, InFile, ErrStat, ErrMsg )
END IF

! Open the file.
!$OMP critical
!$OMP critical(openfile)
if (Un<=0) call GetNewUnit(Un,ErrStat,ErrMsg)
if (ErrStat==ErrID_None) then
OPEN ( Un, FILE=TRIM( InFile ), STATUS='UNKNOWN', FORM=UnfForm, ACCESS='SEQUENTIAL', IOSTAT=IOS, ACTION='READ' )
Expand All @@ -2659,7 +2659,7 @@ SUBROUTINE OpenUInfile ( Un, InFile, ErrStat, ErrMsg )
ErrMsg = ''
END IF
endif
!$OMP end critical
!$OMP end critical(openfile)

RETURN
END SUBROUTINE OpenUInfile
Expand All @@ -2679,7 +2679,7 @@ SUBROUTINE OpenUOutfile ( Un, OutFile, ErrStat, ErrMsg )
ErrMsg = ""

! Open the file.
!$OMP critical
!$OMP critical(openfile)
if (Un<=0) call GetNewUnit(Un,ErrStat,ErrMsg)
if (ErrStat==ErrID_None) then
OPEN ( Un, FILE=TRIM( OutFile ), STATUS='UNKNOWN', FORM=UnfForm, ACCESS='SEQUENTIAL', IOSTAT=IOS, ACTION='WRITE' )
Expand All @@ -2692,7 +2692,7 @@ SUBROUTINE OpenUOutfile ( Un, OutFile, ErrStat, ErrMsg )
ErrMsg = ''
END IF
endif
!$OMP end critical
!$OMP end critical(openfile)

RETURN
END SUBROUTINE OpenUOutfile
Expand Down

0 comments on commit bb07073

Please sign in to comment.