Index: palm/trunk/SOURCE/fft_xy.f90
===================================================================
--- palm/trunk/SOURCE/fft_xy.f90	(revision 1748)
+++ palm/trunk/SOURCE/fft_xy.f90	(revision 1749)
@@ -19,5 +19,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! small OpenACC bugfix
 ! 
 ! Former revisions:
@@ -1072,5 +1072,5 @@
           ar_tmp  !<
        ! following does not work for PGI 14.1 -> to be removed later
-       !$acc declare create( ar_tmp )
+       ! !$acc declare create( ar_tmp )
 #endif
 
Index: palm/trunk/SOURCE/surface_layer_fluxes.f90
===================================================================
--- palm/trunk/SOURCE/surface_layer_fluxes.f90	(revision 1748)
+++ palm/trunk/SOURCE/surface_layer_fluxes.f90	(revision 1749)
@@ -19,5 +19,5 @@
 ! Current revisions:
 ! ------------------
-! 
+! further OpenACC adjustments
 !
 ! Former revisions:
@@ -512,5 +512,6 @@
 
           !$OMP PARALLEL DO PRIVATE( k, z_mo )
-          !# WARNING: does not work on GPU so far
+          !# WARNING: does not work on GPU so far because of DO-loop with
+          !#          undetermined iterations
           !!!!!!$acc kernels loop
           DO  i = nxl, nxr
@@ -632,5 +633,5 @@
 
           !$OMP PARALLEL DO PRIVATE( k, z_mo )
-          !# WARNING: does not work on GPU so far
+          !# WARNING: does not work on GPU so far because of DO WHILE construct
           !!!!!!$acc kernels loop
           DO  i = nxl, nxr
@@ -726,7 +727,5 @@
 
        !$OMP PARALLEL DO PRIVATE( k, z_mo )
-       ! ### WARNING: does not work on GPU because of function calls
-       !!!!!$acc kernels loop
-       !$acc update host( ol, uv_total )
+       !$acc kernels loop present( nzb_s_inner, ol, us, uv_total, zu, zw, z0 ) private( j, k, z_mo )
        DO  i = nxlg, nxrg
           DO  j = nysg, nyng
@@ -742,5 +741,4 @@
           ENDDO
        ENDDO
-       !$acc update device( us )
 
     END SUBROUTINE calc_us
@@ -808,6 +806,5 @@
 
           !$OMP PARALLEL DO PRIVATE( k, z_mo )
-          ! ### WARNING: leads to severe compile error
-          !!!!$acc kernels loop
+          !$acc kernels loop present( nzb_s_inner, ol, pt, pt1, ts, zu, zw, z0h ) private( j, k, z_mo )
           DO  i = nxlg, nxrg
              DO  j = nysg, nyng
@@ -862,8 +859,7 @@
 
              !$OMP PARALLEL DO PRIVATE( e_s, k, z_mo )
-             ! ### WARNING: leads to severe compile error
-             !!!!$acc kernels loop independent
+             !$acc kernels loop independent present( nzb_s_inner, ol, pt, q, qs, qv1, zu, zw, z0h ) private( e_s, j, k, z_mo )
              DO  i = nxlg, nxrg
-                !!!!$acc loop independent
+                !$acc loop independent
                 DO  j = nysg, nyng
 
@@ -905,8 +901,7 @@
 
           !$OMP PARALLEL DO PRIVATE( k, z_mo )
-          ! ### WARNING: leads to severe compile error
-          !!!!!$acc kernels loop independent
+          !$acc kernels loop independent present( nr, nrs, nzb_s_inner, ol, qr, qrs, zu, zw, z0h ) private( j, k, z_mo )
           DO  i = nxlg, nxrg
-             !!!!$acc loop independent
+             !$acc loop independent
              DO  j = nysg, nyng
 
@@ -914,13 +909,13 @@
                 z_mo = zu(k+1) - zw(k)
 
-                   qrs(j,i) = kappa * ( qr(k+1,j,i) - qr(k,j,i) )              &
-                                     / ( LOG( z_mo / z0h(j,i) )                &
-                                         - psi_h( z_mo / ol(j,i) )             &
-                                         + psi_h( z0h(j,i) / ol(j,i) ) )
-
-                   nrs(j,i) = kappa * ( nr(k+1,j,i) - nr(k,j,i) )              &
-                                     / ( LOG( z_mo / z0h(j,i) )                &
-                                         - psi_h( z_mo / ol(j,i) )             &
-                                         + psi_h( z0h(j,i) / ol(j,i) ) )
+                qrs(j,i) = kappa * ( qr(k+1,j,i) - qr(k,j,i) )              &
+                                 / ( LOG( z_mo / z0h(j,i) )                 &
+                                     - psi_h( z_mo / ol(j,i) )              &
+                                     + psi_h( z0h(j,i) / ol(j,i) ) )
+
+                nrs(j,i) = kappa * ( nr(k+1,j,i) - nr(k,j,i) )              &
+                                 / ( LOG( z_mo / z0h(j,i) )                 &
+                                     - psi_h( z_mo / ol(j,i) )              &
+                                     + psi_h( z0h(j,i) / ol(j,i) ) )
              ENDDO
           ENDDO
@@ -945,7 +940,5 @@
 !--    First compute the corresponding component of u* and square it.
        !$OMP PARALLEL DO PRIVATE( k, ol_mid, z_mo )
-       ! ### WARNING: leads to severe compile error
-       !!!!!$acc kernels loop
-       !$acc update host( ol, u, us, v )
+       !$acc kernels loop present( nzb_u_inner, ol, u, us, usws, zu, zw, z0 ) private( j, k, z_mo )
        DO  i = nxl, nxr
           DO  j = nys, nyn
@@ -974,6 +967,5 @@
 !--    First compute the corresponding component of u* and square it.
        !$OMP PARALLEL DO PRIVATE( k, ol_mid, z_mo )
-       ! ### WARNING: leads to severe compile error
-       !!!!!!$acc kernels loop
+       !$acc kernels loop present( nzb_v_inner, ol, v, us, vsws, zu, zw, z0 ) private( j, k, ol_mid, z_mo )
        DO  i = nxl, nxr
           DO  j = nys, nyn
@@ -1001,5 +993,5 @@
 !
 !--    Exchange the boundaries for the momentum fluxes (is this still required?)
-       !!!!!!!!$acc update host( usws, vsws )
+       !$acc update host( usws, vsws )
        CALL exchange_horiz_2d( usws )
        CALL exchange_horiz_2d( vsws )
