Index: palm/trunk/SOURCE/advec_ws.f90
===================================================================
--- palm/trunk/SOURCE/advec_ws.f90	(revision 1254)
+++ palm/trunk/SOURCE/advec_ws.f90	(revision 1257)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! ------------------
-!
+! accelerator loop directives removed
 !
 ! Former revisions:
@@ -2458,8 +2458,6 @@
 !--    Computation of fluxes and tendency terms
        !$acc kernels present( ddzw, sk, tend, u, v, w, wall_flags_0, wall_flags_00 )
-       !$acc loop
        DO  i = i_left, i_right
           DO  j = j_south, j_north
-             !$acc loop vector( 32 )
              DO  k = nzb+1, nzt
 
@@ -3159,8 +3157,6 @@
 !--    Computation of fluxes and tendency terms
        !$acc  kernels present( ddzw, tend, u, v, w, wall_flags_0, wall_flags_00 )
-       !$acc  loop
        DO i = i_left, i_right
           DO  j = j_south, j_north
-             !$acc  loop vector( 32 )
              DO  k = nzb+1, nzt
 
@@ -3876,8 +3872,6 @@
 !--    Computation of fluxes and tendency terms
        !$acc kernels present( ddzw, tend, u, v, w, wall_flags_0, wall_flags_00 )
-       !$acc loop
        DO  i = i_left, i_right
           DO  j = j_south, j_north
-             !$acc loop vector( 32 )
              DO  k = nzb+1, nzt
 
@@ -4572,8 +4566,6 @@
 !--    Computation of fluxes and tendency terms
        !$acc kernels present( ddzu, tend, u, v, w, wall_flags_0, wall_flags_00 )
-       !$acc loop
        DO i = i_left, i_right
           DO  j = j_south, j_north
-             !$acc loop vector( 32 )
              DO  k = nzb+1, nzt
 
Index: palm/trunk/SOURCE/boundary_conds.f90
===================================================================
--- palm/trunk/SOURCE/boundary_conds.f90	(revision 1254)
+++ palm/trunk/SOURCE/boundary_conds.f90	(revision 1257)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! loop independent clauses added
 !  
 ! Former revisions:
@@ -171,5 +171,7 @@
     IF ( ibc_pt_b == 0 )  THEN
        !$acc kernels present( nzb_s_inner, pt, pt_p )
+       !$acc loop independent
        DO  i = nxlg, nxrg
+          !$acc loop independent
           DO  j = nysg, nyng
              pt_p(nzb_s_inner(j,i),j,i) = pt(nzb_s_inner(j,i),j,i)
@@ -179,5 +181,7 @@
     ELSEIF ( ibc_pt_b == 1 )  THEN
        !$acc kernels present( nzb_s_inner, pt_p )
+       !$acc loop independent
        DO  i = nxlg, nxrg
+          !$acc loop independent
           DO  j = nysg, nyng
              pt_p(nzb_s_inner(j,i),j,i) = pt_p(nzb_s_inner(j,i)+1,j,i)
@@ -208,5 +212,7 @@
     IF ( .NOT. constant_diffusion )  THEN
        !$acc kernels present( e_p, nzb_s_inner )
+       !$acc loop independent
        DO  i = nxlg, nxrg
+          !$acc loop independent
           DO  j = nysg, nyng
              e_p(nzb_s_inner(j,i),j,i) = e_p(nzb_s_inner(j,i)+1,j,i)
Index: palm/trunk/SOURCE/buoyancy.f90
===================================================================
--- palm/trunk/SOURCE/buoyancy.f90	(revision 1254)
+++ palm/trunk/SOURCE/buoyancy.f90	(revision 1257)
@@ -20,5 +20,5 @@
 ! Currrent revisions:
 ! ------------------
-!
+! vector length (32) removed from openacc clause
 !
 ! Former revisions:
@@ -220,5 +220,5 @@
           DO  i = i_left, i_right
              DO  j = j_south, j_north
-                !$acc loop independent vector(32)
+                !$acc loop independent vector
                 DO  k = nzb_s_inner(j,i)+1, nzt-1
                    tend(k,j,i) = tend(k,j,i) + atmos_ocean_sign * g * 0.5 * (  &
Index: palm/trunk/SOURCE/coriolis.f90
===================================================================
--- palm/trunk/SOURCE/coriolis.f90	(revision 1254)
+++ palm/trunk/SOURCE/coriolis.f90	(revision 1257)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-!
+! openacc loop and loop vector clauses removed
 !
 ! Former revisions:
@@ -170,8 +170,6 @@
           CASE ( 1 )
              !$acc  kernels present( nzb_u_inner, tend, v, vg, w )
-             !$acc  loop
              DO  i = i_left, i_right
                 DO  j = j_south, j_north
-                   !$acc loop vector( 32 )
                    DO  k = 1, nzt
                       IF  ( k > nzb_u_inner(j,i) )  THEN
@@ -193,8 +191,6 @@
           CASE ( 2 )
              !$acc  kernels present( nzb_v_inner, tend, u, ug )
-             !$acc  loop
              DO  i = i_left, i_right
                 DO  j = j_south, j_north
-                   !$acc loop vector( 32 )
                    DO  k = 1, nzt
                       IF  ( k > nzb_v_inner(j,i) )  THEN
@@ -212,8 +208,6 @@
           CASE ( 3 )
              !$acc  kernels present( nzb_w_inner, tend, u )
-             !$acc  loop
              DO  i = i_left, i_right
                 DO  j = j_south, j_north
-                   !$acc loop vector( 32 )
                    DO  k = 1, nzt
                       IF  ( k > nzb_w_inner(j,i) )  THEN
Index: palm/trunk/SOURCE/diffusion_e.f90
===================================================================
--- palm/trunk/SOURCE/diffusion_e.f90	(revision 1254)
+++ palm/trunk/SOURCE/diffusion_e.f90	(revision 1257)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-!
+! openacc loop and loop vector clauses removed
 !
 ! Former revisions:
@@ -326,8 +326,6 @@
           !$acc kernels present( ddzu, ddzw, dd2zu, diss, e, km, l_grid ) &
           !$acc         present( nzb_s_inner, rif, tend, var, zu, zw )
-          !$acc loop
           DO  i = i_left, i_right
              DO  j = j_south, j_north
-                !$acc loop vector( 32 )
                 DO  k = 1, nzt
 
@@ -395,8 +393,6 @@
           !$acc kernels present( ddzu, ddzw, dd2zu, diss, e, km, l_grid ) &
           !$acc         present( nzb_s_inner, rif, tend, var, zu, zw )
-          !$acc loop
           DO  i = i_left, i_right
              DO  j = j_south, j_north
-                !$acc loop vector( 32 )
                 DO  k = 1, nzt
 
@@ -466,7 +462,5 @@
        IF ( use_sgs_for_particles  .OR.  wang_kernel  .OR.  turbulence )  THEN
           !$acc kernels present( diss, nzb_s_inner )
-          !$acc loop
           DO  i = i_left, i_right
-             !$acc loop vector( 32 )
              DO  j = j_south, j_north
                 diss(nzb_s_inner(j,i),j,i) = diss(nzb_s_inner(j,i)+1,j,i)
Index: palm/trunk/SOURCE/diffusion_s.f90
===================================================================
--- palm/trunk/SOURCE/diffusion_s.f90	(revision 1254)
+++ palm/trunk/SOURCE/diffusion_s.f90	(revision 1257)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! ------------------
-!
+! openacc loop and loop vector clauses removed
 !
 ! Former revisions:
@@ -229,10 +229,8 @@
        !$acc         present( s_flux_b, s_flux_t, tend, wall_s_flux )         &
        !$acc         present( wall_w_x, wall_w_y )
-       !$acc loop
        DO  i = i_left, i_right
           DO  j = j_south, j_north
 !
 !--          Compute horizontal diffusion
-             !$acc loop vector( 32 )
              DO  k = 1, nzt
                 IF ( k > nzb_s_outer(j,i) )  THEN
@@ -252,5 +250,4 @@
 !
 !--          Apply prescribed horizontal wall heatflux where necessary
-             !$acc loop vector(32)
              DO  k = 1, nzt
                 IF ( k > nzb_s_inner(j,i)  .AND.  k <= nzb_s_outer(j,i)  .AND. &
@@ -279,5 +276,4 @@
 !--          prescribed or computed at bottom and/or top, index k starts/ends at
 !--          nzb+2 or nzt-1, respectively.
-             !$acc loop vector( 32 )
              DO  k = 1, nzt_diff
                 IF ( k >= nzb_diff_s_inner(j,i) )  THEN
@@ -293,5 +289,4 @@
 !--          Vertical diffusion at the first computational gridpoint along
 !--          z-direction
-             !$acc loop vector( 32 )
              DO  k = 1, nzt
                 IF ( use_surface_fluxes  .AND.  k == nzb_s_inner(j,i)+1 )  THEN
Index: palm/trunk/SOURCE/diffusion_u.f90
===================================================================
--- palm/trunk/SOURCE/diffusion_u.f90	(revision 1254)
+++ palm/trunk/SOURCE/diffusion_u.f90	(revision 1257)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! -----------------
-!
+! openacc loop and loop vector clauses removed, declare create moved after
+! the FORTRAN declaration statement
 !
 ! Former revisions:
@@ -264,6 +265,6 @@
        REAL    ::  kmym, kmyp, kmzm, kmzp
 
+       REAL, DIMENSION(nzb:nzt+1,nys:nyn,nxl:nxr) ::  usvs
        !$acc declare create ( usvs )
-       REAL, DIMENSION(nzb:nzt+1,nys:nyn,nxl:nxr) ::  usvs
 
 !
@@ -278,10 +279,8 @@
        !$acc         present ( ddzu, ddzw, fym, fyp, wall_u )           &
        !$acc         present ( nzb_u_inner, nzb_u_outer, nzb_diff_u )
-       !$acc loop
        DO  i = i_left, i_right
           DO  j = j_south, j_north
 !
 !--          Compute horizontal diffusion
-             !$acc loop vector(32)
              DO  k = 1, nzt
                 IF ( k > nzb_u_outer(j,i) )  THEN
@@ -308,5 +307,4 @@
 !
 !--          Wall functions at the north and south walls, respectively
-             !$acc loop vector(32)
              DO  k = 1, nzt
                 IF( k > nzb_u_inner(j,i)  .AND.  k <= nzb_u_outer(j,i)  .AND. &
@@ -339,5 +337,4 @@
 !--          Compute vertical diffusion. In case of simulating a Prandtl layer,
 !--          index k starts at nzb_u_inner+2.
-             !$acc loop vector(32)
              DO  k = 1, nzt_diff
                 IF ( k >= nzb_diff_u(j,i) )  THEN
@@ -375,7 +372,5 @@
        IF ( use_surface_fluxes )  THEN
 
-          !$acc loop
           DO  i = i_left, i_right
-             !$acc loop vector(32)
              DO  j = j_south, j_north
           
@@ -406,7 +401,5 @@
           k = nzt
 
-          !$acc loop
           DO  i = i_left, i_right
-             !$acc loop vector(32)
              DO  j = j_south, j_north
 
Index: palm/trunk/SOURCE/diffusion_v.f90
===================================================================
--- palm/trunk/SOURCE/diffusion_v.f90	(revision 1254)
+++ palm/trunk/SOURCE/diffusion_v.f90	(revision 1257)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! -----------------
-!
+! openacc loop and loop vector clauses removed, declare create moved after
+! the FORTRAN declaration statement
 !
 ! Former revisions:
@@ -262,6 +263,6 @@
        REAL    ::  kmxm, kmxp, kmzm, kmzp
 
+       REAL, DIMENSION(nzb:nzt+1,nys:nyn,nxl:nxr) ::  vsus
        !$acc declare create ( vsus )
-       REAL, DIMENSION(nzb:nzt+1,nys:nyn,nxl:nxr) ::  vsus
 
 !
@@ -276,10 +277,8 @@
        !$acc         present ( ddzu, ddzw, fxm, fxp, wall_v )           &
        !$acc         present ( nzb_v_inner, nzb_v_outer, nzb_diff_v )
-       !$acc loop
        DO  i = i_left, i_right
           DO  j = j_south, j_north
 !
 !--          Compute horizontal diffusion
-             !$acc loop vector(32)
              DO  k = 1, nzt
                 IF ( k > nzb_v_outer(j,i) )  THEN
@@ -306,5 +305,4 @@
 !
 !--          Wall functions at the left and right walls, respectively
-             !$acc loop vector(32)
              DO  k = 1, nzt
                 IF( k > nzb_v_inner(j,i)  .AND.  k <= nzb_v_outer(j,i)  .AND. &
@@ -337,5 +335,4 @@
 !--          Compute vertical diffusion. In case of simulating a Prandtl
 !--          layer, index k starts at nzb_v_inner+2.
-             !$acc loop vector(32)
              DO  k = 1, nzt_diff
                 IF ( k >= nzb_diff_v(j,i) )  THEN
@@ -373,7 +370,5 @@
        IF ( use_surface_fluxes )  THEN
 
-          !$acc loop
           DO  i = i_left, i_right
-             !$acc loop vector(32)
              DO  j = j_south, j_north
           
@@ -404,7 +399,5 @@
           k = nzt
 
-          !$acc loop
           DO  i = i_left, i_right
-             !$acc loop vector(32)
              DO  j = j_south, j_north
 
Index: palm/trunk/SOURCE/diffusion_w.f90
===================================================================
--- palm/trunk/SOURCE/diffusion_w.f90	(revision 1254)
+++ palm/trunk/SOURCE/diffusion_w.f90	(revision 1257)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! -----------------
-!
+! openacc loop and loop vector clauses removed, declare create moved after
+! the FORTRAN declaration statement
 !
 ! Former revisions:
@@ -214,7 +215,6 @@
        REAL    ::  kmxm, kmxp, kmym, kmyp
 
+       REAL, DIMENSION(nzb:nzt+1,nys:nyn,nxl:nxr) ::  wsus, wsvs
        !$acc declare create ( wsus, wsvs )
-       REAL, DIMENSION(nzb:nzt+1,nys:nyn,nxl:nxr) ::  wsus, wsvs
-
 
 !
@@ -231,8 +231,6 @@
        !$acc         present ( ddzu, ddzw, fwxm, fwxp, fwym, fwyp, wall_w_x, wall_w_y )           &
        !$acc         present ( nzb_w_inner, nzb_w_outer )
-       !$acc loop
        DO  i = i_left, i_right
           DO  j = j_south, j_north
-             !$acc loop vector( 32 )
              DO  k = 1, nzt
                 IF ( k > nzb_w_outer(j,i) )  THEN
@@ -268,5 +266,4 @@
 !
 !--          Wall functions at all vertical walls, where necessary
-             !$acc loop vector( 32 )
              DO  k = 1,nzt
 
Index: palm/trunk/SOURCE/exchange_horiz.f90
===================================================================
--- palm/trunk/SOURCE/exchange_horiz.f90	(revision 1254)
+++ palm/trunk/SOURCE/exchange_horiz.f90	(revision 1257)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-!
+! openacc loop and loop vector clauses removed
 !
 ! Former revisions:
@@ -245,5 +245,4 @@
           DO  i = 0, nbgp_local-1
              DO  j = nys-nbgp_local, nyn+nbgp_local
-                !$acc loop vector( 32 )
                 DO  k = nzb, nzt+1
                    ar(k,j,nxl-nbgp_local+i) = ar(k,j,nxr-nbgp_local+1+i)
@@ -262,9 +261,8 @@
        IF ( on_device )  THEN
           !$acc kernels present( ar )
-          !$acc loop
           DO  i = nxl-nbgp_local, nxr+nbgp_local
              !$acc loop independent
              DO  j = 0, nbgp_local-1
-                !$acc loop vector( 32 )
+                !$acc loop independent
                 DO  k = nzb, nzt+1
                    ar(k,nys-nbgp_local+j,i) = ar(k,nyn-nbgp_local+1+j,i)
Index: palm/trunk/SOURCE/fft_xy.f90
===================================================================
--- palm/trunk/SOURCE/fft_xy.f90	(revision 1254)
+++ palm/trunk/SOURCE/fft_xy.f90	(revision 1257)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! -----------------
-!
+! openacc loop and loop vector clauses removed, declare create moved after
+! the FORTRAN declaration statement
 !
 ! Former revisions:
@@ -328,6 +329,6 @@
        REAL, DIMENSION(6*(nx+1)) ::  work2
 #elif defined( __cuda_fft )
+       COMPLEX(dpk), DIMENSION(0:(nx+1)/2,nys_x:nyn_x,nzb_x:nzt_x) ::  ar_tmp
        !$acc declare create( ar_tmp )
-       COMPLEX(dpk), DIMENSION(0:(nx+1)/2,nys_x:nyn_x,nzb_x:nzt_x) ::  ar_tmp
 #endif
        REAL, DIMENSION(0:nx,nys_x:nyn_x), OPTIONAL   ::  ar_2d
@@ -634,14 +635,11 @@
 
              !$acc kernels
-             !$acc loop
              DO  k = nzb_x, nzt_x
                 DO  j = nys_x, nyn_x
 
-                   !$acc loop vector( 32 )
                    DO  i = 0, (nx+1)/2
                       ar(i,j,k)      = REAL( ar_tmp(i,j,k) )  * dnx
                    ENDDO
 
-                   !$acc loop vector( 32 )
                    DO  i = 1, (nx+1)/2 - 1
                       ar(nx+1-i,j,k) = AIMAG( ar_tmp(i,j,k) ) * dnx
@@ -657,5 +655,4 @@
              !$acc data present( ar )
              !$acc kernels
-             !$acc loop
              DO  k = nzb_x, nzt_x
                 DO  j = nys_x, nyn_x
@@ -663,5 +660,4 @@
                    ar_tmp(0,j,k) = CMPLX( ar(0,j,k), 0.0 )
 
-                   !$acc loop vector( 32 )
                    DO  i = 1, (nx+1)/2 - 1
                       ar_tmp(i,j,k) = CMPLX( ar(i,j,k), ar(nx+1-i,j,k) )
@@ -957,6 +953,6 @@
        REAL, DIMENSION(6*(ny+1)) ::  work2
 #elif defined( __cuda_fft )
+       COMPLEX(dpk), DIMENSION(0:(ny+1)/2,nxl_y:nxr_y,nzb_y:nzt_y) ::  ar_tmp
        !$acc declare create( ar_tmp )
-       COMPLEX(dpk), DIMENSION(0:(ny+1)/2,nxl_y:nxr_y,nzb_y:nzt_y) ::  ar_tmp
 #endif
        REAL, DIMENSION(0:ny,nxl_y_l:nxr_y_l,nzb_y:nzt_y) ::  ar
@@ -1236,14 +1232,11 @@
 
              !$acc kernels
-             !$acc loop
              DO  k = nzb_y, nzt_y
                 DO  i = nxl_y, nxr_y
 
-                   !$acc loop vector( 32 )
                    DO  j = 0, (ny+1)/2
                       ar(j,i,k)      = REAL( ar_tmp(j,i,k) )  * dny
                    ENDDO
 
-                   !$acc loop vector( 32 )
                    DO  j = 1, (ny+1)/2 - 1
                       ar(ny+1-j,i,k) = AIMAG( ar_tmp(j,i,k) ) * dny
@@ -1259,5 +1252,4 @@
              !$acc data present( ar )
              !$acc kernels
-             !$acc loop
              DO  k = nzb_y, nzt_y
                 DO  i = nxl_y, nxr_y
@@ -1265,5 +1257,4 @@
                    ar_tmp(0,i,k) = CMPLX( ar(0,i,k), 0.0 )
 
-                   !$acc loop vector( 32 )
                    DO  j = 1, (ny+1)/2 - 1
                       ar_tmp(j,i,k) = CMPLX( ar(j,i,k), ar(ny+1-j,i,k) )
Index: palm/trunk/SOURCE/flow_statistics.f90
===================================================================
--- palm/trunk/SOURCE/flow_statistics.f90	(revision 1254)
+++ palm/trunk/SOURCE/flow_statistics.f90	(revision 1257)
@@ -21,5 +21,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! openacc "end parallel" replaced by "end parallel loop"
 !
 ! Former revisions:
@@ -1468,5 +1468,5 @@
           sums_l(k,4,tn) = s3
        ENDDO
-       !$acc end parallel
+       !$acc end parallel loop
 
 !
@@ -1484,5 +1484,5 @@
              sums_l(k,23,tn) = s1
           ENDDO
-          !$acc end parallel
+          !$acc end parallel loop
        ENDIF
 
@@ -1506,5 +1506,5 @@
              sums_l(k,44,tn) = s2
           ENDDO
-          !$acc end parallel
+          !$acc end parallel loop
 
           IF ( cloud_physics )  THEN
@@ -1524,5 +1524,5 @@
                 sums_l(k,43,tn) = s2
              ENDDO
-             !$acc end parallel
+             !$acc end parallel loop
           ENDIF
        ENDIF
@@ -1542,5 +1542,5 @@
              sums_l(k,41,tn) = s1
           ENDDO
-          !$acc end parallel
+          !$acc end parallel loop
        ENDIF
        !$OMP END PARALLEL
@@ -1747,5 +1747,5 @@
           sums_l(k,38,tn) = s7
        ENDDO
-       !$acc end parallel
+       !$acc end parallel loop
 
        IF ( humidity )  THEN
@@ -1762,5 +1762,5 @@
              sums_l(k,70,tn) = s1
           ENDDO
-          !$acc end parallel
+          !$acc end parallel loop
        ENDIF
 
@@ -1778,5 +1778,5 @@
           ENDDO
        ENDDO
-       !$acc end parallel
+       !$acc end parallel loop
        !$acc parallel present( sums_l )
        sums_l(nzb+4,pr_palm,tn) = s1
@@ -1843,5 +1843,5 @@
              sums_l(k,34,tn) = s4
           ENDDO
-          !$acc end parallel
+          !$acc end parallel loop
 !
 !--       Total perturbation TKE
@@ -1908,5 +1908,5 @@
           sums_l(k,16,tn) = s3
        ENDDO
-       !$acc end parallel
+       !$acc end parallel loop
 
 !
@@ -1925,5 +1925,5 @@
              sums_l(k,65,tn) = s1
           ENDDO
-          !$acc end parallel
+          !$acc end parallel loop
        ENDIF
 
@@ -1948,5 +1948,5 @@
              sums_l(k,48,tn) = s2
           ENDDO
-          !$acc end parallel
+          !$acc end parallel loop
 
           IF ( cloud_physics ) THEN
@@ -1965,5 +1965,5 @@
                 sums_l(k,51,tn) = s1
              ENDDO
-             !$acc end parallel
+             !$acc end parallel loop
 
           ENDIF
@@ -1986,5 +1986,5 @@
              sums_l(k,48,tn) = s1
           ENDDO
-          !$acc end parallel
+          !$acc end parallel loop
 
        ENDIF
@@ -2232,5 +2232,5 @@
           sums_l(k,37,tn) = s3
        ENDDO
-       !$acc end parallel
+       !$acc end parallel loop
 
 !
@@ -2253,5 +2253,5 @@
                 sums_l(k,66,tn) = s1
              ENDDO
-             !$acc end parallel
+             !$acc end parallel loop
 
           ENDIF
@@ -2269,5 +2269,5 @@
              sums_l(k,71,tn) = s2
           ENDDO
-          !$acc end parallel
+          !$acc end parallel loop
 
        ENDIF
@@ -2292,5 +2292,5 @@
                 sums_l(k,46,tn) = s1
              ENDDO
-             !$acc end parallel
+             !$acc end parallel loop
 
              IF ( .NOT. cloud_droplets )  THEN
@@ -2308,5 +2308,5 @@
                    sums_l(k,52,tn) = s1
                 ENDDO
-                !$acc end parallel
+                !$acc end parallel loop
 
                 IF ( icloud_scheme == 0  )  THEN
@@ -2324,5 +2324,5 @@
                       sums_l(k,75,tn) = s2
                    ENDDO
-                   !$acc end parallel
+                   !$acc end parallel loop
 
                    IF ( precipitation )  THEN
@@ -2342,5 +2342,5 @@
                          sums_l(k,76,tn) = s3
                       ENDDO
-                      !$acc end parallel
+                      !$acc end parallel loop
 
                    ENDIF
@@ -2358,5 +2358,5 @@
                       sums_l(k,54,tn) = s1
                    ENDDO
-                   !$acc end parallel
+                   !$acc end parallel loop
 
                 ENDIF
@@ -2374,5 +2374,5 @@
                    sums_l(k,54,tn) = s1
                 ENDDO
-                !$acc end parallel
+                !$acc end parallel loop
 
              ENDIF
@@ -2394,5 +2394,5 @@
                    sums_l(k,46,tn) = s1
                 ENDDO
-                !$acc end parallel
+                !$acc end parallel loop
 
              ELSEIF ( ws_scheme_sca  .AND.  sr == 0 )  THEN
@@ -2403,5 +2403,5 @@
                                              0.61 * hom(k,1,4,sr) * sums_l(k,49,tn)
                 ENDDO
-                !$acc end parallel
+                !$acc end parallel loop
 
              ENDIF
@@ -2426,5 +2426,5 @@
              sums_l(k,49,tn) = s1
           ENDDO
-          !$acc end parallel
+          !$acc end parallel loop
 
        ENDIF
@@ -2459,5 +2459,5 @@
              sums_l(k,15,tn) = s1
           ENDDO
-          !$acc end parallel
+          !$acc end parallel loop
 
        ENDIF
@@ -2480,5 +2480,5 @@
              sums_l(k,17,tn) = s1
           ENDDO
-          !$acc end parallel
+          !$acc end parallel loop
 
           IF ( humidity )  THEN
@@ -2496,5 +2496,5 @@
                 sums_l(k,49,tn) = s1
              ENDDO
-             !$acc end parallel
+             !$acc end parallel loop
 
           ENDIF
Index: palm/trunk/SOURCE/modules.f90
===================================================================
--- palm/trunk/SOURCE/modules.f90	(revision 1254)
+++ palm/trunk/SOURCE/modules.f90	(revision 1257)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! ------------------
-!
+! set default values for grid indices of maximum velocity components u|v|w_max_ijk
 !
 ! Former revisions:
@@ -1679,5 +1679,5 @@
     CHARACTER (LEN=40) ::  region(0:9)
     INTEGER ::  pr_palm = 90, statistic_regions = 0
-    INTEGER ::  u_max_ijk(3), v_max_ijk(3), w_max_ijk(3)
+    INTEGER ::  u_max_ijk(3) = -1, v_max_ijk(3) = -1, w_max_ijk(3) = -1
     LOGICAL ::  flow_statistics_called = .FALSE.
     REAL ::     u_max, v_max, w_max
Index: palm/trunk/SOURCE/prandtl_fluxes.f90
===================================================================
--- palm/trunk/SOURCE/prandtl_fluxes.f90	(revision 1254)
+++ palm/trunk/SOURCE/prandtl_fluxes.f90	(revision 1257)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-!
+! openACC "kernels do" replaced by "kernels loop", "loop independent" added
 !
 ! Former revisions:
@@ -101,5 +101,5 @@
 !--    for u* use the value from the previous time step
        !$OMP PARALLEL DO
-       !$acc kernels do
+       !$acc kernels loop
        DO  i = nxlg, nxrg
           DO  j = nysg, nyng
@@ -118,5 +118,5 @@
 !--    (the Richardson number is still the one from the previous time step)
        !$OMP PARALLEL DO PRIVATE( a, b, k, z_p )
-       !$acc kernels do
+       !$acc kernels loop
        DO  i = nxlg, nxrg
           DO  j = nysg, nyng
@@ -151,5 +151,5 @@
     IF ( .NOT. humidity )  THEN
        !$OMP PARALLEL DO PRIVATE( k, z_p )
-       !$acc kernels do
+       !$acc kernels loop
        DO  i = nxlg, nxrg
           DO  j = nysg, nyng
@@ -170,5 +170,5 @@
     ELSE
        !$OMP PARALLEL DO PRIVATE( k, z_p )
-       !$acc kernels do
+       !$acc kernels loop
        DO  i = nxlg, nxrg
           DO  j = nysg, nyng
@@ -193,5 +193,5 @@
 !-- Compute u* at the scalars' grid points
     !$OMP PARALLEL DO PRIVATE( a, b, k, uv_total, z_p )
-    !$acc kernels do
+    !$acc kernels loop
     DO  i = nxl, nxr
        DO  j = nys, nyn
@@ -243,5 +243,5 @@
 !-- First compute the corresponding component of u* and square it.
     !$OMP PARALLEL DO PRIVATE( a, b, k, rifm, z_p )
-    !$acc kernels do
+    !$acc kernels loop
     DO  i = nxl, nxr
        DO  j = nys, nyn
@@ -281,5 +281,5 @@
 !-- First compute the corresponding component of u* and square it.
     !$OMP PARALLEL DO PRIVATE( a, b, k, rifm, z_p )
-    !$acc kernels do
+    !$acc kernels loop
     DO  i = nxl, nxr
        DO  j = nys, nyn
@@ -322,5 +322,5 @@
 !--       For a given water flux in the Prandtl layer:
           !$OMP PARALLEL DO
-          !$acc kernels do
+          !$acc kernels loop
           DO  i = nxlg, nxrg
              DO  j = nysg, nyng
@@ -332,6 +332,7 @@
           coupled_run = ( coupling_mode == 'atmosphere_to_ocean' .AND. run_coupled )
           !$OMP PARALLEL DO PRIVATE( a, b, k, z_p )
-          !$acc kernels do
+          !$acc kernels loop independent
           DO  i = nxlg, nxrg
+             !$acc loop independent
              DO  j = nysg, nyng
 
@@ -387,6 +388,7 @@
     IF ( .NOT. constant_heatflux )  THEN
        !$OMP PARALLEL DO
-       !$acc kernels do
-       DO  i = nxlg, nxrg
+       !$acc kernels loop independent
+       DO  i = nxlg, nxrg
+          !$acc loop independent
           DO  j = nysg, nyng
              shf(j,i) = -ts(j,i) * us(j,i)
@@ -399,6 +401,7 @@
     IF ( .NOT. constant_waterflux .AND. ( humidity .OR. passive_scalar ) ) THEN
        !$OMP PARALLEL DO
-       !$acc kernels do
-       DO  i = nxlg, nxrg
+       !$acc kernels loop independent
+       DO  i = nxlg, nxrg
+          !$acc loop independent
           DO  j = nysg, nyng
              qsws(j,i) = -qs(j,i) * us(j,i)
@@ -411,6 +414,7 @@
     IF ( ibc_e_b == 2 )  THEN
        !$OMP PARALLEL DO
-       !$acc kernels do
-       DO  i = nxlg, nxrg
+       !$acc kernels loop independent
+       DO  i = nxlg, nxrg
+          !$acc loop independent
           DO  j = nysg, nyng
              e(nzb_s_inner(j,i)+1,j,i) = ( us(j,i) / 0.1 )**2
Index: palm/trunk/SOURCE/pres.f90
===================================================================
--- palm/trunk/SOURCE/pres.f90	(revision 1254)
+++ palm/trunk/SOURCE/pres.f90	(revision 1257)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! ------------------
-!
+! openacc loop and loop vector clauses removed, independent clauses added,
+! end parallel replaced by end parallel loop
 !
 ! Former revisions:
@@ -321,8 +322,6 @@
        !$OMP PARALLEL DO SCHEDULE( STATIC )
        !$acc kernels present( d )
-       !$acc loop
        DO  i = nxl, nxr
           DO  j = nys, nyn
-             !$acc loop vector(32)
              DO  k = nzb+1, nzt
                 d(k,j,i) = 0.0
@@ -391,5 +390,5 @@
        ENDDO
     ENDDO
-    !$acc end parallel
+    !$acc end parallel loop
     localsum = localsum + threadsum * dt_3d * &
                           weight_pres(intermediate_timestep_count)
@@ -421,8 +420,6 @@
        !$OMP PARALLEL DO
        !$acc kernels present( d, tend )
-       !$acc loop
        DO  i = nxl, nxr
           DO  j = nys, nyn
-             !$acc loop vector( 32 )
              DO  k = nzb+1, nzt
                 tend(k,j,i) = d(k,j,i)
@@ -558,8 +555,9 @@
        !$OMP DO
        !$acc kernels present( p, tend, weight_substep )
-       !$acc loop
+       !$acc loop independent
        DO  i = nxl-1, nxr+1
+          !$acc loop independent
           DO  j = nys-1, nyn+1
-             !$acc loop vector( 32 )
+             !$acc loop independent
              DO  k = nzb, nzt+1
                 p(k,j,i) = tend(k,j,i) * &
@@ -575,8 +573,9 @@
        !$OMP DO
        !$acc kernels present( p, tend, weight_substep )
-       !$acc loop
+       !$acc loop independent
        DO  i = nxl-1, nxr+1
+          !$acc loop independent
           DO  j = nys-1, nyn+1
-             !$acc loop vector( 32 )
+             !$acc loop independent
              DO  k = nzb, nzt+1
                 p(k,j,i) = p(k,j,i) + tend(k,j,i) * &
@@ -605,8 +604,9 @@
     !$OMP DO
     !$acc kernels present( ddzu, nzb_u_inner, nzb_v_inner, nzb_w_inner, tend, u, v, w, weight_pres )
-    !$acc loop
+    !$acc loop independent
     DO  i = nxl, nxr   
-       DO  j = nys, nyn
-          !$acc loop vector( 32 )
+       !$acc loop independent
+       DO  j = nys, nyn
+          !$acc loop independent
           DO  k = 1, nzt
              IF ( k > nzb_w_inner(j,i) )  THEN
@@ -616,5 +616,5 @@
              ENDIF
           ENDDO
-          !$acc loop vector( 32 )
+          !$acc loop independent
           DO  k = 1, nzt
              IF ( k > nzb_u_inner(j,i) )  THEN
@@ -624,5 +624,5 @@
              ENDIF
           ENDDO
-          !$acc loop vector( 32 )
+          !$acc loop independent
           DO  k = 1, nzt
              IF ( k > nzb_v_inner(j,i) )  THEN
@@ -773,5 +773,5 @@
        ENDDO
     ENDDO
-    !$acc end parallel
+    !$acc end parallel loop
 #endif
 
Index: palm/trunk/SOURCE/production_e.f90
===================================================================
--- palm/trunk/SOURCE/production_e.f90	(revision 1254)
+++ palm/trunk/SOURCE/production_e.f90	(revision 1257)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! -----------------
-!
+! openacc loop and loop vector clauses removed, declare create moved after
+! the FORTRAN declaration statement
 !
 ! Former revisions:
@@ -726,7 +727,6 @@
                    k1, k2, km_neutral, theta, temp
 
+       REAL, DIMENSION(nzb:nzt+1,nys:nyn,nxl:nxr) ::  usvs, vsus, wsus, wsvs
        !$acc declare create ( usvs, vsus, wsus, wsvs )
-       REAL, DIMENSION(nzb:nzt+1,nys:nyn,nxl:nxr) ::  usvs, vsus, wsus, wsvs
-!       REAL, DIMENSION(nzb:nzt+1) ::   usvs, vsus, wsus, wsvs
 
 !
@@ -749,8 +749,6 @@
        !$acc         present( shf, tend, tswst, u, v, vpt, w, wall_e_x, wall_e_y )      &
        !$acc         copyin( u_0, v_0 )
-       !$acc loop
        DO  i = i_left, i_right
           DO  j = j_south, j_north
-             !$acc loop vector( 32 )
              DO  k = 1, nzt
 
@@ -795,8 +793,6 @@
 !--       (2) - Will allways be executed.
 !--       'bottom and wall: use u_0,v_0 and wall functions'
-          !$acc loop
           DO  i = i_left, i_right
              DO  j = j_south, j_north
-                !$acc loop vector( 32 )
                 DO  k = 1, nzt
 
@@ -1007,8 +1003,6 @@
 !--       (1) - will allways be executed.
 !--       'bottom only: use u_0,v_0'
-          !$acc loop
           DO  i = i_left, i_right
              DO  j = j_south, j_north
-                !$acc loop vector( 32 )
                 DO  k = 1, nzt
 
@@ -1054,9 +1048,7 @@
        ELSEIF ( use_surface_fluxes )  THEN
 
-          !$acc loop
           DO  i = i_left, i_right
              DO  j = j_south, j_north
-                !$acc loop vector(32)
-                DO  k = 1, nzt
+                 DO  k = 1, nzt
 
                    IF ( k == nzb_diff_s_outer(j,i)-1 )  THEN
@@ -1108,8 +1100,6 @@
 !--                So far in the ocean no special treatment of density flux
 !--                in the bottom and top surface layer
-                   !$acc loop
                    DO  i = i_left, i_right
                       DO  j = j_south, j_north
-                         !$acc loop vector( 32 )
                          DO  k = 1, nzt
                             IF ( k > nzb_s_inner(j,i) )  THEN
@@ -1125,8 +1115,6 @@
                 ELSE
 
-                   !$acc loop
                    DO  i = i_left, i_right
                       DO  j = j_south, j_north
-                         !$acc loop vector( 32 )
                          DO  k = 1, nzt_diff
                             IF ( k >= nzb_diff_s_inner(j,i) )  THEN
@@ -1159,8 +1147,6 @@
 !--                So far in the ocean no special treatment of density flux
 !--                in the bottom and top surface layer
-                   !$acc loop
                    DO  i = i_left, i_right
                       DO  j = j_south, j_north
-                         !$acc loop vector( 32 )
                          DO  k = 1, nzt
                             IF ( k > nzb_s_inner(j,i) )  THEN
@@ -1176,8 +1162,6 @@
                 ELSE
 
-                   !$acc loop
                    DO  i = i_left, i_right
                       DO  j = j_south, j_north
-                         !$acc loop vector( 32 )
                          DO  k = 1, nzt_diff
                             IF( k >= nzb_diff_s_inner(j,i) )  THEN
@@ -1214,5 +1198,5 @@
 !             DO  i = nxl, nxr
 !                DO  j = nys, nyn
-!                   !acc loop vector( 32 )
+!                   !acc loop vector
 !                   DO  k = 1, nzt_diff
 !
@@ -1271,5 +1255,5 @@
 !                DO  i = nxl, nxr
 !                   DO  j = nys, nyn
-!                      !acc loop vector( 32 )
+!                      !acc loop vector
 !                      DO  k = 1, nzt_diff
 !
@@ -1313,5 +1297,5 @@
 !                DO  i = nxl, nxr
 !                   DO  j = nys, nyn
-!                      !acc loop vector( 32 )
+!                      !acc loop vector
 !                      DO  k = 1, nzt
 !                         IF ( k == nzt )  THEN
Index: palm/trunk/SOURCE/prognostic_equations.f90
===================================================================
--- palm/trunk/SOURCE/prognostic_equations.f90	(revision 1254)
+++ palm/trunk/SOURCE/prognostic_equations.f90	(revision 1257)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! ------------------
-! 
+! openacc loop vector clauses removed, independent clauses added
 !
 ! Former revisions:
@@ -1536,8 +1536,9 @@
 !-- Prognostic equation for u-velocity component
     !$acc kernels present( nzb_u_inner, rdf, tend, tu_m, u, ug, u_p )
-    !$acc loop
+    !$acc loop independent
     DO  i = i_left, i_right
+       !$acc loop independent
        DO  j = j_south, j_north
-          !$acc loop vector( 32 )
+          !$acc loop independent
           DO  k = 1, nzt
              IF ( k > nzb_u_inner(j,i) )  THEN
@@ -1602,8 +1603,9 @@
 !-- Prognostic equation for v-velocity component
     !$acc kernels present( nzb_v_inner, rdf, tend, tv_m, v, vg, v_p )
-    !$acc loop
+    !$acc loop independent
     DO  i = i_left, i_right
+       !$acc loop independent
        DO  j = j_south, j_north
-          !$acc loop vector( 32 )
+          !$acc loop independent
           DO  k = 1, nzt
              IF ( k > nzb_v_inner(j,i) )  THEN
@@ -1664,8 +1666,9 @@
 !-- Prognostic equation for w-velocity component
     !$acc kernels present( nzb_w_inner, rdf, tend, tw_m, w, w_p )
-    !$acc loop
+    !$acc loop independent
     DO  i = i_left, i_right
+       !$acc loop independent
        DO  j = j_south, j_north
-          !$acc loop vector( 32 )
+          !$acc loop independent
           DO  k = 1, nzt-1
              IF ( k > nzb_w_inner(j,i) )  THEN
@@ -1762,8 +1765,9 @@
        !$acc kernels present( nzb_s_inner, rdf_sc, ptdf_x, ptdf_y, pt_init ) &
        !$acc         present( tend, tpt_m, pt, pt_p )
-       !$acc loop
+       !$acc loop independent
        DO  i = i_left, i_right
+          !$acc loop independent
           DO  j = j_south, j_north
-             !$acc loop vector( 32 )
+             !$acc loop independent
              DO  k = 1, nzt
                 IF ( k > nzb_s_inner(j,i) )  THEN
@@ -2012,8 +2016,9 @@
 !--    value is reduced by 90%.
        !$acc kernels present( e, e_p, nzb_s_inner, tend, te_m )
-       !$acc loop
+       !$acc loop independent
        DO  i = i_left, i_right
+          !$acc loop independent
           DO  j = j_south, j_north
-             !$acc loop vector( 32 )
+             !$acc loop independent
              DO  k = 1, nzt
                 IF ( k > nzb_s_inner(j,i) )  THEN
Index: palm/trunk/SOURCE/run_control.f90
===================================================================
--- palm/trunk/SOURCE/run_control.f90	(revision 1254)
+++ palm/trunk/SOURCE/run_control.f90	(revision 1257)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-!
+! output format for theta* changed to avoid output of *****
 !
 ! Former revisions:
@@ -126,14 +126,14 @@
               &'------------------'// &
           &'RUN  ITER. HH:MM:SS.SS    DT(E)     UMAX     VMAX     WMAX     U', &
-          &'*    W*   THETA*    Z_I     ENERG.   DISTENERG    DIVOLD     DIV', &
-          &'NEW     UMAX(KJI)    VMAX(KJI)    WMAX(KJI)   ADVECX   ADVECY   ', &
-          &'MGCYC'/                                                            &
+          &'*    W*      THETA*     Z_I     ENERG.   DISTENERG    DIVOLD    ', &
+          &' DIVNEW     UMAX(KJI)    VMAX(KJI)    WMAX(KJI)   ADVECX   ADVEC', &
+          &'Y   MGCYC'/                                                        &
           &'----------------------------------------------------------------', &
           &'----------------------------------------------------------------', &
           &'----------------------------------------------------------------', &
-          &'-----')
+          &'---------')
 101 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, &
             F4.2, &
-            2X,F6.3,2X,F6.0,1X,4(E10.3,1X),3(3(I4),1X),F8.3,1X,F8.3,5X,I3)
+            2X,E10.3,2X,F6.0,1X,4(E10.3,1X),3(3(I4),1X),F8.3,1X,F8.3,5X,I3)
 
  END SUBROUTINE run_control
Index: palm/trunk/SOURCE/time_integration.f90
===================================================================
--- palm/trunk/SOURCE/time_integration.f90	(revision 1254)
+++ palm/trunk/SOURCE/time_integration.f90	(revision 1257)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! ------------------
-!
+! acc-update-host directive for timestep removed
 !
 ! Former revisions:
@@ -223,5 +223,4 @@
 !--    Determine size of next time step
        IF ( simulated_time /= 0.0 )  THEN
-          !$acc update host( kh, km, u, v, w )
           CALL timestep
        ENDIF
Index: palm/trunk/SOURCE/timestep.f90
===================================================================
--- palm/trunk/SOURCE/timestep.f90	(revision 1254)
+++ palm/trunk/SOURCE/timestep.f90	(revision 1257)
@@ -20,5 +20,7 @@
 ! Current revisions:
 ! ------------------
-! 
+! openacc porting
+! bugfix for calculation of advective timestep in case of vertically stretched
+! grids
 !
 ! Former revisions:
@@ -93,11 +95,13 @@
     IMPLICIT NONE
 
-    INTEGER ::  i, j, k, u_max_cfl_ijk(3), v_max_cfl_ijk(3)
-
-    REAL ::  div, dt_diff, dt_diff_l, dt_plant_canopy, dt_plant_canopy_l,  &
-             dt_plant_canopy_u, dt_plant_canopy_v, dt_plant_canopy_w,      & 
-             dt_u, dt_v, dt_w, u_max_cfl, value, v_max_cfl
+    INTEGER ::  i, j, k
+
+    REAL ::  div, dt_diff, dt_diff_l, dt_plant_canopy, dt_plant_canopy_l,     &
+             dt_plant_canopy_u, dt_plant_canopy_v, dt_plant_canopy_w,         &
+             dt_u, dt_u_l, dt_v, dt_v_l, dt_w, dt_w_l, u_gtrans_l, u_max_l,   &
+             u_min_l, value, v_gtrans_l, v_max_l, v_min_l, w_max_l, w_min_l
 
     REAL, DIMENSION(2)         ::  uv_gtrans, uv_gtrans_l
+    REAL, DIMENSION(3)         ::  reduce, reduce_l
     REAL, DIMENSION(nzb+1:nzt) ::  dxyz2_min
 
@@ -127,14 +131,18 @@
 !
 !--       Averaging over the entire model domain.
-          uv_gtrans_l = 0.0
+          u_gtrans_l = 0.0
+          v_gtrans_l = 0.0
+          !$acc parallel present( u, v )
           DO  i = nxl, nxr
              DO  j = nys, nyn
                 DO  k = nzb+1, nzt
-                   uv_gtrans_l(1) = uv_gtrans_l(1) + u(k,j,i)
-                   uv_gtrans_l(2) = uv_gtrans_l(2) + v(k,j,i)
+                   u_gtrans_l = u_gtrans_l + u(k,j,i)
+                   v_gtrans_l = v_gtrans_l + v(k,j,i)
                 ENDDO
              ENDDO
           ENDDO
-          uv_gtrans_l = uv_gtrans_l / REAL( (nxr-nxl+1)*(nyn-nys+1)*(nzt-nzb) )
+          !$acc end parallel
+          uv_gtrans_l(1) = u_gtrans_l / REAL( (nxr-nxl+1)*(nyn-nys+1)*(nzt-nzb) )
+          uv_gtrans_l(2) = v_gtrans_l / REAL( (nxr-nxl+1)*(nyn-nys+1)*(nzt-nzb) )
 #if defined( __parallel )
           IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
@@ -151,5 +159,64 @@
 
 !
-!-- Determine the maxima of the velocity components.
+!-- Determine the maxima of the velocity components, including their
+!-- grid index positions.
+#if defined( __openacc )
+    IF ( dt_fixed )  THEN  ! otherwise do it further below for better cache usage
+       u_max_l = -999999.9
+       u_min_l =  999999.9
+       v_max_l = -999999.9
+       v_min_l =  999999.9
+       w_max_l = -999999.9
+       w_min_l =  999999.9
+       !$acc parallel present( u, v, w )
+       DO  i = nxl, nxr
+          DO  j = nys, nyn
+             DO  k = nzb+1, nzt
+                u_max_l = MAX( u_max_l, u(k,j,i) )
+                u_min_l = MIN( u_min_l, u(k,j,i) )
+                v_max_l = MAX( v_max_l, v(k,j,i) )
+                v_min_l = MIN( v_min_l, v(k,j,i) )
+                w_max_l = MAX( w_max_l, w(k,j,i) )
+                w_min_l = MIN( w_min_l, w(k,j,i) )
+             ENDDO
+          ENDDO
+       ENDDO
+       !$acc end parallel
+#if defined( __parallel )
+       reduce_l(1) = u_max_l
+       reduce_l(2) = v_max_l
+       reduce_l(3) = w_max_l
+       IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
+       CALL MPI_ALLREDUCE( reduce_l, reduce, 3, MPI_REAL, MPI_MAX, comm2d, ierr )
+       u_max = reduce(1)
+       v_max = reduce(2)
+       w_max = reduce(3)
+       reduce_l(1) = u_min_l
+       reduce_l(2) = v_min_l
+       reduce_l(3) = w_min_l
+       IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
+       CALL MPI_ALLREDUCE( reduce_l, reduce, 3, MPI_REAL, MPI_MIN, comm2d, ierr )
+       IF ( ABS( reduce(1) ) > u_max )  u_max = reduce(1)
+       IF ( ABS( reduce(2) ) > v_max )  v_max = reduce(2)
+       IF ( ABS( reduce(3) ) > w_max )  w_max = reduce(3)
+#else
+       IF ( ABS( u_min_l ) > u_max_l )  THEN
+          u_max = u_min_l
+       ELSE
+          u_max = u_max_l
+       ENDIF
+       IF ( ABS( v_min_l ) > v_max_l )  THEN
+          v_max = v_min_l
+       ELSE
+          v_max = v_max_l
+       ENDIF
+       IF ( ABS( w_min_l ) > w_max_l )  THEN
+          w_max = w_min_l
+       ELSE
+          w_max = w_max_l
+       ENDIF
+#endif
+    ENDIF
+#else
     CALL global_min_max( nzb, nzt+1, nysg, nyng, nxlg, nxrg, u, 'abs', 0.0, &
                          u_max, u_max_ijk )
@@ -158,30 +225,121 @@
     CALL global_min_max( nzb, nzt+1, nysg, nyng, nxlg, nxrg, w, 'abs', 0.0, &
                          w_max, w_max_ijk )
-
-!
-!-- In case of Galilei transformation, the horizontal velocity maxima have
-!-- to be calculated from the transformed horizontal velocities
-    IF ( galilei_transformation )  THEN
-       CALL global_min_max( nzb, nzt+1, nysg, nyng, nxlg, nxrg, u, 'absoff', &
-                            u_gtrans, u_max_cfl, u_max_cfl_ijk )
-       CALL global_min_max( nzb, nzt+1, nysg, nyng, nxlg, nxrg, v, 'absoff', &
-                            v_gtrans, v_max_cfl, v_max_cfl_ijk )
-    ELSE
-       u_max_cfl = u_max
-       v_max_cfl = v_max
-       u_max_cfl_ijk = u_max_ijk
-       v_max_cfl_ijk = v_max_ijk
-    ENDIF
-
+#endif
 
     IF ( .NOT. dt_fixed )  THEN
+#if defined( __openacc )
 !
 !--    Variable time step:
-!
-!--    For each component, compute the maximum time step according to the 
-!--    CFL-criterion.
-       dt_u = dx / ( ABS( u_max_cfl ) + 1.0E-10 )
-       dt_v = dy / ( ABS( v_max_cfl ) + 1.0E-10 )
-       dt_w = dzu(MAX( 1, w_max_ijk(1) )) / ( ABS( w_max ) + 1.0E-10 )
+!--    Calculate the maximum time step according to the CFL-criterion,
+!--    individually for each velocity component
+       dt_u_l  =  999999.9
+       dt_v_l  =  999999.9
+       dt_w_l  =  999999.9
+       u_max_l = -999999.9
+       u_min_l =  999999.9
+       v_max_l = -999999.9
+       v_min_l =  999999.9
+       w_max_l = -999999.9
+       w_min_l =  999999.9
+       !$acc parallel loop collapse(3) present( u, v, w )
+       DO  i = nxl, nxr
+          DO  j = nys, nyn
+             DO  k = nzb+1, nzt
+                dt_u_l  = MIN( dt_u_l, ( dx     / ( ABS( u(k,j,i) - u_gtrans ) + 1.0E-10 ) ) )
+                dt_v_l  = MIN( dt_v_l, ( dy     / ( ABS( v(k,j,i) - v_gtrans ) + 1.0E-10 ) ) )
+                dt_w_l  = MIN( dt_w_l, ( dzu(k) / ( ABS( w(k,j,i) )            + 1.0E-10 ) ) )
+                u_max_l = MAX( u_max_l, u(k,j,i) )
+                u_min_l = MIN( u_min_l, u(k,j,i) )
+                v_max_l = MAX( v_max_l, v(k,j,i) )
+                v_min_l = MIN( v_min_l, v(k,j,i) )
+                w_max_l = MAX( w_max_l, w(k,j,i) )
+                w_min_l = MIN( w_min_l, w(k,j,i) )
+             ENDDO
+          ENDDO
+       ENDDO
+       !$acc end parallel
+
+#if defined( __parallel )
+       reduce_l(1) = dt_u_l
+       reduce_l(2) = dt_v_l
+       reduce_l(3) = dt_w_l
+       IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
+       CALL MPI_ALLREDUCE( reduce_l, reduce, 3, MPI_REAL, MPI_MIN, comm2d, ierr )
+       dt_u = reduce(1)
+       dt_v = reduce(2)
+       dt_w = reduce(3)
+
+       reduce_l(1) = u_max_l
+       reduce_l(2) = v_max_l
+       reduce_l(3) = w_max_l
+       IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
+       CALL MPI_ALLREDUCE( reduce_l, reduce, 3, MPI_REAL, MPI_MAX, comm2d, ierr )
+       u_max = reduce(1)
+       v_max = reduce(2)
+       w_max = reduce(3)
+       reduce_l(1) = u_min_l
+       reduce_l(2) = v_min_l
+       reduce_l(3) = w_min_l
+       IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
+       CALL MPI_ALLREDUCE( reduce_l, reduce, 3, MPI_REAL, MPI_MIN, comm2d, ierr )
+       IF ( ABS( reduce(1) ) > u_max )  u_max = reduce(1)
+       IF ( ABS( reduce(2) ) > v_max )  v_max = reduce(2)
+       IF ( ABS( reduce(3) ) > w_max )  w_max = reduce(3)
+#else
+       dt_u = dt_u_l
+       dt_v = dt_v_l
+       dt_w = dt_w_l
+
+       IF ( ABS( u_min_l ) > u_max_l )  THEN
+          u_max = u_min_l
+       ELSE
+          u_max = u_max_l
+       ENDIF
+       IF ( ABS( v_min_l ) > v_max_l )  THEN
+          v_max = v_min_l
+       ELSE
+          v_max = v_max_l
+       ENDIF
+       IF ( ABS( w_min_l ) > w_max_l )  THEN
+          w_max = w_min_l
+       ELSE
+          w_max = w_max_l
+       ENDIF
+#endif
+
+#else
+!
+!--    Variable time step:
+!--    Calculate the maximum time step according to the CFL-criterion,
+!--    individually for each velocity component
+       dt_u_l = 999999.9
+       dt_v_l = 999999.9
+       dt_w_l = 999999.9
+       DO  i = nxl, nxr
+          DO  j = nys, nyn
+             DO  k = nzb+1, nzt
+                dt_u_l = MIN( dt_u_l, ( dx     / ( ABS( u(k,j,i) - u_gtrans ) + 1.0E-10 ) ) )
+                dt_v_l = MIN( dt_v_l, ( dy     / ( ABS( v(k,j,i) - v_gtrans ) + 1.0E-10 ) ) )
+                dt_w_l = MIN( dt_w_l, ( dzu(k) / ( ABS( w(k,j,i) )            + 1.0E-10 ) ) )
+             ENDDO
+          ENDDO
+       ENDDO
+
+#if defined( __parallel )
+       reduce_l(1) = dt_u_l
+       reduce_l(2) = dt_v_l
+       reduce_l(3) = dt_w_l
+       IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
+       CALL MPI_ALLREDUCE( reduce_l, reduce, 3, MPI_REAL, MPI_MIN, comm2d, ierr )
+       dt_u = reduce(1)
+       dt_v = reduce(2)
+       dt_w = reduce(3)
+#else
+       dt_u = dt_u_l
+       dt_v = dt_v_l
+       dt_w = dt_w_l
+#endif
+
+#endif
 
 !
@@ -199,13 +357,14 @@
 !$OMP PARALLEL private(i,j,k,value) reduction(MIN: dt_diff_l)
 !$OMP DO
+       !$acc parallel loop collapse(3) present( kh, km )
        DO  i = nxl, nxr
           DO  j = nys, nyn
              DO  k = nzb+1, nzt
-                value = dxyz2_min(k) / ( MAX( kh(k,j,i), km(k,j,i) ) + 1E-20 )
-
-                dt_diff_l = MIN( value, dt_diff_l )
+                dt_diff_l = MIN( dt_diff_l, dxyz2_min(k) / &
+                                       ( MAX( kh(k,j,i), km(k,j,i) ) + 1E-20 ) )
              ENDDO
           ENDDO
        ENDDO
+       !$acc end parallel
 !$OMP END PARALLEL 
 #if defined( __parallel )
@@ -334,9 +493,9 @@
                '&dt_diff         = ', dt_diff, ' s',                          &
                '&dt_plant_canopy = ', dt_plant_canopy, ' s',                  &
-               '&u_max_cfl   = ', u_max_cfl, ' m/s   k=', u_max_cfl_ijk(1),   &
+               '&u_max           = ', u_max, ' m/s   k=', u_max_ijk(1),       &
                '  j=', u_max_ijk(2), '  i=', u_max_ijk(3),                    &
-               '&v_max_cfl   = ', v_max_cfl, ' m/s   k=', v_max_cfl_ijk(1),   &
+               '&v_max           = ', v_max, ' m/s   k=', v_max_ijk(1),       &
                '  j=', v_max_ijk(2), '  i=', v_max_ijk(3),                    &
-               '&w_max       = ', w_max, ' m/s   k=', w_max_ijk(1),           &
+               '&w_max           = ', w_max, ' m/s   k=', w_max_ijk(1),       &
                '  j=', w_max_ijk(2), '  i=', w_max_ijk(3)
           CALL message( 'timestep', 'PA0312', 0, 1, 0, 6, 0 )
Index: palm/trunk/SOURCE/transpose.f90
===================================================================
--- palm/trunk/SOURCE/transpose.f90	(revision 1254)
+++ palm/trunk/SOURCE/transpose.f90	(revision 1257)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-!
+! openacc loop and loop vector clauses removed
 !
 ! Former revisions:
@@ -97,8 +97,6 @@
     !$OMP  DO
     !$acc kernels present( f_in, f_inv )
-    !$acc loop
      DO  i = 0, nx
          DO  k = nzb_x, nzt_x
-             !$acc loop vector( 32 )
              DO  j = nys_x, nyn_x
                  f_inv(j,k,i) = f_in(i,j,k)
@@ -158,8 +156,6 @@
           ys = 0 + l * ( nyn_x - nys_x + 1 )
           !$acc kernels present( f_out, work )
-          !$acc loop
           DO  i = nxl_y, nxr_y
              DO  k = nzb_y, nzt_y
-                !$acc loop vector( 32 )
                 DO  j = ys, ys + nyn_x - nys_x
                    f_out(j,i,k) = work(j-ys+1,k,i,l)
@@ -180,8 +176,6 @@
 !$OMP  DO
        !$acc kernels present( f_inv, f_out )
-       !$acc loop
        DO  k = nzb_y, nzt_y
           DO  i = nxl_y, nxr_y
-             !$acc loop vector( 32 )
              DO  j = 0, ny
                 f_out(j,i,k) = f_inv(j,k,i)
@@ -225,8 +219,6 @@
     !$OMP  DO
     !$acc kernels present( f_inv, f_out )
-    !$acc loop
      DO  k = 1, nz
          DO  i = nxl, nxr
-             !$acc loop vector( 32 )
              DO  j = nys, nyn
                  f_out(k,j,i) = f_inv(j,i,k)
@@ -279,8 +271,6 @@
           xs = 0 + l * nnx
           !$acc kernels present( f_in, work )
-          !$acc loop
           DO  k = nzb_x, nzt_x
              DO  i = xs, xs + nnx - 1
-                !$acc loop vector( 32 )
                 DO  j = nys_x, nyn_x
                    work(j,i-xs+1,k,l) = f_in(i,j,k)
@@ -311,8 +301,6 @@
 !$OMP  DO
        !$acc kernels present( f_in, f_inv )
-       !$acc loop
        DO  i = nxl, nxr
           DO  j = nys, nyn
-             !$acc loop vector( 32 )
              DO  k = 1, nz
                 f_inv(j,i,k) = f_in(i,j,k)
@@ -354,8 +342,6 @@
     !$OMP  DO
     !$acc kernels present( f_inv, f_out )
-    !$acc loop
      DO  i = 0, nx
          DO  k = nzb_x, nzt_x
-             !$acc loop vector( 32 )
              DO  j = nys_x, nyn_x
                  f_out(i,j,k) = f_inv(j,k,i)
@@ -405,8 +391,6 @@
           ys = 0 + l * ( nyn_x - nys_x + 1 )
           !$acc kernels present( f_in, work )
-          !$acc loop
           DO  i = nxl_y, nxr_y
              DO  k = nzb_y, nzt_y
-                !$acc loop vector( 32 )
                 DO  j = ys, ys + nyn_x - nys_x
                    work(j-ys+1,k,i,l) = f_in(j,i,k)
@@ -437,8 +421,6 @@
 !$OMP  DO
        !$acc kernels present( f_in, f_inv )
-       !$acc loop
        DO  i = nxl_y, nxr_y
           DO  k = nzb_y, nzt_y
-             !$acc loop vector( 32 )
              DO  j = 0, ny
                 f_inv(j,k,i) = f_in(j,i,k)
@@ -548,8 +530,6 @@
     !$OMP  DO
     !$acc kernels present( f_in, f_inv )
-    !$acc loop
      DO  j = 0, ny
          DO  k = nzb_y, nzt_y
-             !$acc loop vector( 32 )
              DO  i = nxl_y, nxr_y
                  f_inv(i,k,j) = f_in(j,i,k)
@@ -596,8 +576,6 @@
 !$OMP  DO
        !$acc kernels present( f_inv, f_out )
-       !$acc loop
        DO  j = 0, ny
           DO  k = nzb_y, nzt_y
-             !$acc loop vector( 32 )
              DO  i = nxl_y, nxr_y
                 f_out(i,j,k) = f_inv(i,k,j)
@@ -629,8 +607,6 @@
           zs = 1 + l * ( nzt_y - nzb_y + 1 )
           !$acc kernels present( f_out )
-          !$acc loop
           DO  j = nys_z, nyn_z
              DO  k = zs, zs + nzt_y - nzb_y
-                !$acc loop vector( 32 )
                 DO  i = nxl_z, nxr_z
                    f_out(i,j,k) = work(i,k-zs+1,j,l)
@@ -675,8 +651,6 @@
     !$OMP  DO
     !$acc kernels present( f_in, f_inv )
-    !$acc loop
      DO  k = 1,nz
          DO  i = nxl, nxr
-             !$acc loop vector( 32 )
              DO  j = nys, nyn
                  f_inv(j,i,k) = f_in(k,j,i)
@@ -723,8 +697,6 @@
 !$OMP  DO
        !$acc kernels present( f_inv, f_out )
-       !$acc loop
        DO  k = 1, nz
           DO  i = nxl, nxr
-             !$acc loop vector( 32 )
              DO  j = nys, nyn
                 f_out(i,j,k) = f_inv(j,i,k)
@@ -756,8 +728,6 @@
           xs = 0 + l * nnx
           !$acc kernels present( f_out )
-          !$acc loop
           DO  k = nzb_x, nzt_x
              DO  i = xs, xs + nnx - 1
-                !$acc loop vector( 32 )
                 DO  j = nys_x, nyn_x
                    f_out(i,j,k) = work(j,i-xs+1,k,l)
@@ -802,8 +772,6 @@
     !$OMP  DO
     !$acc kernels present( f_inv, f_out )
-    !$acc loop
      DO  k = nzb_y, nzt_y
          DO  j = 0, ny
-             !$acc loop vector( 32 )
              DO  i = nxl_y, nxr_y
                  f_out(j,i,k) = f_inv(i,k,j)
@@ -856,8 +824,6 @@
           zs = 1 + l * ( nzt_y - nzb_y + 1 )
           !$acc kernels present( f_in, work )
-          !$acc loop
           DO  j = nys_z, nyn_z
              DO  k = zs, zs + nzt_y - nzb_y
-                !$acc loop vector( 32 )
                 DO  i = nxl_z, nxr_z
                    work(i,k-zs+1,j,l) = f_in(i,j,k)
@@ -887,8 +853,6 @@
 !$OMP  DO
        !$acc kernels present( f_in, f_inv )
-       !$acc loop
        DO  k = nzb_y, nzt_y
           DO  j = 0, ny
-             !$acc loop vector( 32 )
              DO  i = nxl_y, nxr_y
                 f_inv(i,k,j) = f_in(i,j,k)
Index: palm/trunk/SOURCE/tridia_solver.f90
===================================================================
--- palm/trunk/SOURCE/tridia_solver.f90	(revision 1254)
+++ palm/trunk/SOURCE/tridia_solver.f90	(revision 1257)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! ------------------
-!
+! openacc loop and loop vector clauses removed, declare create moved after
+! the FORTRAN declaration statement
 !
 ! Former revisions:
@@ -114,6 +115,6 @@
           INTEGER ::  i, j, k, nnxh, nnyh
 
+          REAL    ::  ll(nxl_z:nxr_z,nys_z:nyn_z)
           !$acc declare create( ll )
-          REAL    ::  ll(nxl_z:nxr_z,nys_z:nyn_z)
 
 
@@ -130,5 +131,4 @@
 
           !$acc kernels present( tric )
-          !$acc loop vector( 32 )
           DO  j = nys_z, nyn_z
              DO  i = nxl_z, nxr_z
@@ -161,8 +161,6 @@
           ENDDO
 
-          !$acc loop
           DO  k = 0, nz-1
              DO  j = nys_z, nyn_z
-                !$acc loop vector( 32 )
                 DO  i = nxl_z, nxr_z
                    tric(i,j,k) = ddzuw(k,3) - ll(i,j)
@@ -174,5 +172,4 @@
           IF ( ibc_p_b == 1 )  THEN
              !$acc kernels present( tric )
-             !$acc loop
              DO  j = nys_z, nyn_z
                 DO  i = nxl_z, nxr_z
@@ -184,5 +181,4 @@
           IF ( ibc_p_t == 1 )  THEN
              !$acc kernels present( tric )
-             !$acc loop
              DO  j = nys_z, nyn_z
                 DO  i = nxl_z, nxr_z
@@ -211,6 +207,6 @@
           REAL    ::  ar(nxl_z:nxr_z,nys_z:nyn_z,1:nz)
 
+          REAL, DIMENSION(nxl_z:nxr_z,nys_z:nyn_z,0:nz-1)   ::  ar1
           !$acc declare create( ar1 )
-          REAL, DIMENSION(nxl_z:nxr_z,nys_z:nyn_z,0:nz-1)   ::  ar1
 
 !
@@ -218,5 +214,4 @@
           DO  k = 0, nz - 1
              !$acc kernels present( ar, tri )
-             !$acc loop
              DO  j = nys_z, nyn_z
                 DO  i = nxl_z, nxr_z
@@ -240,5 +235,4 @@
           DO  k = nz-1, 0, -1
              !$acc kernels present( ar, tri )
-             !$acc loop
              DO  j = nys_z, nyn_z
                 DO  i = nxl_z, nxr_z
@@ -265,4 +259,5 @@
                    ar(nxl_z,nys_z,k) = 0.0
                 ENDDO
+                !$acc end kernels loop
              ENDIF
           ENDIF
Index: palm/trunk/SOURCE/wall_fluxes.f90
===================================================================
--- palm/trunk/SOURCE/wall_fluxes.f90	(revision 1254)
+++ palm/trunk/SOURCE/wall_fluxes.f90	(revision 1257)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-!
+! openacc loop and loop vector clauses removed
 !
 ! Former revisions:
@@ -270,5 +270,5 @@
 !--             All subsequent variables are computed for the respective
 !--             location where the respective flux is defined.
-                !$acc loop independent vector( 32 )
+                !$acc loop independent
                 DO  k = nzb_uvw_inner(j,i)+1, nzb_uvw_outer(j,i)
 
@@ -676,8 +676,6 @@
        !$acc kernels present( nzb_diff_s_inner, nzb_diff_s_outer, pt, rif_wall ) &
        !$acc         present( u, v, w, wall, wall_flux, z0 )
-       !$acc loop
        DO  i = i_left, i_right
           DO  j = j_south, j_north
-             !$acc loop vector(32)
              DO  k = min_inner, max_outer
 !
