Index: palm/trunk/SOURCE/CURRENT_MODIFICATIONS
===================================================================
--- palm/trunk/SOURCE/CURRENT_MODIFICATIONS	(revision 83)
+++ palm/trunk/SOURCE/CURRENT_MODIFICATIONS	(revision 85)
@@ -5,6 +5,12 @@
 Changed:
 -------
+Division through dt_3d replaced by multiplication of the inverse. For performance optimisation, this is done in the loop calculating the divergence instead of using a seperate loop. (pres.f90)
+
+pres
 
 
 Errors:
 ------
+Bugfix: work_fft*_vec removed from some PRIVATE-declarations (poisfft.f90).
+
+poisfft
Index: palm/trunk/SOURCE/poisfft.f90
===================================================================
--- palm/trunk/SOURCE/poisfft.f90	(revision 83)
+++ palm/trunk/SOURCE/poisfft.f90	(revision 85)
@@ -4,5 +4,5 @@
 ! Actual revisions:
 ! -----------------
-! 
+! Bugfix: work_fft*_vec removed from some PRIVATE-declarations
 !
 ! Former revisions:
@@ -641,5 +641,5 @@
 !
 !--       Code optimized for vector processors
-!$OMP     PARALLEL PRIVATE ( i, j, k, work_ffty_vec )
+!$OMP     PARALLEL PRIVATE ( i, j, k )
 !$OMP     DO
           DO  i = nxl, nxr
@@ -763,5 +763,5 @@
 !
 !--       Code optimized for vector processors
-!$OMP     PARALLEL PRIVATE ( i, j, k, work_ffty_vec )
+!$OMP     PARALLEL PRIVATE ( i, j, k )
 !$OMP     DO
           DO  k = 1, nz
@@ -1003,5 +1003,5 @@
 !
 !--       Code for vector processors
-!$OMP     PARALLEL PRIVATE ( i, j, k, work_fftx )
+!$OMP     PARALLEL PRIVATE ( i, j, k )
 !$OMP     DO
           DO  i = 0, nx
@@ -1114,5 +1114,5 @@
 !
 !--       Code optimized for vector processors
-!$OMP     PARALLEL PRIVATE ( i, j, k, work_fftx )
+!$OMP     PARALLEL PRIVATE ( i, j, k )
 !$OMP     DO
           DO  j = nys, nyn
Index: palm/trunk/SOURCE/pres.f90
===================================================================
--- palm/trunk/SOURCE/pres.f90	(revision 83)
+++ palm/trunk/SOURCE/pres.f90	(revision 85)
@@ -4,5 +4,7 @@
 ! Actual revisions:
 ! -----------------
-! 
+! Division through dt_3d replaced by multiplication of the inverse.
+! For performance optimisation, this is done in the loop calculating the
+! divergence instead of using a seperate loop.
 !
 ! Former revisions:
@@ -48,5 +50,5 @@
     INTEGER ::  i, j, k, sr
 
-    REAL    ::  localsum, threadsum
+    REAL    ::  ddt_3d, localsum, threadsum
 
     REAL, DIMENSION(1:2) ::  volume_flow_l, volume_flow_offset
@@ -55,4 +57,7 @@
 
     CALL cpu_log( log_point(8), 'pres', 'start' )
+
+
+    ddt_3d = 1.0 / dt_3d
 
 !
@@ -167,7 +172,7 @@
        DO  j = nys, nyn
           DO  k = nzb_s_inner(j,i)+1, nzt
-             d(k,j,i) = ( u(k,j,i+1) - u(k,j,i) ) * ddx + &
-                        ( v(k,j+1,i) - v(k,j,i) ) * ddy + &
-                        ( w(k,j,i) - w(k-1,j,i) ) * ddzw(k)
+             d(k,j,i) = ( ( u(k,j,i+1) - u(k,j,i) ) * ddx + &
+                          ( v(k,j+1,i) - v(k,j,i) ) * ddy + &
+                          ( w(k,j,i) - w(k-1,j,i) ) * ddzw(k) ) * ddt_3d
           ENDDO
 !
@@ -184,5 +189,5 @@
                                        - g * ( pt(k+1,j,i) - sums(k+1,4) ) / &
                                          sums(k+1,4)                         &
-                                       ) * ddzw(k+1)
+                                       ) * ddzw(k+1) * ddt_3d
           ENDIF
 
@@ -193,15 +198,8 @@
           ENDDO
 
-!
-!--       Velocity corrections are made with Euler step size. Right hand side
-!--       of Poisson equation has to be set appropriately
-          DO  k = nzb_s_inner(j,i)+1, nzt
-             d(k,j,i) = d(k,j,i) / dt_3d
-          ENDDO
-
        ENDDO
     ENDDO
 
-    localsum = localsum + threadsum
+    localsum = ( localsum + threadsum ) * dt_3d
     !$OMP END PARALLEL
 #else
@@ -212,7 +210,7 @@
           DO  j = nys, nyn
              DO  k = nzb_s_inner(j,i)+1, nzt
-                d(k,j,i) = ( u(k,j,i+1) - u(k,j,i) ) * ddx + &
-                           ( v(k,j+1,i) - v(k,j,i) ) * ddy + &
-                           ( w(k,j,i) - w(k-1,j,i) ) * ddzw(k)
+                d(k,j,i) = ( ( u(k,j,i+1) - u(k,j,i) ) * ddx + &
+                             ( v(k,j+1,i) - v(k,j,i) ) * ddy + &
+                             ( w(k,j,i) - w(k-1,j,i) ) * ddzw(k) ) * ddt_3d
              ENDDO
           ENDDO
@@ -230,5 +228,5 @@
                            - g * ( pt(k+1,j,i) - sums(k+1,4) ) / &
                              sums(k+1,4)                         &
-                                        ) * ddzw(k+1)
+                                        ) * ddzw(k+1) * ddt_3d
           ENDDO
        ENDDO
@@ -242,7 +240,7 @@
           DO  j = nys, nyn
              DO  k = nzb_s_inner(j,i)+1, nzt
-                d(k,j,i) = ( u(k,j,i+1) - u(k,j,i) ) * ddx + &
-                           ( v(k,j+1,i) - v(k,j,i) ) * ddy + &
-                           ( w(k,j,i) - w(k-1,j,i) ) * ddzw(k)
+                d(k,j,i) = ( ( u(k,j,i+1) - u(k,j,i) ) * ddx + &
+                             ( v(k,j+1,i) - v(k,j,i) ) * ddy + &
+                             ( w(k,j,i) - w(k-1,j,i) ) * ddzw(k) ) * ddt_3d
              ENDDO
           ENDDO
@@ -263,18 +261,6 @@
        ENDDO
     ENDDO
-    localsum = localsum + threadsum
+    localsum = ( localsum + threadsum ) * dt_3d
     !$OMP END PARALLEL
-
-!
-!-- Velocity corrections are made with Euler step size. Right hand side
-!-- of Poisson equation has to be set appropriately
-    !$OMP DO SCHEDULE( STATIC )
-    DO  i = nxl, nxr
-       DO  j = nys, nyn
-          DO  k = nzb_s_inner(j,i)+1, nzt
-             d(k,j,i) = d(k,j,i) / dt_3d
-          ENDDO
-       ENDDO
-    ENDDO
 #endif
 
