Ignore:
Timestamp:
Oct 14, 2020 11:22:04 AM (4 years ago)
Author:
suehring
Message:

Bugfix in OpenMP directives - intel compiler do not allow reduction operations on array elements

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/pres.f90

    r4719 r4740  
    2525! -----------------
    2626! $Id$
     27! Bugfix in OpenMP directives - intel compiler do not allow reduction operations on array elements
     28!
     29! 4719 2020-10-01 11:28:33Z pavelkrc
    2730! Bugfix of previous commit (div_old discrepancy)
    2831!
     
    674677!-- Sum up the volume flow through the right and north boundary
    675678    IF ( conserve_volume_flow  .AND.  bc_lr_cyc  .AND.  bc_ns_cyc  .AND.  nxr == nx )  THEN
    676 
    677        !$OMP PARALLEL DO PRIVATE (j,k) REDUCTION (+:volume_flow_l(1))
     679       threadsum = 0.0_wp
     680!
     681!--    Summation of the volume flow is done on threadsum rather than on volumen_flow itself.
     682!--    This is because intel compiler, when compiled with openmp, do not allow reduction
     683!--    operation on array elements.
     684       !$OMP PARALLEL DO PRIVATE (j,k) REDUCTION (+:threadsum)
    678685       DO  j = nys, nyn
    679686          DO  k = nzb+1, nzt
    680              volume_flow_l(1) = volume_flow_l(1) + u(k,j,nxr) * dzw(k)                             &
     687             threadsum = threadsum + u(k,j,nxr) * dzw(k)                             &
    681688                                * MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_total_0(k,j,nxr), 1 ) )
    682689          ENDDO
    683690       ENDDO
     691       volume_flow_l(1) = threadsum
    684692
    685693    ENDIF
    686694
    687695    IF ( conserve_volume_flow  .AND.  bc_ns_cyc  .AND.  bc_lr_cyc  .AND. nyn == ny )  THEN
    688 
    689        !$OMP PARALLEL DO PRIVATE (i,k) REDUCTION (+:volume_flow_l(2))
     696       threadsum = 0.0_wp
     697       !$OMP PARALLEL DO PRIVATE (j,k) REDUCTION (+:threadsum)
    690698       DO  i = nxl, nxr
    691699          DO  k = nzb+1, nzt
    692              volume_flow_l(2) = volume_flow_l(2) + v(k,nyn,i) * dzw(k)                             &
     700             threadsum = threadsum + v(k,nyn,i) * dzw(k)                             &
    693701                                * MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_total_0(k,nyn,i), 2 ) )
    694702           ENDDO
    695703       ENDDO
     704       volume_flow_l(2) = threadsum
    696705
    697706    ENDIF
Note: See TracChangeset for help on using the changeset viewer.