Index: palm/trunk/SOURCE/Makefile
===================================================================
--- palm/trunk/SOURCE/Makefile	(revision 1373)
+++ palm/trunk/SOURCE/Makefile	(revision 1374)
@@ -20,5 +20,5 @@
 # Current revisions:
 # ------------------
-# 
+# bugfix: missing dependency added for check_open
 # 
 # Former revisions:
@@ -267,5 +267,5 @@
 calc_spectra.o: modules.o cpulog.o fft_xy.o mod_kinds.o
 check_for_restart.o: modules.o mod_kinds.o
-check_open.o: modules.o mod_kinds.o
+check_open.o: modules.o mod_kinds.o mod_particle_attributes.o
 check_parameters.o: modules.o mod_kinds.o subsidence.o
 close_file.o: modules.o mod_kinds.o
Index: palm/trunk/SOURCE/advec_s_bc.f90
===================================================================
--- palm/trunk/SOURCE/advec_s_bc.f90	(revision 1373)
+++ palm/trunk/SOURCE/advec_s_bc.f90	(revision 1374)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! missing variables added to ONLY list
 ! 
 ! Former revisions:
@@ -91,5 +91,5 @@
 
     USE indices,                                                               &
-        ONLY:  nx, nxl, nxr, nyn, nys, nzb, nzt
+        ONLY:  nx, nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzt
 
     USE kinds
Index: palm/trunk/SOURCE/advec_s_pw.f90
===================================================================
--- palm/trunk/SOURCE/advec_s_pw.f90	(revision 1373)
+++ palm/trunk/SOURCE/advec_s_pw.f90	(revision 1374)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! missing variables added to ONLY list
 ! 
 ! Former revisions:
@@ -83,5 +83,6 @@
 
        USE indices,                                                            &
-           ONLY:  nxl, nxr, nyn, nys, nzb_s_inner, nzt
+           ONLY:  nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzb_s_inner,&
+                  nzt
 
        USE kinds
@@ -136,5 +137,5 @@
 
        USE indices,                                                            &
-           ONLY:  nzb_s_inner, nzt
+           ONLY:  nxlg, nxrg, nyng, nysg, nzb, nzb_s_inner, nzt
 
        USE kinds
Index: palm/trunk/SOURCE/advec_s_up.f90
===================================================================
--- palm/trunk/SOURCE/advec_s_up.f90	(revision 1373)
+++ palm/trunk/SOURCE/advec_s_up.f90	(revision 1374)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! missing variables added to ONLY list
 ! 
 ! Former revisions:
@@ -83,5 +83,6 @@
 
        USE indices,                                                            &
-           ONLY:  nxl, nxr, nyn, nys, nzb_s_inner, nzt
+           ONLY:  nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzb_s_inner,&
+                  nzt
 
        USE kinds
@@ -160,5 +161,5 @@
 
        USE indices,                                                            &
-           ONLY:  nzb_s_inner, nzt
+           ONLY:  nxlg, nxrg, nyng, nysg, nzb, nzb_s_inner, nzt
 
        USE kinds
Index: palm/trunk/SOURCE/advec_ws.f90
===================================================================
--- palm/trunk/SOURCE/advec_ws.f90	(revision 1373)
+++ palm/trunk/SOURCE/advec_ws.f90	(revision 1374)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! ------------------
-! 
+! missing variables added to ONLY list
 ! 
 ! Former revisions:
@@ -389,5 +389,6 @@
 
        USE indices,                                                            &
-           ONLY:  nxl, nxr, nyn, nys, nzb, nzb_max, nzt, wall_flags_0
+           ONLY:  nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzb_max,    &
+                  nzt, wall_flags_0
 
        USE kinds
@@ -2230,5 +2231,6 @@
 
        USE indices,                                                           &
-           ONLY:  nxl, nxr, nyn, nys, nzb, nzb_max, nzt, wall_flags_0
+           ONLY:  nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzb_max,   &
+                  nzt, wall_flags_0
            
        USE kinds
@@ -2749,5 +2751,5 @@
 !
 !--    Computation of fluxes and tendency terms
-       !$acc kernels present( ddzw, sk, tend, u, v, w, wall_flags_0, wall_flags_00 )
+       !$acc kernels present( ddzw, sk, tend, u, v, w, wall_flags_0 )
        DO  i = i_left, i_right
           DO  j = j_south, j_north
@@ -3545,5 +3547,5 @@
 !
 !--    Computation of fluxes and tendency terms
-       !$acc  kernels present( ddzw, tend, u, v, w, wall_flags_0, wall_flags_00 )
+       !$acc  kernels present( ddzw, tend, u, v, w, wall_flags_0 )
        DO i = i_left, i_right
           DO  j = j_south, j_north
@@ -4349,5 +4351,5 @@
 !
 !--    Computation of fluxes and tendency terms
-       !$acc kernels present( ddzw, tend, u, v, w, wall_flags_0, wall_flags_00 )
+       !$acc kernels present( ddzw, tend, u, v, w, wall_flags_0 )
        DO  i = i_left, i_right
           DO  j = j_south, j_north
Index: palm/trunk/SOURCE/buoyancy.f90
===================================================================
--- palm/trunk/SOURCE/buoyancy.f90	(revision 1373)
+++ palm/trunk/SOURCE/buoyancy.f90	(revision 1374)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! ------------------
-! 
+! missing variables added to ONLY list
 ! 
 ! Former revisions:
@@ -110,5 +110,6 @@
 
        USE indices,                                                            &
-           ONLY:  nxl, nxlu, nxr, nyn, nys, nzb_s_inner, nzt
+           ONLY:  nxl, nxlg, nxlu, nxr, nxrg, nyn, nyng, nys, nysg, nzb,       &
+                  nzb_s_inner, nzt
 
        USE kinds
@@ -205,6 +206,6 @@
 
        USE indices,                                                            &
-           ONLY:  i_left, i_right, j_north, j_south, nxl, nxlu, nxr, nyn, nys, &
-                  nzb_s_inner, nzt
+           ONLY:  i_left, i_right, j_north, j_south, nxl, nxlg, nxlu, nxr,     &
+                  nxrg, nyn, nyng, nys, nysg, nzb, nzb_s_inner, nzt
 
        USE kinds
@@ -308,5 +309,5 @@
 
        USE indices,                                                            &
-           ONLY:  nzb_s_inner, nzt
+           ONLY:  nxlg, nxrg, nyng, nysg, nzb, nzb_s_inner, nzt
 
        USE kinds
Index: palm/trunk/SOURCE/cuda_fft_interfaces.f90
===================================================================
--- palm/trunk/SOURCE/cuda_fft_interfaces.f90	(revision 1373)
+++ palm/trunk/SOURCE/cuda_fft_interfaces.f90	(revision 1374)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! bugfix: missing module kinds added
 !
 ! Former revisions:
@@ -57,4 +57,6 @@
 
 #if defined ( __cuda_fft )
+
+    USE kinds
 
     INTEGER(iwp) ::  CUFFT_FORWARD = -1   !:
Index: palm/trunk/SOURCE/diffusion_e.f90
===================================================================
--- palm/trunk/SOURCE/diffusion_e.f90	(revision 1373)
+++ palm/trunk/SOURCE/diffusion_e.f90	(revision 1374)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! -----------------
-! 
+! missing variables added to ONLY list
+! rif removed from acc-present-list
 ! 
 ! Former revisions:
@@ -113,5 +114,6 @@
            
        USE indices,                                                            &
-           ONLY:  nxl, nxr, nyn, nys, nzb, nzb_s_inner, nzt
+           ONLY:  nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzb_s_inner,&
+                  nzt
            
        USE kinds
@@ -317,5 +319,6 @@
            
        USE indices,                                                            &
-           ONLY:  i_left, i_right, j_north, j_south, nzb_s_inner, nzt
+           ONLY:  i_left, i_right, j_north, j_south, nxlg, nxrg, nyng, nysg,   &
+                  nzb, nzb_s_inner, nzt
            
        USE kinds
@@ -349,5 +352,5 @@
 
           !$acc kernels present( ddzu, ddzw, dd2zu, diss, e, km, l_grid ) &
-          !$acc         present( nzb_s_inner, rif, tend, var, zu, zw )
+          !$acc         present( nzb_s_inner, tend, var, zu, zw )
           DO  i = i_left, i_right
              DO  j = j_south, j_north
@@ -416,5 +419,5 @@
 
           !$acc kernels present( ddzu, ddzw, dd2zu, diss, e, km, l_grid ) &
-          !$acc         present( nzb_s_inner, rif, tend, var, zu, zw )
+          !$acc         present( nzb_s_inner, tend, var, zu, zw )
           DO  i = i_left, i_right
              DO  j = j_south, j_north
@@ -513,5 +516,5 @@
            
        USE indices,                                                            &
-           ONLY:  nzb, nzb_s_inner, nzt
+           ONLY:  nxlg, nxrg, nyng, nysg, nzb, nzb_s_inner, nzt
            
        USE kinds
Index: palm/trunk/SOURCE/diffusion_s.f90
===================================================================
--- palm/trunk/SOURCE/diffusion_s.f90	(revision 1373)
+++ palm/trunk/SOURCE/diffusion_s.f90	(revision 1374)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! ------------------
-! 
+! missing variables added to ONLY list
 ! 
 ! Former revisions:
@@ -98,5 +98,5 @@
        
        USE indices,                                                            &
-           ONLY:  nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg,                  &
+           ONLY:  nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb,             &
                   nzb_diff_s_inner, nzb_s_inner, nzb_s_outer, nzt, nzt_diff
        
@@ -224,5 +224,5 @@
        USE indices, &
            ONLY: i_left, i_right, j_north, j_south, nxlg, nxrg, nyng, nysg,    &
-                 nzb_diff_s_inner, nzb_s_inner, nzb_s_outer, nzt, nzt_diff
+                 nzb, nzb_diff_s_inner, nzb_s_inner, nzb_s_outer, nzt, nzt_diff
            
        USE kinds
@@ -351,5 +351,5 @@
        
        USE indices,                                                            &
-           ONLY:  nxlg, nxrg, nyng, nysg, nzb_diff_s_inner, nzb_s_inner,       &
+           ONLY:  nxlg, nxrg, nyng, nysg, nzb, nzb_diff_s_inner, nzb_s_inner,  &
                   nzb_s_outer, nzt, nzt_diff
        
Index: palm/trunk/SOURCE/diffusion_w.f90
===================================================================
--- palm/trunk/SOURCE/diffusion_w.f90	(revision 1373)
+++ palm/trunk/SOURCE/diffusion_w.f90	(revision 1374)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! vsws + vswst removed from acc-present-list
 ! 
 ! Former revisions:
@@ -262,5 +262,5 @@
        ENDIF
 
-       !$acc kernels present ( u, v, w, km, tend, vsws, vswst )    &
+       !$acc kernels present ( u, v, w, km, tend )                             &
        !$acc         present ( ddzu, ddzw, fwxm, fwxp, fwym, fwyp, wall_w_x, wall_w_y )           &
        !$acc         present ( nzb_w_inner, nzb_w_outer )
Index: palm/trunk/SOURCE/diffusivities.f90
===================================================================
--- palm/trunk/SOURCE/diffusivities.f90	(revision 1373)
+++ palm/trunk/SOURCE/diffusivities.f90	(revision 1374)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! rif removed from acc-present-list
 ! 
 ! Former revisions:
@@ -114,5 +114,5 @@
 !
 !-- Data declerations for accelerators
-    !$acc data present( dd2zu, e, km, kh, l_grid, l_wall, nzb_s_inner, rif, var )
+    !$acc data present( dd2zu, e, km, kh, l_grid, l_wall, nzb_s_inner, var )
     !$acc kernels
 
Index: palm/trunk/SOURCE/fft_xy.f90
===================================================================
--- palm/trunk/SOURCE/fft_xy.f90	(revision 1373)
+++ palm/trunk/SOURCE/fft_xy.f90	(revision 1374)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! bugfixes: missing variables added to ONLY list, dpk renamed dp
 !
 ! Former revisions:
@@ -117,5 +117,5 @@
     
     USE transpose_indices,                                                     &
-        ONLY:  nyn_x, nys_x, nzb_x, nzb_y, nzt_x, nzt_y
+        ONLY:  nxl_y, nxr_y, nyn_x, nys_x, nzb_x, nzb_y, nzt_x, nzt_y
 
     IMPLICIT NONE
@@ -390,5 +390,5 @@
        REAL(wp), DIMENSION(6*(nx+1)) ::  work2  !:
 #elif defined( __cuda_fft )
-       COMPLEX(dpk), DIMENSION(0:(nx+1)/2,nys_x:nyn_x,nzb_x:nzt_x) ::          &
+       COMPLEX(dp), DIMENSION(0:(nx+1)/2,nys_x:nyn_x,nzb_x:nzt_x) ::           &
           ar_tmp  !:
        !$acc declare create( ar_tmp )
@@ -1033,5 +1033,5 @@
        REAL(wp), DIMENSION(6*(ny+1)) ::  work2  !:
 #elif defined( __cuda_fft )
-       COMPLEX(dpk), DIMENSION(0:(ny+1)/2,nxl_y:nxr_y,nzb_y:nzt_y) ::          &
+       COMPLEX(dp), DIMENSION(0:(ny+1)/2,nxl_y:nxr_y,nzb_y:nzt_y) ::           &
           ar_tmp  !:
        !$acc declare create( ar_tmp )
Index: palm/trunk/SOURCE/flow_statistics.f90
===================================================================
--- palm/trunk/SOURCE/flow_statistics.f90	(revision 1373)
+++ palm/trunk/SOURCE/flow_statistics.f90	(revision 1374)
@@ -21,5 +21,6 @@
 ! Current revisions:
 ! -----------------
-! 
+! bugfix: syntax errors removed from openacc-branch
+! missing variables added to ONLY-lists
 ! 
 ! Former revisions:
@@ -1407,5 +1408,6 @@
     USE indices,                                                               &
         ONLY:  ngp_2dh, ngp_2dh_s_inner, ngp_3d, ngp_3d_inner, ngp_sums, nxl,  &
-               nxr, nyn, nys, nzb, nzb_diff_s_inner, nzb_s_inner, nzt, nzt_diff
+               nxr, nyn, nys, nzb, nzb_diff_s_inner, nzb_s_inner, nzt,         &
+               nzt_diff, rflags_invers
         
     USE kinds
@@ -1442,5 +1444,5 @@
     REAL(wp) ::  ust              !:
     REAL(wp) ::  ust2             !:
-    REAL(wp) ::  u2,              !:
+    REAL(wp) ::  u2               !:
     REAL(wp) ::  vst              !:
     REAL(wp) ::  vst2             !:
@@ -2034,5 +2036,5 @@
                    s1 = s1 - 0.5_wp * ( kh(k,j,i) + kh(k+1,j,i) )              &
                                     * ( vpt(k+1,j,i) - vpt(k,j,i) )            &
-                                    * ddzu(k+1) * rmask(j,i,sr) 
+                                    * ddzu(k+1) * rmask(j,i,sr)                &
                                     * rflags_invers(j,i,k+1)
                    s2 = s2 - 0.5_wp * ( kh(k,j,i) + kh(k+1,j,i) )              &
Index: palm/trunk/SOURCE/palm.f90
===================================================================
--- palm/trunk/SOURCE/palm.f90	(revision 1373)
+++ palm/trunk/SOURCE/palm.f90	(revision 1374)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-!
+! bugfix: module arrays_3d added
 !
 ! Former revisions:
@@ -83,13 +83,24 @@
 !------------------------------------------------------------------------------!
 
+    USE arrays_3d
 
     USE control_parameters,                                                    &
         ONLY:  coupling_char, coupling_mode, do2d_at_begin, do3d_at_begin,     &
                io_blocks, io_group, large_scale_forcing, nudging,              &
-               simulated_time, simulated_time_chr, version, write_binary
+               simulated_time, simulated_time_chr, version, wall_heatflux, write_binary
 
     USE cpulog,                                                                &
         ONLY:  cpu_log, log_point, cpu_statistics
 
+    USE grid_variables,                                                        &
+        ONLY:  fxm, fxp, fym, fyp, fwxm, fwxp, fwym, fwyp, wall_e_x, wall_e_y, &
+               wall_u, wall_v, wall_w_x, wall_w_y
+
+    USE indices,                                                               &
+        ONLY:  ngp_2dh, ngp_2dh_s_inner, nzb_diff_s_inner, nzb_diff_s_outer, nzb_diff_u, nzb_diff_v,     &
+               nzb_s_inner, nzb_s_outer, nzb_u_inner, nzb_u_outer, nzb_v_inner,&
+               nzb_v_outer, nzb_w_inner, nzb_w_outer, rflags_invers,           &
+               rflags_s_inner, wall_flags_0, wall_flags_00
+
     USE kinds
 
@@ -104,4 +115,7 @@
 
     USE pegrid
+
+    USE statistics,                                                            &
+        ONLY:  hom, rmask, weight_pres, weight_substep
 
 #if defined( __openacc )
Index: palm/trunk/SOURCE/production_e.f90
===================================================================
--- palm/trunk/SOURCE/production_e.f90	(revision 1373)
+++ palm/trunk/SOURCE/production_e.f90	(revision 1374)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! nzb_s_outer removed from acc-present-list
 ! 
 ! Former revisions:
@@ -780,5 +780,5 @@
 !--    Calculate TKE production by shear
        !$acc kernels present( ddzw, dd2zu, kh, km, nzb_diff_s_inner, nzb_diff_s_outer ) &
-       !$acc         present( nzb_s_inner, nzb_s_outer, pt, q, ql, qsws, qswst, rho )   &
+       !$acc         present( nzb_s_inner, pt, q, ql, qsws, qswst, rho )                &
        !$acc         present( shf, tend, tswst, u, v, vpt, w, wall_e_x, wall_e_y )      &
        !$acc         copyin( u_0, v_0 )
Index: palm/trunk/SOURCE/prognostic_equations.f90
===================================================================
--- palm/trunk/SOURCE/prognostic_equations.f90	(revision 1373)
+++ palm/trunk/SOURCE/prognostic_equations.f90	(revision 1374)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! ------------------
-! 
+! missing variables added to ONLY lists
 ! 
 ! Former revisions:
@@ -139,8 +139,8 @@
                flux_l_pt, flux_l_q, flux_l_qr, flux_l_sa, nr, nr_p, nrsws,     &
                nrswst, pt, ptdf_x, ptdf_y, pt_init, pt_p, prho, q, q_init,     &
-               q_p, qsws, qswst, qr, qr_p, qrsws, qrswst, rdf, rdf_sc, rho,    &
-               sa, sa_init, sa_p, saswsb, saswst, shf, tend, te_m, tnr_m,      &
-               tpt_m, tq_m, tqr_m, tsa_m, tswst, tu_m, tv_m, tw_m, u, ug, u_p, &
-               v, vg, vpt, v_p, w, w_p
+               q_p, qsws, qswst, qr, qr_p, qrsws, qrswst, rdf, rdf_sc,         &
+               ref_state, rho, sa, sa_init, sa_p, saswsb, saswst, shf, tend,   &
+               te_m, tnr_m, tpt_m, tq_m, tqr_m, tsa_m, tswst, tu_m, tv_m,      &
+               tw_m, u, ug, u_p, v, vg, vpt, v_p, w, w_p
         
     USE control_parameters,                                                    &
@@ -245,4 +245,7 @@
         ONLY:  production_e, production_e_acc
 
+    USE statistics,                                                            &
+        ONLY:  hom
+
     USE subsidence_mod,                                                        &
         ONLY:  subsidence
@@ -1757,5 +1760,5 @@
 !
 !-- u-velocity component
-!++ Statistics still not ported to accelerators
+!++ Statistics still not completely ported to accelerators
     !$acc update device( hom, ref_state )
     CALL cpu_log( log_point(5), 'u-equation', 'start' )
Index: palm/trunk/SOURCE/swap_timelevel.f90
===================================================================
--- palm/trunk/SOURCE/swap_timelevel.f90	(revision 1373)
+++ palm/trunk/SOURCE/swap_timelevel.f90	(revision 1374)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! bugfix: use-statement for nopointer-case added
 ! 
 ! Former revisions:
@@ -62,8 +62,14 @@
 !------------------------------------------------------------------------------!
 
+#if defined( __nopointer )
+    USE arrays_3d,                                                             &
+        ONLY:  e, e_p, nr, nr_p, pt, pt_p, q, q_p, qr, qr_p, sa, sa_p, u, u_p, &
+               v, v_p, w, w_p
+#else
     USE arrays_3d,                                                             &
         ONLY:  e, e_1, e_2, e_p, nr, nr_1, nr_2, nr_p, pt, pt_1, pt_2, pt_p, q,&
                q_1, q_2, q_p, qr, qr_1, qr_2, qr_p, sa, sa_1, sa_2, sa_p, u,   &
                u_1, u_2, u_p, v, v_1, v_2, v_p, w, w_1, w_2, w_p
+#endif
 
     USE cpulog,                                                                &
Index: palm/trunk/SOURCE/wall_fluxes.f90
===================================================================
--- palm/trunk/SOURCE/wall_fluxes.f90	(revision 1373)
+++ palm/trunk/SOURCE/wall_fluxes.f90	(revision 1374)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! pt removed from acc-present-list
 ! 
 ! Former revisions:
@@ -849,5 +849,5 @@
        max_outer = MAXVAL( nzb_diff_s_outer(nys:nyn,nxl:nxr) ) - 2
 
-       !$acc kernels present( nzb_diff_s_inner, nzb_diff_s_outer, pt, rif_wall ) &
+       !$acc kernels present( nzb_diff_s_inner, nzb_diff_s_outer, rif_wall )   &
        !$acc         present( u, v, w, wall, wall_flux, z0 )
        DO  i = i_left, i_right
