Changeset 4171
 Timestamp:
 Aug 19, 2019 5:44:09 PM (3 years ago)
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

palm/trunk/SOURCE/transpose.f90
r3832 r4171 26 26 ! $Id$ 27 27 ! loop reordering for performance optimization 28 ! 28 ! 29 ! 3832 20190328 13:16:58Z raasch 30 ! loop reordering for performance optimization 31 ! 29 32 ! 3694 20190123 17:01:49Z knoop 30 33 ! OpenACC port for SPEC 31 ! 34 ! 32 35 ! 3241 20180912 15:02:00Z raasch 33 36 ! unused variables removed 34 ! 37 ! 35 38 ! 2718 20180102 08:49:38Z maronga 36 39 ! Corrected "Former revisions" section 37 ! 40 ! 38 41 ! 2696 20171214 17:12:51Z kanani 39 42 ! Change in file header (GPL part) … … 43 46 ! 2118 20170117 16:38:49Z raasch 44 47 ! OpenACC directives removed 45 ! 48 ! 46 49 ! 2000 20160820 18:09:15Z knoop 47 50 ! Forced header and separation lines into 80 columns 48 ! 51 ! 49 52 ! 1682 20151007 23:56:08Z knoop 50 ! Code annotations made doxygen readable 51 ! 53 ! Code annotations made doxygen readable 54 ! 52 55 ! 1324 20140321 09:13:16Z suehring 53 ! Bugfix: ONLY statement for module pegrid removed 56 ! Bugfix: ONLY statement for module pegrid removed 54 57 ! 55 58 ! 1320 20140320 08:40:49Z raasch … … 60 63 ! revision history before 2012 removed, 61 64 ! comment fields (!:) to be used for variable explanations added to 62 ! all variable declaration statements 65 ! all variable declaration statements 63 66 ! 64 67 ! 1318 20140317 13:35:16Z raasch … … 104 107 !! 105 108 SUBROUTINE resort_for_xy( f_in, f_inv ) 106 109 107 110 108 111 USE indices, & … … 116 119 IMPLICIT NONE 117 120 118 REAL(wp) :: f_in(0:nx,nys_x:nyn_x,nzb_x:nzt_x) !< 119 REAL(wp) :: f_inv(nys_x:nyn_x,nzb_x:nzt_x,0:nx) !< 120 121 122 INTEGER(iwp) :: i !< 123 INTEGER(iwp) :: j !< 124 INTEGER(iwp) :: k !< 121 REAL(wp) :: f_in(0:nx,nys_x:nyn_x,nzb_x:nzt_x) !< 122 REAL(wp) :: f_inv(nys_x:nyn_x,nzb_x:nzt_x,0:nx) !< 123 124 125 INTEGER(iwp) :: i !< 126 INTEGER(iwp) :: j !< 127 INTEGER(iwp) :: k !< 125 128 ! 126 129 ! Rearrange indices of input array in order to make data to be send … … 133 136 #endif 134 137 DO k = nzb_x, nzt_x 135 DO i = 0, nx136 DO j = nys_x, nyn_x138 DO j = nys_x, nyn_x 139 DO i = 0, nx 137 140 f_inv(j,k,i) = f_in(i,j,k) 138 141 ENDDO … … 159 162 USE indices, & 160 163 ONLY: nx, ny 161 164 162 165 USE kinds 163 166 … … 169 172 IMPLICIT NONE 170 173 171 INTEGER(iwp) :: i !< 172 INTEGER(iwp) :: j !< 173 INTEGER(iwp) :: k !< 174 INTEGER(iwp) :: l !< 175 INTEGER(iwp) :: ys !< 176 177 REAL(wp) :: f_inv(nys_x:nyn_x,nzb_x:nzt_x,0:nx) !< 178 REAL(wp) :: f_out(0:ny,nxl_y:nxr_y,nzb_y:nzt_y) !< 179 180 REAL(wp), DIMENSION(nyn_xnys_x+1,nzb_y:nzt_y,nxl_y:nxr_y,0:pdims(2)1) :: work !< 174 INTEGER(iwp) :: i !< 175 INTEGER(iwp) :: j !< 176 INTEGER(iwp) :: k !< 177 INTEGER(iwp) :: l !< 178 INTEGER(iwp) :: ys !< 179 180 REAL(wp) :: f_inv(nys_x:nyn_x,nzb_x:nzt_x,0:nx) !< 181 REAL(wp) :: f_out(0:ny,nxl_y:nxr_y,nzb_y:nzt_y) !< 182 183 REAL(wp), DIMENSION(nyn_xnys_x+1,nzb_y:nzt_y,nxl_y:nxr_y,0:pdims(2)1) :: work !< 181 184 #if __acc_fft_device 182 185 !$ACC DECLARE CREATE(work) … … 275 278 IMPLICIT NONE 276 279 277 REAL(wp) :: f_inv(nys:nyn,nxl:nxr,1:nz) !< 278 REAL(wp) :: f_out(1:nz,nys:nyn,nxl:nxr) !< 279 280 INTEGER(iwp) :: i !< 281 INTEGER(iwp) :: j !< 282 INTEGER(iwp) :: k !< 280 REAL(wp) :: f_inv(nys:nyn,nxl:nxr,1:nz) !< 281 REAL(wp) :: f_out(1:nz,nys:nyn,nxl:nxr) !< 282 283 INTEGER(iwp) :: i !< 284 INTEGER(iwp) :: j !< 285 INTEGER(iwp) :: k !< 283 286 ! 284 287 ! Rearrange indices of input array in order to make data to be send … … 292 295 !$ACC PRESENT(f_out, f_inv) 293 296 #endif 294 DO k = 1, nz295 DO i = nxl, nxr296 DO j = nys, nyn297 DO i = nxl, nxr 298 DO j = nys, nyn 299 DO k = 1, nz 297 300 f_out(k,j,i) = f_inv(j,i,k) 298 301 ENDDO … … 329 332 IMPLICIT NONE 330 333 331 INTEGER(iwp) :: i !< 332 INTEGER(iwp) :: j !< 333 INTEGER(iwp) :: k !< 334 INTEGER(iwp) :: l !< 335 INTEGER(iwp) :: xs !< 336 337 REAL(wp) :: f_in(0:nx,nys_x:nyn_x,nzb_x:nzt_x) !< 338 REAL(wp) :: f_inv(nys:nyn,nxl:nxr,1:nz) !< 339 340 REAL(wp), DIMENSION(nys_x:nyn_x,nnx,nzb_x:nzt_x,0:pdims(1)1) :: work !< 334 INTEGER(iwp) :: i !< 335 INTEGER(iwp) :: j !< 336 INTEGER(iwp) :: k !< 337 INTEGER(iwp) :: l !< 338 INTEGER(iwp) :: xs !< 339 340 REAL(wp) :: f_in(0:nx,nys_x:nyn_x,nzb_x:nzt_x) !< 341 REAL(wp) :: f_inv(nys:nyn,nxl:nxr,1:nz) !< 342 343 REAL(wp), DIMENSION(nys_x:nyn_x,nnx,nzb_x:nzt_x,0:pdims(1)1) :: work !< 341 344 #if __acc_fft_device 342 345 !$ACC DECLARE CREATE(work) … … 441 444 IMPLICIT NONE 442 445 443 REAL(wp) :: f_inv(nys_x:nyn_x,nzb_x:nzt_x,0:nx) !< 444 REAL(wp) :: f_out(0:nx,nys_x:nyn_x,nzb_x:nzt_x) !< 445 446 447 INTEGER(iwp) :: i !< 448 INTEGER(iwp) :: j !< 449 INTEGER(iwp) :: k !< 446 REAL(wp) :: f_inv(nys_x:nyn_x,nzb_x:nzt_x,0:nx) !< 447 REAL(wp) :: f_out(0:nx,nys_x:nyn_x,nzb_x:nzt_x) !< 448 449 450 INTEGER(iwp) :: i !< 451 INTEGER(iwp) :: j !< 452 INTEGER(iwp) :: k !< 450 453 ! 451 454 ! Rearrange indices of input array in order to make data to be send … … 457 460 !$ACC PRESENT(f_out, f_inv) 458 461 #endif 459 DO i = 0, nx460 DO k = nzb_x, nzt_x461 DO j = nys_x, nyn_x462 DO k = nzb_x, nzt_x 463 DO j = nys_x, nyn_x 464 DO i = 0, nx 462 465 f_out(i,j,k) = f_inv(j,k,i) 463 466 ENDDO … … 494 497 IMPLICIT NONE 495 498 496 INTEGER(iwp) :: i !< 497 INTEGER(iwp) :: j !< 498 INTEGER(iwp) :: k !< 499 INTEGER(iwp) :: l !< 500 INTEGER(iwp) :: ys !< 501 502 REAL(wp) :: f_in(0:ny,nxl_y:nxr_y,nzb_y:nzt_y) !< 503 REAL(wp) :: f_inv(nys_x:nyn_x,nzb_x:nzt_x,0:nx) !< 504 505 REAL(wp), DIMENSION(nyn_xnys_x+1,nzb_y:nzt_y,nxl_y:nxr_y,0:pdims(2)1) :: work !< 499 INTEGER(iwp) :: i !< 500 INTEGER(iwp) :: j !< 501 INTEGER(iwp) :: k !< 502 INTEGER(iwp) :: l !< 503 INTEGER(iwp) :: ys !< 504 505 REAL(wp) :: f_in(0:ny,nxl_y:nxr_y,nzb_y:nzt_y) !< 506 REAL(wp) :: f_inv(nys_x:nyn_x,nzb_x:nzt_x,0:nx) !< 507 508 REAL(wp), DIMENSION(nyn_xnys_x+1,nzb_y:nzt_y,nxl_y:nxr_y,0:pdims(2)1) :: work !< 506 509 #if __acc_fft_device 507 510 !$ACC DECLARE CREATE(work) … … 611 614 IMPLICIT NONE 612 615 613 INTEGER(iwp) :: i !< 614 INTEGER(iwp) :: j !< 615 INTEGER(iwp) :: k !< 616 INTEGER(iwp) :: l !< 617 INTEGER(iwp) :: m !< 618 INTEGER(iwp) :: xs !< 619 620 REAL(wp) :: f_in(1:nz,nys:nyn,nxl:nxr) !< 621 REAL(wp) :: f_inv(nxl:nxr,1:nz,nys:nyn) !< 622 REAL(wp) :: f_out(0:nx,nys_x:nyn_x,nzb_x:nzt_x) !< 623 REAL(wp) :: work(nnx*nny*nnz) !< 616 INTEGER(iwp) :: i !< 617 INTEGER(iwp) :: j !< 618 INTEGER(iwp) :: k !< 619 INTEGER(iwp) :: l !< 620 INTEGER(iwp) :: m !< 621 INTEGER(iwp) :: xs !< 622 623 REAL(wp) :: f_in(1:nz,nys:nyn,nxl:nxr) !< 624 REAL(wp) :: f_inv(nxl:nxr,1:nz,nys:nyn) !< 625 REAL(wp) :: f_out(0:nx,nys_x:nyn_x,nzb_x:nzt_x) !< 626 REAL(wp) :: work(nnx*nny*nnz) !< 624 627 #if defined( __parallel ) 625 628 … … 683 686 IMPLICIT NONE 684 687 685 REAL(wp) :: f_in(0:ny,nxl_y:nxr_y,nzb_y:nzt_y) !< 686 REAL(wp) :: f_inv(nxl_y:nxr_y,nzb_y:nzt_y,0:ny) !< 687 688 INTEGER(iwp) :: i !< 689 INTEGER(iwp) :: j !< 690 INTEGER(iwp) :: k !< 688 REAL(wp) :: f_in(0:ny,nxl_y:nxr_y,nzb_y:nzt_y) !< 689 REAL(wp) :: f_inv(nxl_y:nxr_y,nzb_y:nzt_y,0:ny) !< 690 691 INTEGER(iwp) :: i !< 692 INTEGER(iwp) :: j !< 693 INTEGER(iwp) :: k !< 691 694 692 695 ! … … 699 702 !$ACC PRESENT(f_inv, f_in) 700 703 #endif 701 DO j = 0, ny702 DO k = nzb_y, nzt_y703 DO i = nxl_y, nxr_y704 DO k = nzb_y, nzt_y 705 DO i = nxl_y, nxr_y 706 DO j = 0, ny 704 707 f_inv(i,k,j) = f_in(j,i,k) 705 708 ENDDO … … 736 739 IMPLICIT NONE 737 740 738 INTEGER(iwp) :: i !< 739 INTEGER(iwp) :: j !< 740 INTEGER(iwp) :: k !< 741 INTEGER(iwp) :: l !< 742 INTEGER(iwp) :: zs !< 743 744 REAL(wp) :: f_inv(nxl_y:nxr_y,nzb_y:nzt_y,0:ny) !< 745 REAL(wp) :: f_out(nxl_z:nxr_z,nys_z:nyn_z,1:nz) !< 746 747 REAL(wp), DIMENSION(nxl_z:nxr_z,nzt_ynzb_y+1,nys_z:nyn_z,0:pdims(1)1) :: work !< 741 INTEGER(iwp) :: i !< 742 INTEGER(iwp) :: j !< 743 INTEGER(iwp) :: k !< 744 INTEGER(iwp) :: l !< 745 INTEGER(iwp) :: zs !< 746 747 REAL(wp) :: f_inv(nxl_y:nxr_y,nzb_y:nzt_y,0:ny) !< 748 REAL(wp) :: f_out(nxl_z:nxr_z,nys_z:nyn_z,1:nz) !< 749 750 REAL(wp), DIMENSION(nxl_z:nxr_z,nzt_ynzb_y+1,nys_z:nyn_z,0:pdims(1)1) :: work !< 748 751 #if __acc_fft_device 749 752 !$ACC DECLARE CREATE(work) … … 843 846 IMPLICIT NONE 844 847 845 REAL(wp) :: f_in(1:nz,nys:nyn,nxl:nxr) !< 846 REAL(wp) :: f_inv(nys:nyn,nxl:nxr,1:nz) !< 847 848 INTEGER(iwp) :: i !< 849 INTEGER(iwp) :: j !< 850 INTEGER(iwp) :: k !< 848 REAL(wp) :: f_in(1:nz,nys:nyn,nxl:nxr) !< 849 REAL(wp) :: f_inv(nys:nyn,nxl:nxr,1:nz) !< 850 851 INTEGER(iwp) :: i !< 852 INTEGER(iwp) :: j !< 853 INTEGER(iwp) :: k !< 851 854 852 855 ! … … 860 863 #endif 861 864 DO i = nxl, nxr 862 DO k = 1,nz863 DO j = nys, nyn865 DO j = nys, nyn 866 DO k = 1,nz 864 867 f_inv(j,i,k) = f_in(k,j,i) 865 868 ENDDO … … 896 899 IMPLICIT NONE 897 900 898 INTEGER(iwp) :: i !< 899 INTEGER(iwp) :: j !< 900 INTEGER(iwp) :: k !< 901 INTEGER(iwp) :: l !< 902 INTEGER(iwp) :: xs !< 903 904 REAL(wp) :: f_inv(nys:nyn,nxl:nxr,1:nz) !< 905 REAL(wp) :: f_out(0:nx,nys_x:nyn_x,nzb_x:nzt_x) !< 906 907 REAL(wp), DIMENSION(nys_x:nyn_x,nnx,nzb_x:nzt_x,0:pdims(1)1) :: work !< 901 INTEGER(iwp) :: i !< 902 INTEGER(iwp) :: j !< 903 INTEGER(iwp) :: k !< 904 INTEGER(iwp) :: l !< 905 INTEGER(iwp) :: xs !< 906 907 REAL(wp) :: f_inv(nys:nyn,nxl:nxr,1:nz) !< 908 REAL(wp) :: f_out(0:nx,nys_x:nyn_x,nzb_x:nzt_x) !< 909 910 REAL(wp), DIMENSION(nys_x:nyn_x,nnx,nzb_x:nzt_x,0:pdims(1)1) :: work !< 908 911 #if __acc_fft_device 909 912 !$ACC DECLARE CREATE(work) … … 1006 1009 IMPLICIT NONE 1007 1010 1008 REAL(wp) :: f_inv(nxl_y:nxr_y,nzb_y:nzt_y,0:ny) !< 1009 REAL(wp) :: f_out(0:ny,nxl_y:nxr_y,nzb_y:nzt_y) !< 1010 1011 1012 INTEGER(iwp) :: i !< 1013 INTEGER(iwp) :: j !< 1014 INTEGER(iwp) :: k !< 1011 REAL(wp) :: f_inv(nxl_y:nxr_y,nzb_y:nzt_y,0:ny) !< 1012 REAL(wp) :: f_out(0:ny,nxl_y:nxr_y,nzb_y:nzt_y) !< 1013 1014 1015 INTEGER(iwp) :: i !< 1016 INTEGER(iwp) :: j !< 1017 INTEGER(iwp) :: k !< 1015 1018 1016 1019 ! … … 1023 1026 !$ACC PRESENT(f_out, f_inv) 1024 1027 #endif 1025 DO j = 0, ny1026 DO k = nzb_y, nzt_y1027 DO i = nxl_y, nxr_y1028 DO k = nzb_y, nzt_y 1029 DO i = nxl_y, nxr_y 1030 DO j = 0, ny 1028 1031 f_out(j,i,k) = f_inv(i,k,j) 1029 1032 ENDDO … … 1060 1063 IMPLICIT NONE 1061 1064 1062 INTEGER(iwp) :: i !< 1063 INTEGER(iwp) :: j !< 1064 INTEGER(iwp) :: k !< 1065 INTEGER(iwp) :: l !< 1066 INTEGER(iwp) :: zs !< 1067 1068 REAL(wp) :: f_in(nxl_z:nxr_z,nys_z:nyn_z,1:nz) !< 1069 REAL(wp) :: f_inv(nxl_y:nxr_y,nzb_y:nzt_y,0:ny) !< 1065 INTEGER(iwp) :: i !< 1066 INTEGER(iwp) :: j !< 1067 INTEGER(iwp) :: k !< 1068 INTEGER(iwp) :: l !< 1069 INTEGER(iwp) :: zs !< 1070 1071 REAL(wp) :: f_in(nxl_z:nxr_z,nys_z:nyn_z,1:nz) !< 1072 REAL(wp) :: f_inv(nxl_y:nxr_y,nzb_y:nzt_y,0:ny) !< 1070 1073 1071 1074 REAL(wp), DIMENSION(nxl_z:nxr_z,nzt_ynzb_y+1,nys_z:nyn_z,0:pdims(1)1) :: work !< … … 1178 1181 IMPLICIT NONE 1179 1182 1180 INTEGER(iwp) :: i !< 1181 INTEGER(iwp) :: j !< 1182 INTEGER(iwp) :: k !< 1183 INTEGER(iwp) :: l !< 1184 INTEGER(iwp) :: m !< 1185 INTEGER(iwp) :: ys !< 1186 1187 REAL(wp) :: f_in(1:nz,nys:nyn,nxl:nxr) !< 1188 REAL(wp) :: f_inv(nys:nyn,nxl:nxr,1:nz) !< 1189 REAL(wp) :: f_out(0:ny,nxl_yd:nxr_yd,nzb_yd:nzt_yd) !< 1190 REAL(wp) :: work(nnx*nny*nnz) !< 1183 INTEGER(iwp) :: i !< 1184 INTEGER(iwp) :: j !< 1185 INTEGER(iwp) :: k !< 1186 INTEGER(iwp) :: l !< 1187 INTEGER(iwp) :: m !< 1188 INTEGER(iwp) :: ys !< 1189 1190 REAL(wp) :: f_in(1:nz,nys:nyn,nxl:nxr) !< 1191 REAL(wp) :: f_inv(nys:nyn,nxl:nxr,1:nz) !< 1192 REAL(wp) :: f_out(0:ny,nxl_yd:nxr_yd,nzb_yd:nzt_yd) !< 1193 REAL(wp) :: work(nnx*nny*nnz) !< 1191 1194 1192 1195 #if defined( __parallel )
Note: See TracChangeset
for help on using the changeset viewer.