Changeset 4740
- Timestamp:
- Oct 14, 2020 11:22:04 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SOURCE/pres.f90
r4719 r4740 25 25 ! ----------------- 26 26 ! $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 27 30 ! Bugfix of previous commit (div_old discrepancy) 28 31 ! … … 674 677 !-- Sum up the volume flow through the right and north boundary 675 678 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) 678 685 DO j = nys, nyn 679 686 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) & 681 688 * MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_total_0(k,j,nxr), 1 ) ) 682 689 ENDDO 683 690 ENDDO 691 volume_flow_l(1) = threadsum 684 692 685 693 ENDIF 686 694 687 695 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) 690 698 DO i = nxl, nxr 691 699 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) & 693 701 * MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_total_0(k,nyn,i), 2 ) ) 694 702 ENDDO 695 703 ENDDO 704 volume_flow_l(2) = threadsum 696 705 697 706 ENDIF
Note: See TracChangeset
for help on using the changeset viewer.