Index: palm/trunk/SOURCE/buoyancy.f90
===================================================================
--- palm/trunk/SOURCE/buoyancy.f90	(revision 1140)
+++ palm/trunk/SOURCE/buoyancy.f90	(revision 1153)
@@ -20,5 +20,5 @@
 ! Currrent revisions:
 ! -----------------
-!
+! code adjustment of accelerator version for PGI 12.3 / CUDA 5.0
 !
 ! Former revisions:
@@ -238,13 +238,11 @@
              DO  i = i_left, i_right
                 DO  j = j_south, j_north
-                   !$acc loop vector(32)
-                   DO  k = 1, nzt-1
-                      IF ( k > nzb_s_inner(j,i) )  THEN
-                         tend(k,j,i) = tend(k,j,i) + atmos_ocean_sign * g * 0.5 * &
-                                                               (                  &
-                             ( var(k,j,i)   - hom(k,1,pr,0)   ) / hom(k,1,pr,0) + &
-                             ( var(k+1,j,i) - hom(k+1,1,pr,0) ) / hom(k+1,1,pr,0) &
-                                                               )
-                      ENDIF
+                   !$acc loop independent vector(32)
+                   DO  k = nzb_s_inner(j,i)+1, nzt-1
+                      tend(k,j,i) = tend(k,j,i) + atmos_ocean_sign * g * 0.5 * &
+                                                            (                  &
+                          ( var(k,j,i)   - hom(k,1,pr,0)   ) / hom(k,1,pr,0) + &
+                          ( var(k+1,j,i) - hom(k+1,1,pr,0) ) / hom(k+1,1,pr,0) &
+                                                            )
                    ENDDO
                 ENDDO
Index: palm/trunk/SOURCE/cuda_fft_interfaces.f90
===================================================================
--- palm/trunk/SOURCE/cuda_fft_interfaces.f90	(revision 1140)
+++ palm/trunk/SOURCE/cuda_fft_interfaces.f90	(revision 1153)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! code adjustment of data types for CUDA fft required by PGI 12.3 / CUDA 5.0
 !
 ! Former revisions:
@@ -87,9 +87,8 @@
 
           USE ISO_C_BINDING
-          USE precision_kind
 
-          INTEGER(C_INT), value ::  plan
-          COMPLEX(dpk), device  ::  idata(:,:,:)
-          REAL(dpk), device     ::  odata(:,:,:)
+          INTEGER(C_INT)            ::  plan
+          COMPLEX(C_DOUBLE_COMPLEX) ::  idata(:,:,:)
+          REAL(C_DOUBLE)            ::  odata(:,:,:)
 
        END SUBROUTINE CUFFTEXECZ2D
@@ -103,9 +102,8 @@
 
           USE ISO_C_BINDING
-          USE precision_kind
 
-          INTEGER(C_INT), value ::  plan
-          REAL(dpk), device     ::  idata(:,:,:)
-          COMPLEX(dpk), device  ::  odata(:,:,:)
+          INTEGER(C_INT)            ::  plan
+          REAL(C_DOUBLE)            ::  idata(:,:,:)
+          COMPLEX(C_DOUBLE_COMPLEX) ::  odata(:,:,:)
 
        END SUBROUTINE CUFFTEXECD2Z
Index: palm/trunk/SOURCE/fft_xy.f90
===================================================================
--- palm/trunk/SOURCE/fft_xy.f90	(revision 1140)
+++ palm/trunk/SOURCE/fft_xy.f90	(revision 1153)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! code adjustment of data types for CUDA fft required by PGI 12.3 / CUDA 5.0
 !
 ! Former revisions:
@@ -74,4 +74,7 @@
     USE control_parameters
     USE indices
+#if defined( __cuda_fft )
+    USE ISO_C_BINDING
+#endif
     USE precision_kind
     USE singleton
@@ -102,6 +105,6 @@
                                               trig_yf
 #elif defined( __cuda_fft )
-    INTEGER, SAVE ::  plan_xf, plan_xi, plan_yf, plan_yi, total_points_x_transpo, &
-                      total_points_y_transpo
+    INTEGER(C_INT), SAVE ::  plan_xf, plan_xi, plan_yf, plan_yi
+    INTEGER, SAVE        ::  total_points_x_transpo, total_points_y_transpo
 #endif
 
@@ -262,4 +265,7 @@
 
        USE cuda_fft_interfaces
+#if defined( __cuda_fft )
+       USE ISO_C_BINDING
+#endif
 
        IMPLICIT NONE
@@ -279,5 +285,5 @@
 #elif defined( __cuda_fft )
        !$acc declare create( ar_tmp )
-       COMPLEX(dpk), DIMENSION(0:(nx+1)/2,nys_x:nyn_x,nzb_x:nzt_x) ::  ar_tmp
+       COMPLEX(C_DOUBLE_COMPLEX), DIMENSION(0:(nx+1)/2,nys_x:nyn_x,nzb_x:nzt_x) ::  ar_tmp
 #endif
        REAL, DIMENSION(0:nx,nys_x:nyn_x,nzb_x:nzt_x) ::  ar
@@ -770,4 +776,7 @@
 
        USE cuda_fft_interfaces
+#if defined( __cuda_fft )
+       USE ISO_C_BINDING
+#endif
 
        IMPLICIT NONE
@@ -787,5 +796,5 @@
 #elif defined( __cuda_fft )
        !$acc declare create( ar_tmp )
-       COMPLEX(dpk), DIMENSION(0:(ny+1)/2,nxl_y:nxr_y,nzb_y:nzt_y) ::  ar_tmp
+       COMPLEX(C_DOUBLE_COMPLEX), DIMENSION(0:(ny+1)/2,nxl_y:nxr_y,nzb_y:nzt_y) ::  ar_tmp
 #endif
        REAL, DIMENSION(0:ny,nxl_y:nxr_y,nzb_y:nzt_y) ::  ar
Index: palm/trunk/SOURCE/init_3d_model.f90
===================================================================
--- palm/trunk/SOURCE/init_3d_model.f90	(revision 1140)
+++ palm/trunk/SOURCE/init_3d_model.f90	(revision 1153)
@@ -23,5 +23,6 @@
 ! Current revisions:
 ! ------------------
-!
+! diss array is allocated with dummy elements even if it is not needed
+! (required by PGI 12.3 / CUDA 5.0)
 !
 ! Former revisions:
@@ -501,5 +502,7 @@
 !-- particle velocities
     IF ( use_sgs_for_particles  .OR.  wang_kernel  .OR.  turbulence )  THEN
-       ALLOCATE ( diss(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+       ALLOCATE( diss(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+    ELSE
+       ALLOCATE( diss(2,2,2) )
     ENDIF
 
Index: palm/trunk/SOURCE/wall_fluxes.f90
===================================================================
--- palm/trunk/SOURCE/wall_fluxes.f90	(revision 1140)
+++ palm/trunk/SOURCE/wall_fluxes.f90	(revision 1153)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-!
+! code adjustment of accelerator version for PGI 12.3 / CUDA 5.0
 !
 ! Former revisions:
@@ -259,14 +259,15 @@
        !$acc kernels present( hom, nzb_uvw_inner, nzb_uvw_outer, pt, rif_wall ) &
        !$acc         present( u, v, w, wall, wall_flux, z0 )
-       !$acc loop
+       !$acc loop independent
        DO  i = i_left, i_right
           DO  j = j_south, j_north
-             !$acc loop vector( 32 )
-             DO  k = min_inner, max_outer
+
+             IF ( wall(j,i) /= 0.0 )  THEN
 !
 !--             All subsequent variables are computed for the respective
 !--             location where the respective flux is defined.
-                IF ( k >= nzb_uvw_inner(j,i)+1  .AND. &
-                     k <= nzb_uvw_outer(j,i)    .AND.  wall(j,i) /= 0.0 )  THEN
+                !$acc loop independent vector( 32 )
+                DO  k = nzb_uvw_inner(j,i)+1, nzb_uvw_outer(j,i)
+
 !
 !--                (1) Compute rifs, u_i, v_i, ws, pt' and w'pt'
@@ -365,7 +366,10 @@
                    rif_wall(k,j,i,wall_index) = rifs
 
-                ENDIF
-
-             ENDDO
+!                ENDIF
+
+                ENDDO
+
+             ENDIF
+
           ENDDO
        ENDDO
