Changeset 1257 for palm/trunk/SOURCE


Ignore:
Timestamp:
Nov 8, 2013 3:18:40 PM (10 years ago)
Author:
raasch
Message:

New:
---

openACC porting of timestep calculation
(modules, timestep, time_integration)

Changed:


openACC loop directives and vector clauses removed (because they do not give any performance improvement with PGI
compiler versions > 13.6)
(advec_ws, buoyancy, coriolis, diffusion_e, diffusion_s, diffusion_u, diffusion_v, diffusion_w, diffusivities, exchange_horiz, fft_xy, pres, production_e, transpose, tridia_solver, wall_fluxes)

openACC loop independent clauses added
(boundary_conds, prandtl_fluxes, pres)

openACC declare create statements moved after FORTRAN declaration statement
(diffusion_u, diffusion_v, diffusion_w, fft_xy, poisfft, production_e, tridia_solver)

openACC end parallel replaced by end parallel loop
(flow_statistics, pres)

openACC "kernels do" replaced by "kernels loop"
(prandtl_fluxes)

output format for theta* changed to avoid output of *
(run_control)

Errors:


bugfix for calculation of advective timestep (old version may cause wrong timesteps in case of
vertixcally stretched grids)
Attention: standard run-control output has changed!
(timestep)

Location:
palm/trunk/SOURCE
Files:
23 edited

Legend:

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

    r1222 r1257  
    2020! Current revisions:
    2121! ------------------
    22 !
     22! accelerator loop directives removed
    2323!
    2424! Former revisions:
     
    24582458!--    Computation of fluxes and tendency terms
    24592459       !$acc kernels present( ddzw, sk, tend, u, v, w, wall_flags_0, wall_flags_00 )
    2460        !$acc loop
    24612460       DO  i = i_left, i_right
    24622461          DO  j = j_south, j_north
    2463              !$acc loop vector( 32 )
    24642462             DO  k = nzb+1, nzt
    24652463
     
    31593157!--    Computation of fluxes and tendency terms
    31603158       !$acc  kernels present( ddzw, tend, u, v, w, wall_flags_0, wall_flags_00 )
    3161        !$acc  loop
    31623159       DO i = i_left, i_right
    31633160          DO  j = j_south, j_north
    3164              !$acc  loop vector( 32 )
    31653161             DO  k = nzb+1, nzt
    31663162
     
    38763872!--    Computation of fluxes and tendency terms
    38773873       !$acc kernels present( ddzw, tend, u, v, w, wall_flags_0, wall_flags_00 )
    3878        !$acc loop
    38793874       DO  i = i_left, i_right
    38803875          DO  j = j_south, j_north
    3881              !$acc loop vector( 32 )
    38823876             DO  k = nzb+1, nzt
    38833877
     
    45724566!--    Computation of fluxes and tendency terms
    45734567       !$acc kernels present( ddzu, tend, u, v, w, wall_flags_0, wall_flags_00 )
    4574        !$acc loop
    45754568       DO i = i_left, i_right
    45764569          DO  j = j_south, j_north
    4577              !$acc loop vector( 32 )
    45784570             DO  k = nzb+1, nzt
    45794571
  • palm/trunk/SOURCE/boundary_conds.f90

    r1242 r1257  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! loop independent clauses added
    2323
    2424! Former revisions:
     
    171171    IF ( ibc_pt_b == 0 )  THEN
    172172       !$acc kernels present( nzb_s_inner, pt, pt_p )
     173       !$acc loop independent
    173174       DO  i = nxlg, nxrg
     175          !$acc loop independent
    174176          DO  j = nysg, nyng
    175177             pt_p(nzb_s_inner(j,i),j,i) = pt(nzb_s_inner(j,i),j,i)
     
    179181    ELSEIF ( ibc_pt_b == 1 )  THEN
    180182       !$acc kernels present( nzb_s_inner, pt_p )
     183       !$acc loop independent
    181184       DO  i = nxlg, nxrg
     185          !$acc loop independent
    182186          DO  j = nysg, nyng
    183187             pt_p(nzb_s_inner(j,i),j,i) = pt_p(nzb_s_inner(j,i)+1,j,i)
     
    208212    IF ( .NOT. constant_diffusion )  THEN
    209213       !$acc kernels present( e_p, nzb_s_inner )
     214       !$acc loop independent
    210215       DO  i = nxlg, nxrg
     216          !$acc loop independent
    211217          DO  j = nysg, nyng
    212218             e_p(nzb_s_inner(j,i),j,i) = e_p(nzb_s_inner(j,i)+1,j,i)
  • palm/trunk/SOURCE/buoyancy.f90

    r1242 r1257  
    2020! Currrent revisions:
    2121! ------------------
    22 !
     22! vector length (32) removed from openacc clause
    2323!
    2424! Former revisions:
     
    220220          DO  i = i_left, i_right
    221221             DO  j = j_south, j_north
    222                 !$acc loop independent vector(32)
     222                !$acc loop independent vector
    223223                DO  k = nzb_s_inner(j,i)+1, nzt-1
    224224                   tend(k,j,i) = tend(k,j,i) + atmos_ocean_sign * g * 0.5 * (  &
  • palm/trunk/SOURCE/coriolis.f90

    r1132 r1257  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! openacc loop and loop vector clauses removed
    2323!
    2424! Former revisions:
     
    170170          CASE ( 1 )
    171171             !$acc  kernels present( nzb_u_inner, tend, v, vg, w )
    172              !$acc  loop
    173172             DO  i = i_left, i_right
    174173                DO  j = j_south, j_north
    175                    !$acc loop vector( 32 )
    176174                   DO  k = 1, nzt
    177175                      IF  ( k > nzb_u_inner(j,i) )  THEN
     
    193191          CASE ( 2 )
    194192             !$acc  kernels present( nzb_v_inner, tend, u, ug )
    195              !$acc  loop
    196193             DO  i = i_left, i_right
    197194                DO  j = j_south, j_north
    198                    !$acc loop vector( 32 )
    199195                   DO  k = 1, nzt
    200196                      IF  ( k > nzb_v_inner(j,i) )  THEN
     
    212208          CASE ( 3 )
    213209             !$acc  kernels present( nzb_w_inner, tend, u )
    214              !$acc  loop
    215210             DO  i = i_left, i_right
    216211                DO  j = j_south, j_north
    217                    !$acc loop vector( 32 )
    218212                   DO  k = 1, nzt
    219213                      IF  ( k > nzb_w_inner(j,i) )  THEN
  • palm/trunk/SOURCE/diffusion_e.f90

    r1182 r1257  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! openacc loop and loop vector clauses removed
    2323!
    2424! Former revisions:
     
    326326          !$acc kernels present( ddzu, ddzw, dd2zu, diss, e, km, l_grid ) &
    327327          !$acc         present( nzb_s_inner, rif, tend, var, zu, zw )
    328           !$acc loop
    329328          DO  i = i_left, i_right
    330329             DO  j = j_south, j_north
    331                 !$acc loop vector( 32 )
    332330                DO  k = 1, nzt
    333331
     
    395393          !$acc kernels present( ddzu, ddzw, dd2zu, diss, e, km, l_grid ) &
    396394          !$acc         present( nzb_s_inner, rif, tend, var, zu, zw )
    397           !$acc loop
    398395          DO  i = i_left, i_right
    399396             DO  j = j_south, j_north
    400                 !$acc loop vector( 32 )
    401397                DO  k = 1, nzt
    402398
     
    466462       IF ( use_sgs_for_particles  .OR.  wang_kernel  .OR.  turbulence )  THEN
    467463          !$acc kernels present( diss, nzb_s_inner )
    468           !$acc loop
    469464          DO  i = i_left, i_right
    470              !$acc loop vector( 32 )
    471465             DO  j = j_south, j_north
    472466                diss(nzb_s_inner(j,i),j,i) = diss(nzb_s_inner(j,i)+1,j,i)
  • palm/trunk/SOURCE/diffusion_s.f90

    r1132 r1257  
    2020! Current revisions:
    2121! ------------------
    22 !
     22! openacc loop and loop vector clauses removed
    2323!
    2424! Former revisions:
     
    229229       !$acc         present( s_flux_b, s_flux_t, tend, wall_s_flux )         &
    230230       !$acc         present( wall_w_x, wall_w_y )
    231        !$acc loop
    232231       DO  i = i_left, i_right
    233232          DO  j = j_south, j_north
    234233!
    235234!--          Compute horizontal diffusion
    236              !$acc loop vector( 32 )
    237235             DO  k = 1, nzt
    238236                IF ( k > nzb_s_outer(j,i) )  THEN
     
    252250!
    253251!--          Apply prescribed horizontal wall heatflux where necessary
    254              !$acc loop vector(32)
    255252             DO  k = 1, nzt
    256253                IF ( k > nzb_s_inner(j,i)  .AND.  k <= nzb_s_outer(j,i)  .AND. &
     
    279276!--          prescribed or computed at bottom and/or top, index k starts/ends at
    280277!--          nzb+2 or nzt-1, respectively.
    281              !$acc loop vector( 32 )
    282278             DO  k = 1, nzt_diff
    283279                IF ( k >= nzb_diff_s_inner(j,i) )  THEN
     
    293289!--          Vertical diffusion at the first computational gridpoint along
    294290!--          z-direction
    295              !$acc loop vector( 32 )
    296291             DO  k = 1, nzt
    297292                IF ( use_surface_fluxes  .AND.  k == nzb_s_inner(j,i)+1 )  THEN
  • palm/trunk/SOURCE/diffusion_u.f90

    r1132 r1257  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! openacc loop and loop vector clauses removed, declare create moved after
     23! the FORTRAN declaration statement
    2324!
    2425! Former revisions:
     
    264265       REAL    ::  kmym, kmyp, kmzm, kmzp
    265266
     267       REAL, DIMENSION(nzb:nzt+1,nys:nyn,nxl:nxr) ::  usvs
    266268       !$acc declare create ( usvs )
    267        REAL, DIMENSION(nzb:nzt+1,nys:nyn,nxl:nxr) ::  usvs
    268269
    269270!
     
    278279       !$acc         present ( ddzu, ddzw, fym, fyp, wall_u )           &
    279280       !$acc         present ( nzb_u_inner, nzb_u_outer, nzb_diff_u )
    280        !$acc loop
    281281       DO  i = i_left, i_right
    282282          DO  j = j_south, j_north
    283283!
    284284!--          Compute horizontal diffusion
    285              !$acc loop vector(32)
    286285             DO  k = 1, nzt
    287286                IF ( k > nzb_u_outer(j,i) )  THEN
     
    308307!
    309308!--          Wall functions at the north and south walls, respectively
    310              !$acc loop vector(32)
    311309             DO  k = 1, nzt
    312310                IF( k > nzb_u_inner(j,i)  .AND.  k <= nzb_u_outer(j,i)  .AND. &
     
    339337!--          Compute vertical diffusion. In case of simulating a Prandtl layer,
    340338!--          index k starts at nzb_u_inner+2.
    341              !$acc loop vector(32)
    342339             DO  k = 1, nzt_diff
    343340                IF ( k >= nzb_diff_u(j,i) )  THEN
     
    375372       IF ( use_surface_fluxes )  THEN
    376373
    377           !$acc loop
    378374          DO  i = i_left, i_right
    379              !$acc loop vector(32)
    380375             DO  j = j_south, j_north
    381376         
     
    406401          k = nzt
    407402
    408           !$acc loop
    409403          DO  i = i_left, i_right
    410              !$acc loop vector(32)
    411404             DO  j = j_south, j_north
    412405
  • palm/trunk/SOURCE/diffusion_v.f90

    r1132 r1257  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! openacc loop and loop vector clauses removed, declare create moved after
     23! the FORTRAN declaration statement
    2324!
    2425! Former revisions:
     
    262263       REAL    ::  kmxm, kmxp, kmzm, kmzp
    263264
     265       REAL, DIMENSION(nzb:nzt+1,nys:nyn,nxl:nxr) ::  vsus
    264266       !$acc declare create ( vsus )
    265        REAL, DIMENSION(nzb:nzt+1,nys:nyn,nxl:nxr) ::  vsus
    266267
    267268!
     
    276277       !$acc         present ( ddzu, ddzw, fxm, fxp, wall_v )           &
    277278       !$acc         present ( nzb_v_inner, nzb_v_outer, nzb_diff_v )
    278        !$acc loop
    279279       DO  i = i_left, i_right
    280280          DO  j = j_south, j_north
    281281!
    282282!--          Compute horizontal diffusion
    283              !$acc loop vector(32)
    284283             DO  k = 1, nzt
    285284                IF ( k > nzb_v_outer(j,i) )  THEN
     
    306305!
    307306!--          Wall functions at the left and right walls, respectively
    308              !$acc loop vector(32)
    309307             DO  k = 1, nzt
    310308                IF( k > nzb_v_inner(j,i)  .AND.  k <= nzb_v_outer(j,i)  .AND. &
     
    337335!--          Compute vertical diffusion. In case of simulating a Prandtl
    338336!--          layer, index k starts at nzb_v_inner+2.
    339              !$acc loop vector(32)
    340337             DO  k = 1, nzt_diff
    341338                IF ( k >= nzb_diff_v(j,i) )  THEN
     
    373370       IF ( use_surface_fluxes )  THEN
    374371
    375           !$acc loop
    376372          DO  i = i_left, i_right
    377              !$acc loop vector(32)
    378373             DO  j = j_south, j_north
    379374         
     
    404399          k = nzt
    405400
    406           !$acc loop
    407401          DO  i = i_left, i_right
    408              !$acc loop vector(32)
    409402             DO  j = j_south, j_north
    410403
  • palm/trunk/SOURCE/diffusion_w.f90

    r1132 r1257  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! openacc loop and loop vector clauses removed, declare create moved after
     23! the FORTRAN declaration statement
    2324!
    2425! Former revisions:
     
    214215       REAL    ::  kmxm, kmxp, kmym, kmyp
    215216
     217       REAL, DIMENSION(nzb:nzt+1,nys:nyn,nxl:nxr) ::  wsus, wsvs
    216218       !$acc declare create ( wsus, wsvs )
    217        REAL, DIMENSION(nzb:nzt+1,nys:nyn,nxl:nxr) ::  wsus, wsvs
    218 
    219219
    220220!
     
    231231       !$acc         present ( ddzu, ddzw, fwxm, fwxp, fwym, fwyp, wall_w_x, wall_w_y )           &
    232232       !$acc         present ( nzb_w_inner, nzb_w_outer )
    233        !$acc loop
    234233       DO  i = i_left, i_right
    235234          DO  j = j_south, j_north
    236              !$acc loop vector( 32 )
    237235             DO  k = 1, nzt
    238236                IF ( k > nzb_w_outer(j,i) )  THEN
     
    268266!
    269267!--          Wall functions at all vertical walls, where necessary
    270              !$acc loop vector( 32 )
    271268             DO  k = 1,nzt
    272269
  • palm/trunk/SOURCE/exchange_horiz.f90

    r1132 r1257  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! openacc loop and loop vector clauses removed
    2323!
    2424! Former revisions:
     
    245245          DO  i = 0, nbgp_local-1
    246246             DO  j = nys-nbgp_local, nyn+nbgp_local
    247                 !$acc loop vector( 32 )
    248247                DO  k = nzb, nzt+1
    249248                   ar(k,j,nxl-nbgp_local+i) = ar(k,j,nxr-nbgp_local+1+i)
     
    262261       IF ( on_device )  THEN
    263262          !$acc kernels present( ar )
    264           !$acc loop
    265263          DO  i = nxl-nbgp_local, nxr+nbgp_local
    266264             !$acc loop independent
    267265             DO  j = 0, nbgp_local-1
    268                 !$acc loop vector( 32 )
     266                !$acc loop independent
    269267                DO  k = nzb, nzt+1
    270268                   ar(k,nys-nbgp_local+j,i) = ar(k,nyn-nbgp_local+1+j,i)
  • palm/trunk/SOURCE/fft_xy.f90

    r1220 r1257  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! openacc loop and loop vector clauses removed, declare create moved after
     23! the FORTRAN declaration statement
    2324!
    2425! Former revisions:
     
    328329       REAL, DIMENSION(6*(nx+1)) ::  work2
    329330#elif defined( __cuda_fft )
     331       COMPLEX(dpk), DIMENSION(0:(nx+1)/2,nys_x:nyn_x,nzb_x:nzt_x) ::  ar_tmp
    330332       !$acc declare create( ar_tmp )
    331        COMPLEX(dpk), DIMENSION(0:(nx+1)/2,nys_x:nyn_x,nzb_x:nzt_x) ::  ar_tmp
    332333#endif
    333334       REAL, DIMENSION(0:nx,nys_x:nyn_x), OPTIONAL   ::  ar_2d
     
    634635
    635636             !$acc kernels
    636              !$acc loop
    637637             DO  k = nzb_x, nzt_x
    638638                DO  j = nys_x, nyn_x
    639639
    640                    !$acc loop vector( 32 )
    641640                   DO  i = 0, (nx+1)/2
    642641                      ar(i,j,k)      = REAL( ar_tmp(i,j,k) )  * dnx
    643642                   ENDDO
    644643
    645                    !$acc loop vector( 32 )
    646644                   DO  i = 1, (nx+1)/2 - 1
    647645                      ar(nx+1-i,j,k) = AIMAG( ar_tmp(i,j,k) ) * dnx
     
    657655             !$acc data present( ar )
    658656             !$acc kernels
    659              !$acc loop
    660657             DO  k = nzb_x, nzt_x
    661658                DO  j = nys_x, nyn_x
     
    663660                   ar_tmp(0,j,k) = CMPLX( ar(0,j,k), 0.0 )
    664661
    665                    !$acc loop vector( 32 )
    666662                   DO  i = 1, (nx+1)/2 - 1
    667663                      ar_tmp(i,j,k) = CMPLX( ar(i,j,k), ar(nx+1-i,j,k) )
     
    957953       REAL, DIMENSION(6*(ny+1)) ::  work2
    958954#elif defined( __cuda_fft )
     955       COMPLEX(dpk), DIMENSION(0:(ny+1)/2,nxl_y:nxr_y,nzb_y:nzt_y) ::  ar_tmp
    959956       !$acc declare create( ar_tmp )
    960        COMPLEX(dpk), DIMENSION(0:(ny+1)/2,nxl_y:nxr_y,nzb_y:nzt_y) ::  ar_tmp
    961957#endif
    962958       REAL, DIMENSION(0:ny,nxl_y_l:nxr_y_l,nzb_y:nzt_y) ::  ar
     
    12361232
    12371233             !$acc kernels
    1238              !$acc loop
    12391234             DO  k = nzb_y, nzt_y
    12401235                DO  i = nxl_y, nxr_y
    12411236
    1242                    !$acc loop vector( 32 )
    12431237                   DO  j = 0, (ny+1)/2
    12441238                      ar(j,i,k)      = REAL( ar_tmp(j,i,k) )  * dny
    12451239                   ENDDO
    12461240
    1247                    !$acc loop vector( 32 )
    12481241                   DO  j = 1, (ny+1)/2 - 1
    12491242                      ar(ny+1-j,i,k) = AIMAG( ar_tmp(j,i,k) ) * dny
     
    12591252             !$acc data present( ar )
    12601253             !$acc kernels
    1261              !$acc loop
    12621254             DO  k = nzb_y, nzt_y
    12631255                DO  i = nxl_y, nxr_y
     
    12651257                   ar_tmp(0,i,k) = CMPLX( ar(0,i,k), 0.0 )
    12661258
    1267                    !$acc loop vector( 32 )
    12681259                   DO  j = 1, (ny+1)/2 - 1
    12691260                      ar_tmp(j,i,k) = CMPLX( ar(j,i,k), ar(ny+1-j,i,k) )
  • palm/trunk/SOURCE/flow_statistics.f90

    r1242 r1257  
    2121! Current revisions:
    2222! -----------------
    23 !
     23! openacc "end parallel" replaced by "end parallel loop"
    2424!
    2525! Former revisions:
     
    14681468          sums_l(k,4,tn) = s3
    14691469       ENDDO
    1470        !$acc end parallel
     1470       !$acc end parallel loop
    14711471
    14721472!
     
    14841484             sums_l(k,23,tn) = s1
    14851485          ENDDO
    1486           !$acc end parallel
     1486          !$acc end parallel loop
    14871487       ENDIF
    14881488
     
    15061506             sums_l(k,44,tn) = s2
    15071507          ENDDO
    1508           !$acc end parallel
     1508          !$acc end parallel loop
    15091509
    15101510          IF ( cloud_physics )  THEN
     
    15241524                sums_l(k,43,tn) = s2
    15251525             ENDDO
    1526              !$acc end parallel
     1526             !$acc end parallel loop
    15271527          ENDIF
    15281528       ENDIF
     
    15421542             sums_l(k,41,tn) = s1
    15431543          ENDDO
    1544           !$acc end parallel
     1544          !$acc end parallel loop
    15451545       ENDIF
    15461546       !$OMP END PARALLEL
     
    17471747          sums_l(k,38,tn) = s7
    17481748       ENDDO
    1749        !$acc end parallel
     1749       !$acc end parallel loop
    17501750
    17511751       IF ( humidity )  THEN
     
    17621762             sums_l(k,70,tn) = s1
    17631763          ENDDO
    1764           !$acc end parallel
     1764          !$acc end parallel loop
    17651765       ENDIF
    17661766
     
    17781778          ENDDO
    17791779       ENDDO
    1780        !$acc end parallel
     1780       !$acc end parallel loop
    17811781       !$acc parallel present( sums_l )
    17821782       sums_l(nzb+4,pr_palm,tn) = s1
     
    18431843             sums_l(k,34,tn) = s4
    18441844          ENDDO
    1845           !$acc end parallel
     1845          !$acc end parallel loop
    18461846!
    18471847!--       Total perturbation TKE
     
    19081908          sums_l(k,16,tn) = s3
    19091909       ENDDO
    1910        !$acc end parallel
     1910       !$acc end parallel loop
    19111911
    19121912!
     
    19251925             sums_l(k,65,tn) = s1
    19261926          ENDDO
    1927           !$acc end parallel
     1927          !$acc end parallel loop
    19281928       ENDIF
    19291929
     
    19481948             sums_l(k,48,tn) = s2
    19491949          ENDDO
    1950           !$acc end parallel
     1950          !$acc end parallel loop
    19511951
    19521952          IF ( cloud_physics ) THEN
     
    19651965                sums_l(k,51,tn) = s1
    19661966             ENDDO
    1967              !$acc end parallel
     1967             !$acc end parallel loop
    19681968
    19691969          ENDIF
     
    19861986             sums_l(k,48,tn) = s1
    19871987          ENDDO
    1988           !$acc end parallel
     1988          !$acc end parallel loop
    19891989
    19901990       ENDIF
     
    22322232          sums_l(k,37,tn) = s3
    22332233       ENDDO
    2234        !$acc end parallel
     2234       !$acc end parallel loop
    22352235
    22362236!
     
    22532253                sums_l(k,66,tn) = s1
    22542254             ENDDO
    2255              !$acc end parallel
     2255             !$acc end parallel loop
    22562256
    22572257          ENDIF
     
    22692269             sums_l(k,71,tn) = s2
    22702270          ENDDO
    2271           !$acc end parallel
     2271          !$acc end parallel loop
    22722272
    22732273       ENDIF
     
    22922292                sums_l(k,46,tn) = s1
    22932293             ENDDO
    2294              !$acc end parallel
     2294             !$acc end parallel loop
    22952295
    22962296             IF ( .NOT. cloud_droplets )  THEN
     
    23082308                   sums_l(k,52,tn) = s1
    23092309                ENDDO
    2310                 !$acc end parallel
     2310                !$acc end parallel loop
    23112311
    23122312                IF ( icloud_scheme == 0  )  THEN
     
    23242324                      sums_l(k,75,tn) = s2
    23252325                   ENDDO
    2326                    !$acc end parallel
     2326                   !$acc end parallel loop
    23272327
    23282328                   IF ( precipitation )  THEN
     
    23422342                         sums_l(k,76,tn) = s3
    23432343                      ENDDO
    2344                       !$acc end parallel
     2344                      !$acc end parallel loop
    23452345
    23462346                   ENDIF
     
    23582358                      sums_l(k,54,tn) = s1
    23592359                   ENDDO
    2360                    !$acc end parallel
     2360                   !$acc end parallel loop
    23612361
    23622362                ENDIF
     
    23742374                   sums_l(k,54,tn) = s1
    23752375                ENDDO
    2376                 !$acc end parallel
     2376                !$acc end parallel loop
    23772377
    23782378             ENDIF
     
    23942394                   sums_l(k,46,tn) = s1
    23952395                ENDDO
    2396                 !$acc end parallel
     2396                !$acc end parallel loop
    23972397
    23982398             ELSEIF ( ws_scheme_sca  .AND.  sr == 0 )  THEN
     
    24032403                                             0.61 * hom(k,1,4,sr) * sums_l(k,49,tn)
    24042404                ENDDO
    2405                 !$acc end parallel
     2405                !$acc end parallel loop
    24062406
    24072407             ENDIF
     
    24262426             sums_l(k,49,tn) = s1
    24272427          ENDDO
    2428           !$acc end parallel
     2428          !$acc end parallel loop
    24292429
    24302430       ENDIF
     
    24592459             sums_l(k,15,tn) = s1
    24602460          ENDDO
    2461           !$acc end parallel
     2461          !$acc end parallel loop
    24622462
    24632463       ENDIF
     
    24802480             sums_l(k,17,tn) = s1
    24812481          ENDDO
    2482           !$acc end parallel
     2482          !$acc end parallel loop
    24832483
    24842484          IF ( humidity )  THEN
     
    24962496                sums_l(k,49,tn) = s1
    24972497             ENDDO
    2498              !$acc end parallel
     2498             !$acc end parallel loop
    24992499
    25002500          ENDIF
  • palm/trunk/SOURCE/modules.f90

    r1242 r1257  
    2020! Current revisions:
    2121! ------------------
    22 !
     22! set default values for grid indices of maximum velocity components u|v|w_max_ijk
    2323!
    2424! Former revisions:
     
    16791679    CHARACTER (LEN=40) ::  region(0:9)
    16801680    INTEGER ::  pr_palm = 90, statistic_regions = 0
    1681     INTEGER ::  u_max_ijk(3), v_max_ijk(3), w_max_ijk(3)
     1681    INTEGER ::  u_max_ijk(3) = -1, v_max_ijk(3) = -1, w_max_ijk(3) = -1
    16821682    LOGICAL ::  flow_statistics_called = .FALSE.
    16831683    REAL ::     u_max, v_max, w_max
  • palm/trunk/SOURCE/prandtl_fluxes.f90

    r1037 r1257  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! openACC "kernels do" replaced by "kernels loop", "loop independent" added
    2323!
    2424! Former revisions:
     
    101101!--    for u* use the value from the previous time step
    102102       !$OMP PARALLEL DO
    103        !$acc kernels do
     103       !$acc kernels loop
    104104       DO  i = nxlg, nxrg
    105105          DO  j = nysg, nyng
     
    118118!--    (the Richardson number is still the one from the previous time step)
    119119       !$OMP PARALLEL DO PRIVATE( a, b, k, z_p )
    120        !$acc kernels do
     120       !$acc kernels loop
    121121       DO  i = nxlg, nxrg
    122122          DO  j = nysg, nyng
     
    151151    IF ( .NOT. humidity )  THEN
    152152       !$OMP PARALLEL DO PRIVATE( k, z_p )
    153        !$acc kernels do
     153       !$acc kernels loop
    154154       DO  i = nxlg, nxrg
    155155          DO  j = nysg, nyng
     
    170170    ELSE
    171171       !$OMP PARALLEL DO PRIVATE( k, z_p )
    172        !$acc kernels do
     172       !$acc kernels loop
    173173       DO  i = nxlg, nxrg
    174174          DO  j = nysg, nyng
     
    193193!-- Compute u* at the scalars' grid points
    194194    !$OMP PARALLEL DO PRIVATE( a, b, k, uv_total, z_p )
    195     !$acc kernels do
     195    !$acc kernels loop
    196196    DO  i = nxl, nxr
    197197       DO  j = nys, nyn
     
    243243!-- First compute the corresponding component of u* and square it.
    244244    !$OMP PARALLEL DO PRIVATE( a, b, k, rifm, z_p )
    245     !$acc kernels do
     245    !$acc kernels loop
    246246    DO  i = nxl, nxr
    247247       DO  j = nys, nyn
     
    281281!-- First compute the corresponding component of u* and square it.
    282282    !$OMP PARALLEL DO PRIVATE( a, b, k, rifm, z_p )
    283     !$acc kernels do
     283    !$acc kernels loop
    284284    DO  i = nxl, nxr
    285285       DO  j = nys, nyn
     
    322322!--       For a given water flux in the Prandtl layer:
    323323          !$OMP PARALLEL DO
    324           !$acc kernels do
     324          !$acc kernels loop
    325325          DO  i = nxlg, nxrg
    326326             DO  j = nysg, nyng
     
    332332          coupled_run = ( coupling_mode == 'atmosphere_to_ocean' .AND. run_coupled )
    333333          !$OMP PARALLEL DO PRIVATE( a, b, k, z_p )
    334           !$acc kernels do
     334          !$acc kernels loop independent
    335335          DO  i = nxlg, nxrg
     336             !$acc loop independent
    336337             DO  j = nysg, nyng
    337338
     
    387388    IF ( .NOT. constant_heatflux )  THEN
    388389       !$OMP PARALLEL DO
    389        !$acc kernels do
    390        DO  i = nxlg, nxrg
     390       !$acc kernels loop independent
     391       DO  i = nxlg, nxrg
     392          !$acc loop independent
    391393          DO  j = nysg, nyng
    392394             shf(j,i) = -ts(j,i) * us(j,i)
     
    399401    IF ( .NOT. constant_waterflux .AND. ( humidity .OR. passive_scalar ) ) THEN
    400402       !$OMP PARALLEL DO
    401        !$acc kernels do
    402        DO  i = nxlg, nxrg
     403       !$acc kernels loop independent
     404       DO  i = nxlg, nxrg
     405          !$acc loop independent
    403406          DO  j = nysg, nyng
    404407             qsws(j,i) = -qs(j,i) * us(j,i)
     
    411414    IF ( ibc_e_b == 2 )  THEN
    412415       !$OMP PARALLEL DO
    413        !$acc kernels do
    414        DO  i = nxlg, nxrg
     416       !$acc kernels loop independent
     417       DO  i = nxlg, nxrg
     418          !$acc loop independent
    415419          DO  j = nysg, nyng
    416420             e(nzb_s_inner(j,i)+1,j,i) = ( us(j,i) / 0.1 )**2
  • palm/trunk/SOURCE/pres.f90

    r1222 r1257  
    2020! Current revisions:
    2121! ------------------
    22 !
     22! openacc loop and loop vector clauses removed, independent clauses added,
     23! end parallel replaced by end parallel loop
    2324!
    2425! Former revisions:
     
    321322       !$OMP PARALLEL DO SCHEDULE( STATIC )
    322323       !$acc kernels present( d )
    323        !$acc loop
    324324       DO  i = nxl, nxr
    325325          DO  j = nys, nyn
    326              !$acc loop vector(32)
    327326             DO  k = nzb+1, nzt
    328327                d(k,j,i) = 0.0
     
    391390       ENDDO
    392391    ENDDO
    393     !$acc end parallel
     392    !$acc end parallel loop
    394393    localsum = localsum + threadsum * dt_3d * &
    395394                          weight_pres(intermediate_timestep_count)
     
    421420       !$OMP PARALLEL DO
    422421       !$acc kernels present( d, tend )
    423        !$acc loop
    424422       DO  i = nxl, nxr
    425423          DO  j = nys, nyn
    426              !$acc loop vector( 32 )
    427424             DO  k = nzb+1, nzt
    428425                tend(k,j,i) = d(k,j,i)
     
    558555       !$OMP DO
    559556       !$acc kernels present( p, tend, weight_substep )
    560        !$acc loop
     557       !$acc loop independent
    561558       DO  i = nxl-1, nxr+1
     559          !$acc loop independent
    562560          DO  j = nys-1, nyn+1
    563              !$acc loop vector( 32 )
     561             !$acc loop independent
    564562             DO  k = nzb, nzt+1
    565563                p(k,j,i) = tend(k,j,i) * &
     
    575573       !$OMP DO
    576574       !$acc kernels present( p, tend, weight_substep )
    577        !$acc loop
     575       !$acc loop independent
    578576       DO  i = nxl-1, nxr+1
     577          !$acc loop independent
    579578          DO  j = nys-1, nyn+1
    580              !$acc loop vector( 32 )
     579             !$acc loop independent
    581580             DO  k = nzb, nzt+1
    582581                p(k,j,i) = p(k,j,i) + tend(k,j,i) * &
     
    605604    !$OMP DO
    606605    !$acc kernels present( ddzu, nzb_u_inner, nzb_v_inner, nzb_w_inner, tend, u, v, w, weight_pres )
    607     !$acc loop
     606    !$acc loop independent
    608607    DO  i = nxl, nxr   
    609        DO  j = nys, nyn
    610           !$acc loop vector( 32 )
     608       !$acc loop independent
     609       DO  j = nys, nyn
     610          !$acc loop independent
    611611          DO  k = 1, nzt
    612612             IF ( k > nzb_w_inner(j,i) )  THEN
     
    616616             ENDIF
    617617          ENDDO
    618           !$acc loop vector( 32 )
     618          !$acc loop independent
    619619          DO  k = 1, nzt
    620620             IF ( k > nzb_u_inner(j,i) )  THEN
     
    624624             ENDIF
    625625          ENDDO
    626           !$acc loop vector( 32 )
     626          !$acc loop independent
    627627          DO  k = 1, nzt
    628628             IF ( k > nzb_v_inner(j,i) )  THEN
     
    773773       ENDDO
    774774    ENDDO
    775     !$acc end parallel
     775    !$acc end parallel loop
    776776#endif
    777777
  • palm/trunk/SOURCE/production_e.f90

    r1182 r1257  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! openacc loop and loop vector clauses removed, declare create moved after
     23! the FORTRAN declaration statement
    2324!
    2425! Former revisions:
     
    726727                   k1, k2, km_neutral, theta, temp
    727728
     729       REAL, DIMENSION(nzb:nzt+1,nys:nyn,nxl:nxr) ::  usvs, vsus, wsus, wsvs
    728730       !$acc declare create ( usvs, vsus, wsus, wsvs )
    729        REAL, DIMENSION(nzb:nzt+1,nys:nyn,nxl:nxr) ::  usvs, vsus, wsus, wsvs
    730 !       REAL, DIMENSION(nzb:nzt+1) ::   usvs, vsus, wsus, wsvs
    731731
    732732!
     
    749749       !$acc         present( shf, tend, tswst, u, v, vpt, w, wall_e_x, wall_e_y )      &
    750750       !$acc         copyin( u_0, v_0 )
    751        !$acc loop
    752751       DO  i = i_left, i_right
    753752          DO  j = j_south, j_north
    754              !$acc loop vector( 32 )
    755753             DO  k = 1, nzt
    756754
     
    795793!--       (2) - Will allways be executed.
    796794!--       'bottom and wall: use u_0,v_0 and wall functions'
    797           !$acc loop
    798795          DO  i = i_left, i_right
    799796             DO  j = j_south, j_north
    800                 !$acc loop vector( 32 )
    801797                DO  k = 1, nzt
    802798
     
    10071003!--       (1) - will allways be executed.
    10081004!--       'bottom only: use u_0,v_0'
    1009           !$acc loop
    10101005          DO  i = i_left, i_right
    10111006             DO  j = j_south, j_north
    1012                 !$acc loop vector( 32 )
    10131007                DO  k = 1, nzt
    10141008
     
    10541048       ELSEIF ( use_surface_fluxes )  THEN
    10551049
    1056           !$acc loop
    10571050          DO  i = i_left, i_right
    10581051             DO  j = j_south, j_north
    1059                 !$acc loop vector(32)
    1060                 DO  k = 1, nzt
     1052                 DO  k = 1, nzt
    10611053
    10621054                   IF ( k == nzb_diff_s_outer(j,i)-1 )  THEN
     
    11081100!--                So far in the ocean no special treatment of density flux
    11091101!--                in the bottom and top surface layer
    1110                    !$acc loop
    11111102                   DO  i = i_left, i_right
    11121103                      DO  j = j_south, j_north
    1113                          !$acc loop vector( 32 )
    11141104                         DO  k = 1, nzt
    11151105                            IF ( k > nzb_s_inner(j,i) )  THEN
     
    11251115                ELSE
    11261116
    1127                    !$acc loop
    11281117                   DO  i = i_left, i_right
    11291118                      DO  j = j_south, j_north
    1130                          !$acc loop vector( 32 )
    11311119                         DO  k = 1, nzt_diff
    11321120                            IF ( k >= nzb_diff_s_inner(j,i) )  THEN
     
    11591147!--                So far in the ocean no special treatment of density flux
    11601148!--                in the bottom and top surface layer
    1161                    !$acc loop
    11621149                   DO  i = i_left, i_right
    11631150                      DO  j = j_south, j_north
    1164                          !$acc loop vector( 32 )
    11651151                         DO  k = 1, nzt
    11661152                            IF ( k > nzb_s_inner(j,i) )  THEN
     
    11761162                ELSE
    11771163
    1178                    !$acc loop
    11791164                   DO  i = i_left, i_right
    11801165                      DO  j = j_south, j_north
    1181                          !$acc loop vector( 32 )
    11821166                         DO  k = 1, nzt_diff
    11831167                            IF( k >= nzb_diff_s_inner(j,i) )  THEN
     
    12141198!             DO  i = nxl, nxr
    12151199!                DO  j = nys, nyn
    1216 !                   !acc loop vector( 32 )
     1200!                   !acc loop vector
    12171201!                   DO  k = 1, nzt_diff
    12181202!
     
    12711255!                DO  i = nxl, nxr
    12721256!                   DO  j = nys, nyn
    1273 !                      !acc loop vector( 32 )
     1257!                      !acc loop vector
    12741258!                      DO  k = 1, nzt_diff
    12751259!
     
    13131297!                DO  i = nxl, nxr
    13141298!                   DO  j = nys, nyn
    1315 !                      !acc loop vector( 32 )
     1299!                      !acc loop vector
    13161300!                      DO  k = 1, nzt
    13171301!                         IF ( k == nzt )  THEN
  • palm/trunk/SOURCE/prognostic_equations.f90

    r1247 r1257  
    2020! Current revisions:
    2121! ------------------
    22 !
     22! openacc loop vector clauses removed, independent clauses added
    2323!
    2424! Former revisions:
     
    15361536!-- Prognostic equation for u-velocity component
    15371537    !$acc kernels present( nzb_u_inner, rdf, tend, tu_m, u, ug, u_p )
    1538     !$acc loop
     1538    !$acc loop independent
    15391539    DO  i = i_left, i_right
     1540       !$acc loop independent
    15401541       DO  j = j_south, j_north
    1541           !$acc loop vector( 32 )
     1542          !$acc loop independent
    15421543          DO  k = 1, nzt
    15431544             IF ( k > nzb_u_inner(j,i) )  THEN
     
    16021603!-- Prognostic equation for v-velocity component
    16031604    !$acc kernels present( nzb_v_inner, rdf, tend, tv_m, v, vg, v_p )
    1604     !$acc loop
     1605    !$acc loop independent
    16051606    DO  i = i_left, i_right
     1607       !$acc loop independent
    16061608       DO  j = j_south, j_north
    1607           !$acc loop vector( 32 )
     1609          !$acc loop independent
    16081610          DO  k = 1, nzt
    16091611             IF ( k > nzb_v_inner(j,i) )  THEN
     
    16641666!-- Prognostic equation for w-velocity component
    16651667    !$acc kernels present( nzb_w_inner, rdf, tend, tw_m, w, w_p )
    1666     !$acc loop
     1668    !$acc loop independent
    16671669    DO  i = i_left, i_right
     1670       !$acc loop independent
    16681671       DO  j = j_south, j_north
    1669           !$acc loop vector( 32 )
     1672          !$acc loop independent
    16701673          DO  k = 1, nzt-1
    16711674             IF ( k > nzb_w_inner(j,i) )  THEN
     
    17621765       !$acc kernels present( nzb_s_inner, rdf_sc, ptdf_x, ptdf_y, pt_init ) &
    17631766       !$acc         present( tend, tpt_m, pt, pt_p )
    1764        !$acc loop
     1767       !$acc loop independent
    17651768       DO  i = i_left, i_right
     1769          !$acc loop independent
    17661770          DO  j = j_south, j_north
    1767              !$acc loop vector( 32 )
     1771             !$acc loop independent
    17681772             DO  k = 1, nzt
    17691773                IF ( k > nzb_s_inner(j,i) )  THEN
     
    20122016!--    value is reduced by 90%.
    20132017       !$acc kernels present( e, e_p, nzb_s_inner, tend, te_m )
    2014        !$acc loop
     2018       !$acc loop independent
    20152019       DO  i = i_left, i_right
     2020          !$acc loop independent
    20162021          DO  j = j_south, j_north
    2017              !$acc loop vector( 32 )
     2022             !$acc loop independent
    20182023             DO  k = 1, nzt
    20192024                IF ( k > nzb_s_inner(j,i) )  THEN
  • palm/trunk/SOURCE/run_control.f90

    r1037 r1257  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! output format for theta* changed to avoid output of *****
    2323!
    2424! Former revisions:
     
    126126              &'------------------'// &
    127127          &'RUN  ITER. HH:MM:SS.SS    DT(E)     UMAX     VMAX     WMAX     U', &
    128           &'*    W*   THETA*    Z_I     ENERG.   DISTENERG    DIVOLD     DIV', &
    129           &'NEW     UMAX(KJI)    VMAX(KJI)    WMAX(KJI)   ADVECX   ADVECY   ', &
    130           &'MGCYC'/                                                            &
     128          &'*    W*      THETA*     Z_I     ENERG.   DISTENERG    DIVOLD    ', &
     129          &' DIVNEW     UMAX(KJI)    VMAX(KJI)    WMAX(KJI)   ADVECX   ADVEC', &
     130          &'Y   MGCYC'/                                                        &
    131131          &'----------------------------------------------------------------', &
    132132          &'----------------------------------------------------------------', &
    133133          &'----------------------------------------------------------------', &
    134           &'-----')
     134          &'---------')
    135135101 FORMAT (I3,1X,I6,1X,A8,F3.2,1X,F8.4,A1,1X,F8.4,A1,F8.4,A1,F8.4,2X,F5.3,2X, &
    136136            F4.2, &
    137             2X,F6.3,2X,F6.0,1X,4(E10.3,1X),3(3(I4),1X),F8.3,1X,F8.3,5X,I3)
     137            2X,E10.3,2X,F6.0,1X,4(E10.3,1X),3(3(I4),1X),F8.3,1X,F8.3,5X,I3)
    138138
    139139 END SUBROUTINE run_control
  • palm/trunk/SOURCE/time_integration.f90

    r1242 r1257  
    2020! Current revisions:
    2121! ------------------
    22 !
     22! acc-update-host directive for timestep removed
    2323!
    2424! Former revisions:
     
    223223!--    Determine size of next time step
    224224       IF ( simulated_time /= 0.0 )  THEN
    225           !$acc update host( kh, km, u, v, w )
    226225          CALL timestep
    227226       ENDIF
  • palm/trunk/SOURCE/timestep.f90

    r1093 r1257  
    2020! Current revisions:
    2121! ------------------
    22 !
     22! openacc porting
     23! bugfix for calculation of advective timestep in case of vertically stretched
     24! grids
    2325!
    2426! Former revisions:
     
    9395    IMPLICIT NONE
    9496
    95     INTEGER ::  i, j, k, u_max_cfl_ijk(3), v_max_cfl_ijk(3)
    96 
    97     REAL ::  div, dt_diff, dt_diff_l, dt_plant_canopy, dt_plant_canopy_l,  &
    98              dt_plant_canopy_u, dt_plant_canopy_v, dt_plant_canopy_w,      &
    99              dt_u, dt_v, dt_w, u_max_cfl, value, v_max_cfl
     97    INTEGER ::  i, j, k
     98
     99    REAL ::  div, dt_diff, dt_diff_l, dt_plant_canopy, dt_plant_canopy_l,     &
     100             dt_plant_canopy_u, dt_plant_canopy_v, dt_plant_canopy_w,         &
     101             dt_u, dt_u_l, dt_v, dt_v_l, dt_w, dt_w_l, u_gtrans_l, u_max_l,   &
     102             u_min_l, value, v_gtrans_l, v_max_l, v_min_l, w_max_l, w_min_l
    100103
    101104    REAL, DIMENSION(2)         ::  uv_gtrans, uv_gtrans_l
     105    REAL, DIMENSION(3)         ::  reduce, reduce_l
    102106    REAL, DIMENSION(nzb+1:nzt) ::  dxyz2_min
    103107
     
    127131!
    128132!--       Averaging over the entire model domain.
    129           uv_gtrans_l = 0.0
     133          u_gtrans_l = 0.0
     134          v_gtrans_l = 0.0
     135          !$acc parallel present( u, v )
    130136          DO  i = nxl, nxr
    131137             DO  j = nys, nyn
    132138                DO  k = nzb+1, nzt
    133                    uv_gtrans_l(1) = uv_gtrans_l(1) + u(k,j,i)
    134                    uv_gtrans_l(2) = uv_gtrans_l(2) + v(k,j,i)
     139                   u_gtrans_l = u_gtrans_l + u(k,j,i)
     140                   v_gtrans_l = v_gtrans_l + v(k,j,i)
    135141                ENDDO
    136142             ENDDO
    137143          ENDDO
    138           uv_gtrans_l = uv_gtrans_l / REAL( (nxr-nxl+1)*(nyn-nys+1)*(nzt-nzb) )
     144          !$acc end parallel
     145          uv_gtrans_l(1) = u_gtrans_l / REAL( (nxr-nxl+1)*(nyn-nys+1)*(nzt-nzb) )
     146          uv_gtrans_l(2) = v_gtrans_l / REAL( (nxr-nxl+1)*(nyn-nys+1)*(nzt-nzb) )
    139147#if defined( __parallel )
    140148          IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
     
    151159
    152160!
    153 !-- Determine the maxima of the velocity components.
     161!-- Determine the maxima of the velocity components, including their
     162!-- grid index positions.
     163#if defined( __openacc )
     164    IF ( dt_fixed )  THEN  ! otherwise do it further below for better cache usage
     165       u_max_l = -999999.9
     166       u_min_l =  999999.9
     167       v_max_l = -999999.9
     168       v_min_l =  999999.9
     169       w_max_l = -999999.9
     170       w_min_l =  999999.9
     171       !$acc parallel present( u, v, w )
     172       DO  i = nxl, nxr
     173          DO  j = nys, nyn
     174             DO  k = nzb+1, nzt
     175                u_max_l = MAX( u_max_l, u(k,j,i) )
     176                u_min_l = MIN( u_min_l, u(k,j,i) )
     177                v_max_l = MAX( v_max_l, v(k,j,i) )
     178                v_min_l = MIN( v_min_l, v(k,j,i) )
     179                w_max_l = MAX( w_max_l, w(k,j,i) )
     180                w_min_l = MIN( w_min_l, w(k,j,i) )
     181             ENDDO
     182          ENDDO
     183       ENDDO
     184       !$acc end parallel
     185#if defined( __parallel )
     186       reduce_l(1) = u_max_l
     187       reduce_l(2) = v_max_l
     188       reduce_l(3) = w_max_l
     189       IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
     190       CALL MPI_ALLREDUCE( reduce_l, reduce, 3, MPI_REAL, MPI_MAX, comm2d, ierr )
     191       u_max = reduce(1)
     192       v_max = reduce(2)
     193       w_max = reduce(3)
     194       reduce_l(1) = u_min_l
     195       reduce_l(2) = v_min_l
     196       reduce_l(3) = w_min_l
     197       IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
     198       CALL MPI_ALLREDUCE( reduce_l, reduce, 3, MPI_REAL, MPI_MIN, comm2d, ierr )
     199       IF ( ABS( reduce(1) ) > u_max )  u_max = reduce(1)
     200       IF ( ABS( reduce(2) ) > v_max )  v_max = reduce(2)
     201       IF ( ABS( reduce(3) ) > w_max )  w_max = reduce(3)
     202#else
     203       IF ( ABS( u_min_l ) > u_max_l )  THEN
     204          u_max = u_min_l
     205       ELSE
     206          u_max = u_max_l
     207       ENDIF
     208       IF ( ABS( v_min_l ) > v_max_l )  THEN
     209          v_max = v_min_l
     210       ELSE
     211          v_max = v_max_l
     212       ENDIF
     213       IF ( ABS( w_min_l ) > w_max_l )  THEN
     214          w_max = w_min_l
     215       ELSE
     216          w_max = w_max_l
     217       ENDIF
     218#endif
     219    ENDIF
     220#else
    154221    CALL global_min_max( nzb, nzt+1, nysg, nyng, nxlg, nxrg, u, 'abs', 0.0, &
    155222                         u_max, u_max_ijk )
     
    158225    CALL global_min_max( nzb, nzt+1, nysg, nyng, nxlg, nxrg, w, 'abs', 0.0, &
    159226                         w_max, w_max_ijk )
    160 
    161 !
    162 !-- In case of Galilei transformation, the horizontal velocity maxima have
    163 !-- to be calculated from the transformed horizontal velocities
    164     IF ( galilei_transformation )  THEN
    165        CALL global_min_max( nzb, nzt+1, nysg, nyng, nxlg, nxrg, u, 'absoff', &
    166                             u_gtrans, u_max_cfl, u_max_cfl_ijk )
    167        CALL global_min_max( nzb, nzt+1, nysg, nyng, nxlg, nxrg, v, 'absoff', &
    168                             v_gtrans, v_max_cfl, v_max_cfl_ijk )
    169     ELSE
    170        u_max_cfl = u_max
    171        v_max_cfl = v_max
    172        u_max_cfl_ijk = u_max_ijk
    173        v_max_cfl_ijk = v_max_ijk
    174     ENDIF
    175 
     227#endif
    176228
    177229    IF ( .NOT. dt_fixed )  THEN
     230#if defined( __openacc )
    178231!
    179232!--    Variable time step:
    180 !
    181 !--    For each component, compute the maximum time step according to the
    182 !--    CFL-criterion.
    183        dt_u = dx / ( ABS( u_max_cfl ) + 1.0E-10 )
    184        dt_v = dy / ( ABS( v_max_cfl ) + 1.0E-10 )
    185        dt_w = dzu(MAX( 1, w_max_ijk(1) )) / ( ABS( w_max ) + 1.0E-10 )
     233!--    Calculate the maximum time step according to the CFL-criterion,
     234!--    individually for each velocity component
     235       dt_u_l  =  999999.9
     236       dt_v_l  =  999999.9
     237       dt_w_l  =  999999.9
     238       u_max_l = -999999.9
     239       u_min_l =  999999.9
     240       v_max_l = -999999.9
     241       v_min_l =  999999.9
     242       w_max_l = -999999.9
     243       w_min_l =  999999.9
     244       !$acc parallel loop collapse(3) present( u, v, w )
     245       DO  i = nxl, nxr
     246          DO  j = nys, nyn
     247             DO  k = nzb+1, nzt
     248                dt_u_l  = MIN( dt_u_l, ( dx     / ( ABS( u(k,j,i) - u_gtrans ) + 1.0E-10 ) ) )
     249                dt_v_l  = MIN( dt_v_l, ( dy     / ( ABS( v(k,j,i) - v_gtrans ) + 1.0E-10 ) ) )
     250                dt_w_l  = MIN( dt_w_l, ( dzu(k) / ( ABS( w(k,j,i) )            + 1.0E-10 ) ) )
     251                u_max_l = MAX( u_max_l, u(k,j,i) )
     252                u_min_l = MIN( u_min_l, u(k,j,i) )
     253                v_max_l = MAX( v_max_l, v(k,j,i) )
     254                v_min_l = MIN( v_min_l, v(k,j,i) )
     255                w_max_l = MAX( w_max_l, w(k,j,i) )
     256                w_min_l = MIN( w_min_l, w(k,j,i) )
     257             ENDDO
     258          ENDDO
     259       ENDDO
     260       !$acc end parallel
     261
     262#if defined( __parallel )
     263       reduce_l(1) = dt_u_l
     264       reduce_l(2) = dt_v_l
     265       reduce_l(3) = dt_w_l
     266       IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
     267       CALL MPI_ALLREDUCE( reduce_l, reduce, 3, MPI_REAL, MPI_MIN, comm2d, ierr )
     268       dt_u = reduce(1)
     269       dt_v = reduce(2)
     270       dt_w = reduce(3)
     271
     272       reduce_l(1) = u_max_l
     273       reduce_l(2) = v_max_l
     274       reduce_l(3) = w_max_l
     275       IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
     276       CALL MPI_ALLREDUCE( reduce_l, reduce, 3, MPI_REAL, MPI_MAX, comm2d, ierr )
     277       u_max = reduce(1)
     278       v_max = reduce(2)
     279       w_max = reduce(3)
     280       reduce_l(1) = u_min_l
     281       reduce_l(2) = v_min_l
     282       reduce_l(3) = w_min_l
     283       IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
     284       CALL MPI_ALLREDUCE( reduce_l, reduce, 3, MPI_REAL, MPI_MIN, comm2d, ierr )
     285       IF ( ABS( reduce(1) ) > u_max )  u_max = reduce(1)
     286       IF ( ABS( reduce(2) ) > v_max )  v_max = reduce(2)
     287       IF ( ABS( reduce(3) ) > w_max )  w_max = reduce(3)
     288#else
     289       dt_u = dt_u_l
     290       dt_v = dt_v_l
     291       dt_w = dt_w_l
     292
     293       IF ( ABS( u_min_l ) > u_max_l )  THEN
     294          u_max = u_min_l
     295       ELSE
     296          u_max = u_max_l
     297       ENDIF
     298       IF ( ABS( v_min_l ) > v_max_l )  THEN
     299          v_max = v_min_l
     300       ELSE
     301          v_max = v_max_l
     302       ENDIF
     303       IF ( ABS( w_min_l ) > w_max_l )  THEN
     304          w_max = w_min_l
     305       ELSE
     306          w_max = w_max_l
     307       ENDIF
     308#endif
     309
     310#else
     311!
     312!--    Variable time step:
     313!--    Calculate the maximum time step according to the CFL-criterion,
     314!--    individually for each velocity component
     315       dt_u_l = 999999.9
     316       dt_v_l = 999999.9
     317       dt_w_l = 999999.9
     318       DO  i = nxl, nxr
     319          DO  j = nys, nyn
     320             DO  k = nzb+1, nzt
     321                dt_u_l = MIN( dt_u_l, ( dx     / ( ABS( u(k,j,i) - u_gtrans ) + 1.0E-10 ) ) )
     322                dt_v_l = MIN( dt_v_l, ( dy     / ( ABS( v(k,j,i) - v_gtrans ) + 1.0E-10 ) ) )
     323                dt_w_l = MIN( dt_w_l, ( dzu(k) / ( ABS( w(k,j,i) )            + 1.0E-10 ) ) )
     324             ENDDO
     325          ENDDO
     326       ENDDO
     327
     328#if defined( __parallel )
     329       reduce_l(1) = dt_u_l
     330       reduce_l(2) = dt_v_l
     331       reduce_l(3) = dt_w_l
     332       IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
     333       CALL MPI_ALLREDUCE( reduce_l, reduce, 3, MPI_REAL, MPI_MIN, comm2d, ierr )
     334       dt_u = reduce(1)
     335       dt_v = reduce(2)
     336       dt_w = reduce(3)
     337#else
     338       dt_u = dt_u_l
     339       dt_v = dt_v_l
     340       dt_w = dt_w_l
     341#endif
     342
     343#endif
    186344
    187345!
     
    199357!$OMP PARALLEL private(i,j,k,value) reduction(MIN: dt_diff_l)
    200358!$OMP DO
     359       !$acc parallel loop collapse(3) present( kh, km )
    201360       DO  i = nxl, nxr
    202361          DO  j = nys, nyn
    203362             DO  k = nzb+1, nzt
    204                 value = dxyz2_min(k) / ( MAX( kh(k,j,i), km(k,j,i) ) + 1E-20 )
    205 
    206                 dt_diff_l = MIN( value, dt_diff_l )
     363                dt_diff_l = MIN( dt_diff_l, dxyz2_min(k) / &
     364                                       ( MAX( kh(k,j,i), km(k,j,i) ) + 1E-20 ) )
    207365             ENDDO
    208366          ENDDO
    209367       ENDDO
     368       !$acc end parallel
    210369!$OMP END PARALLEL
    211370#if defined( __parallel )
     
    334493               '&dt_diff         = ', dt_diff, ' s',                          &
    335494               '&dt_plant_canopy = ', dt_plant_canopy, ' s',                  &
    336                '&u_max_cfl   = ', u_max_cfl, ' m/s   k=', u_max_cfl_ijk(1),   &
     495               '&u_max           = ', u_max, ' m/s   k=', u_max_ijk(1),       &
    337496               '  j=', u_max_ijk(2), '  i=', u_max_ijk(3),                    &
    338                '&v_max_cfl   = ', v_max_cfl, ' m/s   k=', v_max_cfl_ijk(1),   &
     497               '&v_max           = ', v_max, ' m/s   k=', v_max_ijk(1),       &
    339498               '  j=', v_max_ijk(2), '  i=', v_max_ijk(3),                    &
    340                '&w_max       = ', w_max, ' m/s   k=', w_max_ijk(1),           &
     499               '&w_max           = ', w_max, ' m/s   k=', w_max_ijk(1),       &
    341500               '  j=', w_max_ijk(2), '  i=', w_max_ijk(3)
    342501          CALL message( 'timestep', 'PA0312', 0, 1, 0, 6, 0 )
  • palm/trunk/SOURCE/transpose.f90

    r1217 r1257  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! openacc loop and loop vector clauses removed
    2323!
    2424! Former revisions:
     
    9797    !$OMP  DO
    9898    !$acc kernels present( f_in, f_inv )
    99     !$acc loop
    10099     DO  i = 0, nx
    101100         DO  k = nzb_x, nzt_x
    102              !$acc loop vector( 32 )
    103101             DO  j = nys_x, nyn_x
    104102                 f_inv(j,k,i) = f_in(i,j,k)
     
    158156          ys = 0 + l * ( nyn_x - nys_x + 1 )
    159157          !$acc kernels present( f_out, work )
    160           !$acc loop
    161158          DO  i = nxl_y, nxr_y
    162159             DO  k = nzb_y, nzt_y
    163                 !$acc loop vector( 32 )
    164160                DO  j = ys, ys + nyn_x - nys_x
    165161                   f_out(j,i,k) = work(j-ys+1,k,i,l)
     
    180176!$OMP  DO
    181177       !$acc kernels present( f_inv, f_out )
    182        !$acc loop
    183178       DO  k = nzb_y, nzt_y
    184179          DO  i = nxl_y, nxr_y
    185              !$acc loop vector( 32 )
    186180             DO  j = 0, ny
    187181                f_out(j,i,k) = f_inv(j,k,i)
     
    225219    !$OMP  DO
    226220    !$acc kernels present( f_inv, f_out )
    227     !$acc loop
    228221     DO  k = 1, nz
    229222         DO  i = nxl, nxr
    230              !$acc loop vector( 32 )
    231223             DO  j = nys, nyn
    232224                 f_out(k,j,i) = f_inv(j,i,k)
     
    279271          xs = 0 + l * nnx
    280272          !$acc kernels present( f_in, work )
    281           !$acc loop
    282273          DO  k = nzb_x, nzt_x
    283274             DO  i = xs, xs + nnx - 1
    284                 !$acc loop vector( 32 )
    285275                DO  j = nys_x, nyn_x
    286276                   work(j,i-xs+1,k,l) = f_in(i,j,k)
     
    311301!$OMP  DO
    312302       !$acc kernels present( f_in, f_inv )
    313        !$acc loop
    314303       DO  i = nxl, nxr
    315304          DO  j = nys, nyn
    316              !$acc loop vector( 32 )
    317305             DO  k = 1, nz
    318306                f_inv(j,i,k) = f_in(i,j,k)
     
    354342    !$OMP  DO
    355343    !$acc kernels present( f_inv, f_out )
    356     !$acc loop
    357344     DO  i = 0, nx
    358345         DO  k = nzb_x, nzt_x
    359              !$acc loop vector( 32 )
    360346             DO  j = nys_x, nyn_x
    361347                 f_out(i,j,k) = f_inv(j,k,i)
     
    405391          ys = 0 + l * ( nyn_x - nys_x + 1 )
    406392          !$acc kernels present( f_in, work )
    407           !$acc loop
    408393          DO  i = nxl_y, nxr_y
    409394             DO  k = nzb_y, nzt_y
    410                 !$acc loop vector( 32 )
    411395                DO  j = ys, ys + nyn_x - nys_x
    412396                   work(j-ys+1,k,i,l) = f_in(j,i,k)
     
    437421!$OMP  DO
    438422       !$acc kernels present( f_in, f_inv )
    439        !$acc loop
    440423       DO  i = nxl_y, nxr_y
    441424          DO  k = nzb_y, nzt_y
    442              !$acc loop vector( 32 )
    443425             DO  j = 0, ny
    444426                f_inv(j,k,i) = f_in(j,i,k)
     
    548530    !$OMP  DO
    549531    !$acc kernels present( f_in, f_inv )
    550     !$acc loop
    551532     DO  j = 0, ny
    552533         DO  k = nzb_y, nzt_y
    553              !$acc loop vector( 32 )
    554534             DO  i = nxl_y, nxr_y
    555535                 f_inv(i,k,j) = f_in(j,i,k)
     
    596576!$OMP  DO
    597577       !$acc kernels present( f_inv, f_out )
    598        !$acc loop
    599578       DO  j = 0, ny
    600579          DO  k = nzb_y, nzt_y
    601              !$acc loop vector( 32 )
    602580             DO  i = nxl_y, nxr_y
    603581                f_out(i,j,k) = f_inv(i,k,j)
     
    629607          zs = 1 + l * ( nzt_y - nzb_y + 1 )
    630608          !$acc kernels present( f_out )
    631           !$acc loop
    632609          DO  j = nys_z, nyn_z
    633610             DO  k = zs, zs + nzt_y - nzb_y
    634                 !$acc loop vector( 32 )
    635611                DO  i = nxl_z, nxr_z
    636612                   f_out(i,j,k) = work(i,k-zs+1,j,l)
     
    675651    !$OMP  DO
    676652    !$acc kernels present( f_in, f_inv )
    677     !$acc loop
    678653     DO  k = 1,nz
    679654         DO  i = nxl, nxr
    680              !$acc loop vector( 32 )
    681655             DO  j = nys, nyn
    682656                 f_inv(j,i,k) = f_in(k,j,i)
     
    723697!$OMP  DO
    724698       !$acc kernels present( f_inv, f_out )
    725        !$acc loop
    726699       DO  k = 1, nz
    727700          DO  i = nxl, nxr
    728              !$acc loop vector( 32 )
    729701             DO  j = nys, nyn
    730702                f_out(i,j,k) = f_inv(j,i,k)
     
    756728          xs = 0 + l * nnx
    757729          !$acc kernels present( f_out )
    758           !$acc loop
    759730          DO  k = nzb_x, nzt_x
    760731             DO  i = xs, xs + nnx - 1
    761                 !$acc loop vector( 32 )
    762732                DO  j = nys_x, nyn_x
    763733                   f_out(i,j,k) = work(j,i-xs+1,k,l)
     
    802772    !$OMP  DO
    803773    !$acc kernels present( f_inv, f_out )
    804     !$acc loop
    805774     DO  k = nzb_y, nzt_y
    806775         DO  j = 0, ny
    807              !$acc loop vector( 32 )
    808776             DO  i = nxl_y, nxr_y
    809777                 f_out(j,i,k) = f_inv(i,k,j)
     
    856824          zs = 1 + l * ( nzt_y - nzb_y + 1 )
    857825          !$acc kernels present( f_in, work )
    858           !$acc loop
    859826          DO  j = nys_z, nyn_z
    860827             DO  k = zs, zs + nzt_y - nzb_y
    861                 !$acc loop vector( 32 )
    862828                DO  i = nxl_z, nxr_z
    863829                   work(i,k-zs+1,j,l) = f_in(i,j,k)
     
    887853!$OMP  DO
    888854       !$acc kernels present( f_in, f_inv )
    889        !$acc loop
    890855       DO  k = nzb_y, nzt_y
    891856          DO  j = 0, ny
    892              !$acc loop vector( 32 )
    893857             DO  i = nxl_y, nxr_y
    894858                f_inv(i,k,j) = f_in(i,j,k)
  • palm/trunk/SOURCE/tridia_solver.f90

    r1222 r1257  
    2020! Current revisions:
    2121! ------------------
    22 !
     22! openacc loop and loop vector clauses removed, declare create moved after
     23! the FORTRAN declaration statement
    2324!
    2425! Former revisions:
     
    114115          INTEGER ::  i, j, k, nnxh, nnyh
    115116
     117          REAL    ::  ll(nxl_z:nxr_z,nys_z:nyn_z)
    116118          !$acc declare create( ll )
    117           REAL    ::  ll(nxl_z:nxr_z,nys_z:nyn_z)
    118119
    119120
     
    130131
    131132          !$acc kernels present( tric )
    132           !$acc loop vector( 32 )
    133133          DO  j = nys_z, nyn_z
    134134             DO  i = nxl_z, nxr_z
     
    161161          ENDDO
    162162
    163           !$acc loop
    164163          DO  k = 0, nz-1
    165164             DO  j = nys_z, nyn_z
    166                 !$acc loop vector( 32 )
    167165                DO  i = nxl_z, nxr_z
    168166                   tric(i,j,k) = ddzuw(k,3) - ll(i,j)
     
    174172          IF ( ibc_p_b == 1 )  THEN
    175173             !$acc kernels present( tric )
    176              !$acc loop
    177174             DO  j = nys_z, nyn_z
    178175                DO  i = nxl_z, nxr_z
     
    184181          IF ( ibc_p_t == 1 )  THEN
    185182             !$acc kernels present( tric )
    186              !$acc loop
    187183             DO  j = nys_z, nyn_z
    188184                DO  i = nxl_z, nxr_z
     
    211207          REAL    ::  ar(nxl_z:nxr_z,nys_z:nyn_z,1:nz)
    212208
     209          REAL, DIMENSION(nxl_z:nxr_z,nys_z:nyn_z,0:nz-1)   ::  ar1
    213210          !$acc declare create( ar1 )
    214           REAL, DIMENSION(nxl_z:nxr_z,nys_z:nyn_z,0:nz-1)   ::  ar1
    215211
    216212!
     
    218214          DO  k = 0, nz - 1
    219215             !$acc kernels present( ar, tri )
    220              !$acc loop
    221216             DO  j = nys_z, nyn_z
    222217                DO  i = nxl_z, nxr_z
     
    240235          DO  k = nz-1, 0, -1
    241236             !$acc kernels present( ar, tri )
    242              !$acc loop
    243237             DO  j = nys_z, nyn_z
    244238                DO  i = nxl_z, nxr_z
     
    265259                   ar(nxl_z,nys_z,k) = 0.0
    266260                ENDDO
     261                !$acc end kernels loop
    267262             ENDIF
    268263          ENDIF
  • palm/trunk/SOURCE/wall_fluxes.f90

    r1154 r1257  
    2020! Current revisions:
    2121! -----------------
    22 !
     22! openacc loop and loop vector clauses removed
    2323!
    2424! Former revisions:
     
    270270!--             All subsequent variables are computed for the respective
    271271!--             location where the respective flux is defined.
    272                 !$acc loop independent vector( 32 )
     272                !$acc loop independent
    273273                DO  k = nzb_uvw_inner(j,i)+1, nzb_uvw_outer(j,i)
    274274
     
    676676       !$acc kernels present( nzb_diff_s_inner, nzb_diff_s_outer, pt, rif_wall ) &
    677677       !$acc         present( u, v, w, wall, wall_flux, z0 )
    678        !$acc loop
    679678       DO  i = i_left, i_right
    680679          DO  j = j_south, j_north
    681              !$acc loop vector(32)
    682680             DO  k = min_inner, max_outer
    683681!
Note: See TracChangeset for help on using the changeset viewer.