Index: palm/trunk/SOURCE/boundary_conds.f90
===================================================================
--- palm/trunk/SOURCE/boundary_conds.f90	(revision 1397)
+++ palm/trunk/SOURCE/boundary_conds.f90	(revision 1398)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! -----------------
-! 
+! Dirichlet-condition at the top for u and v changed to u_init and v_init also 
+! for large_scale_forcing
 ! 
 ! Former revisions:
@@ -162,8 +163,4 @@
         u_p(nzt+1,:,:) = u_init(nzt+1)
         v_p(nzt+1,:,:) = v_init(nzt+1)
-        IF ( large_scale_forcing) THEN
-           u_p(nzt+1,:,:) = ug(nzt+1)
-           v_p(nzt+1,:,:) = vg(nzt+1)
-        END IF
        !$acc end kernels
     ELSE
Index: palm/trunk/SOURCE/fft_xy.f90
===================================================================
--- palm/trunk/SOURCE/fft_xy.f90	(revision 1397)
+++ palm/trunk/SOURCE/fft_xy.f90	(revision 1398)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! bugfix: typo removed for KIND in CMPLX function
 !
 ! Former revisions:
@@ -1210,6 +1210,6 @@
                    y_out(0) = CMPLX( ar_tr(0,i,k), 0.0_wp, KIND=wp )
                    DO  j = 1, (ny+1)/2 - 1
-                      y_out(j) = CMPLX( ar_tr(j,i,k), ar_tr(ny+1-j,i,k,        &
-                                        KIND=wp) )
+                      y_out(j) = CMPLX( ar_tr(j,i,k), ar_tr(ny+1-j,i,k),       &
+                                        KIND=wp )
                    ENDDO
                    y_out((ny+1)/2) = CMPLX( ar_tr((ny+1)/2,i,k), 0.0_wp,       &
Index: palm/trunk/SOURCE/nudging.f90
===================================================================
--- palm/trunk/SOURCE/nudging.f90	(revision 1397)
+++ palm/trunk/SOURCE/nudging.f90	(revision 1398)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! ------------------
-! 
+! Subroutine nudge_ref is extended to set u_init and v_init to the current 
+! nudging profiles
 ! 
 ! Former revisions:
@@ -552,5 +553,6 @@
 
        USE arrays_3d,                                                          &
-           ONLY:  time_vert, ptnudge, pt_init, qnudge, q_init
+           ONLY:  time_vert, ptnudge, pt_init, qnudge, q_init, unudge, u_init, &
+                  vnudge, v_init
 
        USE kinds
@@ -580,7 +582,8 @@
        pt_init = ptnudge(:,nt) + fac * ( ptnudge(:,nt+1) - ptnudge(:,nt) )
        q_init  = qnudge(:,nt) + fac * ( qnudge(:,nt+1) - qnudge(:,nt) )
+       u_init  = unudge(:,nt) + fac * ( unudge(:,nt+1) - unudge(:,nt) )
+       v_init  = vnudge(:,nt) + fac * ( vnudge(:,nt+1) - vnudge(:,nt) )
 
     END SUBROUTINE nudge_ref
 
-
  END MODULE nudge_mod
Index: palm/trunk/SOURCE/prognostic_equations.f90
===================================================================
--- palm/trunk/SOURCE/prognostic_equations.f90	(revision 1397)
+++ palm/trunk/SOURCE/prognostic_equations.f90	(revision 1398)
@@ -20,5 +20,7 @@
 ! Current revisions:
 ! ------------------
-! 
+! Rayleigh-damping for horizontal velocity components changed: instead of damping
+! against ug and vg, damping against u_init and v_init is used to allow for a 
+! homogenized treatment in case of nudging
 ! 
 ! Former revisions:
@@ -149,5 +151,5 @@
                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
+               tw_m, u, ug, u_init, u_p, v, vg, vpt, v_init, v_p, w, w_p
         
     USE control_parameters,                                                    &
@@ -383,5 +385,5 @@
                 u_p(k,j,i) = u(k,j,i) + dt_3d * ( tsc(2) * tend(k,j,i) +       &
                                                   tsc(3) * tu_m(k,j,i) )       &
-                                      - tsc(5) * rdf(k) * ( u(k,j,i) - ug(k) )
+                                      - tsc(5) * rdf(k) * ( u(k,j,i) - u_init(k) )
              ENDDO
 
@@ -442,5 +444,5 @@
                 v_p(k,j,i) = v(k,j,i) + dt_3d * ( tsc(2) * tend(k,j,i) +       &
                                                   tsc(3) * tv_m(k,j,i) )       &
-                                      - tsc(5) * rdf(k) * ( v(k,j,i) - vg(k) )
+                                      - tsc(5) * rdf(k) * ( v(k,j,i) - v_init(k) )
              ENDDO
 
@@ -975,5 +977,5 @@
              u_p(k,j,i) = u(k,j,i) + dt_3d * ( tsc(2) * tend(k,j,i) +          &
                                                tsc(3) * tu_m(k,j,i) )          &
-                                   - tsc(5) * rdf(k) * ( u(k,j,i) - ug(k) )
+                                   - tsc(5) * rdf(k) * ( u(k,j,i) - u_init(k) )
           ENDDO
        ENDDO
@@ -1051,5 +1053,5 @@
              v_p(k,j,i) = v(k,j,i) + dt_3d * ( tsc(2) * tend(k,j,i) +          &
                                                tsc(3) * tv_m(k,j,i) )          &
-                                   - tsc(5) * rdf(k) * ( v(k,j,i) - vg(k) )
+                                   - tsc(5) * rdf(k) * ( v(k,j,i) - v_init(k) )
           ENDDO
        ENDDO
@@ -1811,5 +1813,5 @@
 !
 !-- Prognostic equation for u-velocity component
-    !$acc kernels present( nzb_u_inner, rdf, tend, tu_m, u, ug, u_p )
+    !$acc kernels present( nzb_u_inner, rdf, tend, tu_m, u, u_init, u_p )
     !$acc loop independent
     DO  i = i_left, i_right
@@ -1821,5 +1823,5 @@
                 u_p(k,j,i) = u(k,j,i) + dt_3d * ( tsc(2) * tend(k,j,i) +       &
                                                   tsc(3) * tu_m(k,j,i) )       &
-                                      - tsc(5) * rdf(k) * ( u(k,j,i) - ug(k) )
+                                      - tsc(5) * rdf(k) * ( u(k,j,i) - u_init(k) )
 !
 !--             Tendencies for the next Runge-Kutta step
@@ -1878,5 +1880,5 @@
 !
 !-- Prognostic equation for v-velocity component
-    !$acc kernels present( nzb_v_inner, rdf, tend, tv_m, v, vg, v_p )
+    !$acc kernels present( nzb_v_inner, rdf, tend, tv_m, v, v_init, v_p )
     !$acc loop independent
     DO  i = i_left, i_right
@@ -1888,5 +1890,5 @@
                 v_p(k,j,i) = v(k,j,i) + dt_3d * ( tsc(2) * tend(k,j,i) +       &
                                                   tsc(3) * tv_m(k,j,i) )       &
-                                      - tsc(5) * rdf(k) * ( v(k,j,i) - vg(k) )
+                                      - tsc(5) * rdf(k) * ( v(k,j,i) - v_init(k) )
 !
 !--             Tendencies for the next Runge-Kutta step
