Skip to content

Commit f090d87

Browse files
committed
TurbSim: move a deallocate outside the OMP loop
This may break on some compilers since it is a private internal var to the OMP loop that I now deallocate outside instead of inside the loop. Not sure how that's going to work out
1 parent 1637f4a commit f090d87

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

modules/turbsim/src/TSsubs.f90

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -205,14 +205,15 @@ SUBROUTINE CalcFourierCoeffs_IEC( p, U, PhaseAngles, S, V, TRH_in, ErrStat, ErrM
205205
CALL H2Coeffs( IVec, IFreq, TRH, PhaseAngles, V, p%grid%NPoints )
206206
endif
207207

208-
#ifdef _OPENMP
209-
if (allocated(TRH_lcl)) deallocate(TRH_lcl)
210-
#endif
211-
212-
213208
END DO !IFreq
214209
!$OMP END PARALLEL DO
215210

211+
#ifdef _OPENMP
212+
! This might be playing with fire to move this outside the OMP parallel. Not sure if all compilers will
213+
! like it since this is supposed to be a private var in the OMP loop only
214+
if (allocated(TRH_lcl)) deallocate(TRH_lcl)
215+
#endif
216+
216217
if (OMPerr) then
217218
call Cleanup()
218219
return

0 commit comments

Comments
 (0)