 Timestamp:
 Aug 27, 2020 7:17:45 AM (2 months ago)
 Location:
 palm/trunk/SOURCE
 Files:

 3 edited
Legend:
 Unmodified
 Added
 Removed

palm/trunk/SOURCE/fft_xy_mod.f90
r4646 r4651 24 24 !  25 25 ! $Id$ 26 ! preprocessor branch for ibm removed 27 ! 28 ! 4646 20200824 16:02:40Z raasch 26 29 ! file reformatted to follow the PALM coding standard 27 30 ! … … 99 102 REAL(wp), DIMENSION(:,:), ALLOCATABLE, SAVE :: f_vec_x 100 103 101 #if defined( __ibm ) 102 INTEGER(iwp), PARAMETER :: nau1 = 20000 !< 103 INTEGER(iwp), PARAMETER :: nau2 = 22000 !< 104 ! 105 ! The following working arrays contain tables and have to be "save" and shared in OpenMP sense 106 REAL(wp), DIMENSION(nau1), SAVE :: aux1 !< 107 REAL(wp), DIMENSION(nau1), SAVE :: auy1 !< 108 REAL(wp), DIMENSION(nau1), SAVE :: aux3 !< 109 REAL(wp), DIMENSION(nau1), SAVE :: auy3 !< 110 111 #elif defined( __nec_fft ) 104 #if defined( __nec_fft ) 112 105 INTEGER(iwp), SAVE :: nz1 !< 113 106 … … 189 182 ! The following temporary working arrays have to be on stack or private 190 183 ! in OpenMP sense 191 #if defined( __ibm ) 192 REAL(wp), DIMENSION(nau2) :: aux2 !< 193 REAL(wp), DIMENSION(nau2) :: auy2 !< 194 REAL(wp), DIMENSION(nau2) :: aux4 !< 195 REAL(wp), DIMENSION(nau2) :: auy4 !< 196 REAL(wp), DIMENSION(0:nx+2) :: workx !< 197 REAL(wp), DIMENSION(0:ny+2) :: worky !< 198 #elif defined( __nec_fft ) 184 #if defined( __nec_fft ) 199 185 REAL(wp), DIMENSION(0:nx+3,nz+1) :: work_x !< 200 186 REAL(wp), DIMENSION(0:ny+3,nz+1) :: work_y !< … … 228 214 sqr_dnx = SQRT( dnx ) 229 215 sqr_dny = SQRT( dny ) 230 #if defined( __ibm ) 231 ! 232 ! Initialize tables for fft along x 233 CALL DRCFT( 1, workx, 1, workx, 1, nx+1, 1, 1, sqr_dnx, aux1, nau1, aux2, nau2 ) 234 CALL DCRFT( 1, workx, 1, workx, 1, nx+1, 1, 1, sqr_dnx, aux3, nau1, aux4, nau2 ) 235 ! 236 ! Initialize tables for fft along y 237 CALL DRCFT( 1, worky, 1, worky, 1, ny+1, 1, 1, sqr_dny, auy1, nau1, auy2, nau2 ) 238 CALL DCRFT( 1, worky, 1, worky, 1, ny+1, 1, 1, sqr_dny, auy3, nau1, auy4, nau2 ) 239 #elif defined( __nec_fft ) 216 217 #if defined( __nec_fft ) 240 218 message_string = 'fft method "' // TRIM( fft_method) // '" currently does not work on NEC' 241 219 CALL message( 'fft_init', 'PA0187', 1, 2, 0, 6, 0 ) … … 350 328 REAL(wp), DIMENSION(nys_x:nyn_x,nzb_x:nzt_x,0:nx), OPTIONAL :: ar_inv !< 351 329 352 #if defined( __ibm ) 353 REAL(wp), DIMENSION(nau2) :: aux2 !< 354 REAL(wp), DIMENSION(nau2) :: aux4 !< 355 #elif defined( __nec_fft ) 330 #if defined( __nec_fft ) 356 331 REAL(wp), DIMENSION(6*(nx+1)) :: work2 !< 357 332 #elif defined( __cuda_fft ) … … 643 618 ELSEIF ( fft_method == 'systemspecific' ) THEN 644 619 645 #if defined( __ibm ) 646 IF ( forward_fft ) THEN 647 648 !$OMP PARALLEL PRIVATE ( work, i, j, k ) 649 !$OMP DO 650 DO k = nzb_x, nzt_x 651 DO j = nys_x, nyn_x 652 653 CALL DRCFT( 0, ar, 1, work, 1, nx+1, 1, 1, sqr_dnx, aux1, nau1, aux2, nau2 ) 654 655 DO i = 0, (nx+1)/2 656 ar(i,j,k) = work(2*i) 657 ENDDO 658 DO i = 1, (nx+1)/2  1 659 ar(nx+1i,j,k) = work(2*i+1) 660 ENDDO 661 662 ENDDO 663 ENDDO 664 !$OMP END PARALLEL 665 666 ELSE 667 668 !$OMP PARALLEL PRIVATE ( work, i, j, k ) 669 !$OMP DO 670 DO k = nzb_x, nzt_x 671 DO j = nys_x, nyn_x 672 673 DO i = 0, (nx+1)/2 674 work(2*i) = ar(i,j,k) 675 ENDDO 676 DO i = 1, (nx+1)/2  1 677 work(2*i+1) = ar(nx+1i,j,k) 678 ENDDO 679 work(1) = 0.0_wp 680 work(nx+2) = 0.0_wp 681 682 CALL DCRFT( 0, work, 1, work, 1, nx+1, 1, 1, sqr_dnx, aux3, nau1, aux4, nau2 ) 683 684 DO i = 0, nx 685 ar(i,j,k) = work(i) 686 ENDDO 687 688 ENDDO 689 ENDDO 690 !$OMP END PARALLEL 691 692 ENDIF 693 694 #elif defined( __nec_fft ) 620 #if defined( __nec_fft ) 695 621 696 622 IF ( forward_fft ) THEN … … 822 748 COMPLEX(wp), DIMENSION(:), ALLOCATABLE :: cwork !< 823 749 824 #if defined( __ibm ) 825 REAL(wp), DIMENSION(nau2) :: aux2 !< 826 REAL(wp), DIMENSION(nau2) :: aux4 !< 827 #elif defined( __nec_fft ) 750 #if defined( __nec_fft ) 828 751 REAL(wp), DIMENSION(6*(nx+1)) :: work2 !< 829 752 #endif … … 940 863 ELSEIF ( fft_method == 'systemspecific' ) THEN 941 864 942 #if defined( __ibm ) 943 IF ( forward_fft ) THEN 944 945 CALL DRCFT( 0, ar, 1, work, 1, nx+1, 1, 1, sqr_dnx, aux1, nau1, aux2, nau2 ) 946 947 DO i = 0, (nx+1)/2 948 ar(i) = work(2*i) 949 ENDDO 950 DO i = 1, (nx+1)/2  1 951 ar(nx+1i) = work(2*i+1) 952 ENDDO 953 954 ELSE 955 956 DO i = 0, (nx+1)/2 957 work(2*i) = ar(i) 958 ENDDO 959 DO i = 1, (nx+1)/2  1 960 work(2*i+1) = ar(nx+1i) 961 ENDDO 962 work(1) = 0.0_wp 963 work(nx+2) = 0.0_wp 964 965 CALL DCRFT( 0, work, 1, work, 1, nx+1, 1, 1, sqr_dnx, aux3, nau1, aux4, nau2 ) 966 967 DO i = 0, nx 968 ar(i) = work(i) 969 ENDDO 970 971 ENDIF 972 #elif defined( __nec_fft ) 865 #if defined( __nec_fft ) 973 866 IF ( forward_fft ) THEN 974 867 … … 1061 954 COMPLEX(wp), DIMENSION(:), ALLOCATABLE :: cwork !< 1062 955 1063 #if defined( __ibm ) 1064 REAL(wp), DIMENSION(nau2) :: auy2 !< 1065 REAL(wp), DIMENSION(nau2) :: auy4 !< 1066 #elif defined( __nec_fft ) 956 #if defined( __nec_fft ) 1067 957 REAL(wp), DIMENSION(6*(ny+1)) :: work2 !< 1068 958 #elif defined( __cuda_fft ) … … 1347 1237 ELSEIF ( fft_method == 'systemspecific' ) THEN 1348 1238 1349 #if defined( __ibm ) 1350 IF ( forward_fft) THEN 1351 1352 !$OMP PARALLEL PRIVATE ( work, i, j, k ) 1353 !$OMP DO 1354 DO k = nzb_y, nzt_y 1355 DO i = nxl_y_l, nxr_y_l 1356 1357 CALL DRCFT( 0, ar, 1, work, 1, ny+1, 1, 1, sqr_dny, auy1, nau1, auy2, nau2 ) 1358 1359 DO j = 0, (ny+1)/2 1360 ar_tr(j,i,k) = work(2*j) 1361 ENDDO 1362 DO j = 1, (ny+1)/2  1 1363 ar_tr(ny+1j,i,k) = work(2*j+1) 1364 ENDDO 1365 1366 ENDDO 1367 ENDDO 1368 !$OMP END PARALLEL 1369 1370 ELSE 1371 1372 !$OMP PARALLEL PRIVATE ( work, i, j, k ) 1373 !$OMP DO 1374 DO k = nzb_y, nzt_y 1375 DO i = nxl_y_l, nxr_y_l 1376 1377 DO j = 0, (ny+1)/2 1378 work(2*j) = ar_tr(j,i,k) 1379 ENDDO 1380 DO j = 1, (ny+1)/2  1 1381 work(2*j+1) = ar_tr(ny+1j,i,k) 1382 ENDDO 1383 work(1) = 0.0_wp 1384 work(ny+2) = 0.0_wp 1385 1386 CALL DCRFT( 0, work, 1, work, 1, ny+1, 1, 1, sqr_dny, auy3, nau1, auy4, nau2 ) 1387 1388 DO j = 0, ny 1389 ar(j,i,k) = work(j) 1390 ENDDO 1391 1392 ENDDO 1393 ENDDO 1394 !$OMP END PARALLEL 1395 1396 ENDIF 1397 #elif defined( __nec_fft ) 1239 #if defined( __nec_fft ) 1398 1240 IF ( forward_fft ) THEN 1399 1241 … … 1523 1365 COMPLEX(wp), DIMENSION(:), ALLOCATABLE :: cwork !< 1524 1366 1525 #if defined( __ibm ) 1526 REAL(wp), DIMENSION(nau2) :: auy2 !< 1527 REAL(wp), DIMENSION(nau2) :: auy4 !< 1528 #elif defined( __nec_fft ) 1367 #if defined( __nec_fft ) 1529 1368 REAL(wp), DIMENSION(6*(ny+1)) :: work2 !< 1530 1369 #endif … … 1643 1482 ELSEIF ( fft_method == 'systemspecific' ) THEN 1644 1483 1645 #if defined( __ibm ) 1646 IF ( forward_fft ) THEN 1647 1648 CALL DRCFT( 0, ar, 1, work, 1, ny+1, 1, 1, sqr_dny, auy1, nau1, auy2, nau2 ) 1649 1650 DO j = 0, (ny+1)/2 1651 ar(j) = work(2*j) 1652 ENDDO 1653 DO j = 1, (ny+1)/2  1 1654 ar(ny+1j) = work(2*j+1) 1655 ENDDO 1656 1657 ELSE 1658 1659 DO j = 0, (ny+1)/2 1660 work(2*j) = ar(j) 1661 ENDDO 1662 DO j = 1, (ny+1)/2  1 1663 work(2*j+1) = ar(ny+1j) 1664 ENDDO 1665 work(1) = 0.0_wp 1666 work(ny+2) = 0.0_wp 1667 1668 CALL DCRFT( 0, work, 1, work, 1, ny+1, 1, 1, sqr_dny, auy3, nau1, auy4, nau2 ) 1669 1670 DO j = 0, ny 1671 ar(j) = work(j) 1672 ENDDO 1673 1674 ENDIF 1675 #elif defined( __nec_fft ) 1484 #if defined( __nec_fft ) 1676 1485 IF ( forward_fft ) THEN 1677 1486 
palm/trunk/SOURCE/global_min_max.f90
r4646 r4651 23 23 !  24 24 ! $Id$ 25 ! preprocessor branch for ibm removed 26 ! 27 ! 4646 20200824 16:02:40Z raasch 25 28 ! file reformatted to follow the PALM coding standard 26 29 ! … … 86 89 REAL(wp), OPTIONAL :: value1 !< 87 90 88 REAL(wp) :: ar(i1:i2,j1:j2,k1:k2) !<89 90 #if defined( __ibm )91 REAL(sp) :: fmax(2) !<92 REAL(sp) :: fmax_l(2) !<93 REAL(sp) :: fmin(2) !<94 REAL(sp) :: fmin_l(2) !<95 ! on 32bitmachines MPI_2REAL must not be replaced96 ! by MPI_2DOUBLE_PRECISION97 #else98 91 REAL(wp), DIMENSION(2) :: fmax !< 99 92 REAL(wp), DIMENSION(2) :: fmax_l !< 100 93 REAL(wp), DIMENSION(2) :: fmin !< 101 94 REAL(wp), DIMENSION(2) :: fmin_l !< 102 #endif 95 96 REAL(wp), DIMENSION(i1:i2,j1:j2,k1:k2) :: ar !< 103 97 104 98 #if defined( _OPENACC ) 
palm/trunk/SOURCE/pres.f90
r4649 r4651 25 25 !  26 26 ! $Id$ 27 ! preprocessor branch for ibm removed 28 ! 29 ! 4649 20200825 12:11:17Z raasch 27 30 ! File reformatted to follow the PALM coding standard 28 31 ! … … 384 387 threadsum = 0.0_wp 385 388 386 #if defined( __ibm )387 !$OMP PARALLEL PRIVATE (i,j,k) FIRSTPRIVATE(threadsum) REDUCTION(+:localsum)388 !$OMP DO SCHEDULE( STATIC )389 DO i = nxl, nxr390 DO j = nys, nyn391 DO k = nzb+1, nzt392 d(k,j,i) = ( ( u(k,j,i+1)  u(k,j,i) ) * rho_air(k) * ddx + &393 ( v(k,j+1,i)  v(k,j,i) ) * rho_air(k) * ddy + &394 ( w(k,j,i) * rho_air_zw(k)  w(k1,j,i) * rho_air_zw(k1) ) &395 * ddzw(k) ) * ddt_3d * d_weight_pres &396 * MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_total_0(k,j,i), 0 ) )397 ENDDO398 !399 ! Compute possible PEsum of divergences for flow_statistics400 DO k = nzb+1, nzt401 threadsum = threadsum + ABS( d(k,j,i) ) &402 * MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_total_0(k,j,i), 0 ) )403 ENDDO404 405 ENDDO406 ENDDO407 408 IF ( intermediate_timestep_count == intermediate_timestep_count_max .OR. &409 intermediate_timestep_count == 0 ) THEN410 localsum = localsum + threadsum * dt_3d * weight_pres_l411 ENDIF412 !$OMP END PARALLEL413 #else414 415 389 !$OMP PARALLEL PRIVATE (i,j,k) 416 390 !$OMP DO SCHEDULE( STATIC ) … … 451 425 !$OMP END PARALLEL 452 426 ENDIF 453 #endif454 427 455 428 ! … … 788 761 789 762 !$OMP PARALLEL PRIVATE (i,j,k) FIRSTPRIVATE(threadsum) REDUCTION(+:localsum) 790 #if defined( __ibm )791 !$OMP DO SCHEDULE( STATIC )792 DO i = nxl, nxr793 DO j = nys, nyn794 DO k = nzb+1, nzt795 d(k,j,i) = ( ( u(k,j,i+1)  u(k,j,i) ) * rho_air(k) * ddx + &796 ( v(k,j+1,i)  v(k,j,i) ) * rho_air(k) * ddy + &797 ( w(k,j,i) * rho_air_zw(k)  w(k1,j,i) * rho_air_zw(k1) ) &798 * ddzw(k) ) &799 * MERGE( 1.0_wp, 0.0_wp, BTEST( wall_flags_total_0(k,j,i), 0 ) )800 ENDDO801 DO k = nzb+1, nzt802 threadsum = threadsum + ABS( d(k,j,i) )803 ENDDO804 ENDDO805 ENDDO806 #else807 763 !$OMP DO SCHEDULE( STATIC ) 808 764 !$ACC PARALLEL LOOP COLLAPSE(3) PRIVATE(i, j, k) & … … 833 789 ENDDO 834 790 ENDDO 835 #endif836 791 837 792 localsum = localsum + threadsum
Note: See TracChangeset
for help on using the changeset viewer.