From e387ff7caf714d01f528a736c79e9de31d058ca1 Mon Sep 17 00:00:00 2001 From: Emmanuel Branlard Date: Thu, 29 Sep 2022 14:58:01 -0600 Subject: [PATCH] IfW: removing OMP in inflowwind until pointer implemented (see #1265) --- modules/inflowwind/src/IfW_FFWind_Base.f90 | 12 ++++++------ modules/inflowwind/src/IfW_UniformWind.f90 | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/modules/inflowwind/src/IfW_FFWind_Base.f90 b/modules/inflowwind/src/IfW_FFWind_Base.f90 index f3c3f41807..c7d357662f 100644 --- a/modules/inflowwind/src/IfW_FFWind_Base.f90 +++ b/modules/inflowwind/src/IfW_FFWind_Base.f90 @@ -102,8 +102,8 @@ SUBROUTINE IfW_FFWind_CalcOutput(Time, PositionXYZ, p, Velocity, DiskVel, ErrSta ! Step through all the positions and get the velocities - !$OMP PARALLEL default(shared) if(PointNum>1000) - !$OMP do private(PointNum, TmpErrStat, TmpErrMsg ) schedule(runtime) + !OMP PARALLEL default(shared) if(NumPoints>1000) + !OMP do private(PointNum, TmpErrStat, TmpErrMsg ) schedule(runtime) DO PointNum = 1, NumPoints ! Calculate the velocity for the position @@ -111,19 +111,19 @@ SUBROUTINE IfW_FFWind_CalcOutput(Time, PositionXYZ, p, Velocity, DiskVel, ErrSta ! Error handling IF (TmpErrStat /= ErrID_None) THEN ! adding this so we don't have to convert numbers to strings every time - !$OMP CRITICAL ! Needed to avoid data race on ErrStat and ErrMsg + !OMP CRITICAL ! Needed to avoid data race on ErrStat and ErrMsg ErrStat = ErrID_None ErrMsg = "" CALL SetErrStat( TmpErrStat, TmpErrMsg, ErrStat, ErrMsg, RoutineName//" [position=("// & TRIM(Num2LStr(PositionXYZ(1,PointNum)))//", "// & TRIM(Num2LStr(PositionXYZ(2,PointNum)))//", "// & TRIM(Num2LStr(PositionXYZ(3,PointNum)))//") in wind-file coordinates]" ) - !$OMP END CRITICAL + !OMP END CRITICAL END IF ENDDO - !$OMP END DO - !$OMP END PARALLEL + !OMP END DO + !OMP END PARALLEL IF (ErrStat >= AbortErrLev) RETURN ! Return cannot be in parallel loop IF (p%AddMeanAfterInterp) THEN diff --git a/modules/inflowwind/src/IfW_UniformWind.f90 b/modules/inflowwind/src/IfW_UniformWind.f90 index 1bcc76d27c..7fbe884d42 100644 --- a/modules/inflowwind/src/IfW_UniformWind.f90 +++ b/modules/inflowwind/src/IfW_UniformWind.f90 @@ -481,8 +481,8 @@ SUBROUTINE IfW_UniformWind_CalcOutput(Time, PositionXYZ, p, Velocity, DiskVel, m CALL InterpParams(Time, p, m, op) ! Step through all the positions and get the velocities - !$OMP PARALLEL default(shared) if(NumPoints>1000) - !$OMP do private(PointNum, TmpErrStat, TmpErrMsg ) schedule(runtime) + !OMP PARALLEL default(shared) if(NumPoints>1000) + !OMP do private(PointNum, TmpErrStat, TmpErrMsg ) schedule(runtime) DO PointNum = 1, NumPoints ! Calculate the velocity for the position @@ -495,16 +495,16 @@ SUBROUTINE IfW_UniformWind_CalcOutput(Time, PositionXYZ, p, Velocity, DiskVel, m TRIM(Num2LStr(PositionXYZ(1,PointNum)))//", "// & TRIM(Num2LStr(PositionXYZ(2,PointNum)))//", "// & TRIM(Num2LStr(PositionXYZ(3,PointNum)))//") in the wind-file coordinates" - !$OMP CRITICAL ! Needed to avoid data race on ErrStat and ErrMsg + !OMP CRITICAL ! Needed to avoid data race on ErrStat and ErrMsg ErrStat = ErrID_None ErrMsg = "" CALL SetErrStat(TmpErrStat,TmpErrMsg,ErrStat,ErrMsg,RoutineName) - !$OMP END CRITICAL + !OMP END CRITICAL ENDIF ENDDO - !$OMP END DO - !$OMP END PARALLEL + !OMP END DO + !OMP END PARALLEL IF (ErrStat >= AbortErrLev) RETURN ! Return cannot be in parallel loop