Index: palm/trunk/SOURCE/init_3d_model.f90
===================================================================
--- palm/trunk/SOURCE/init_3d_model.f90	(revision 3899)
+++ palm/trunk/SOURCE/init_3d_model.f90	(revision 3900)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Fix problem with LOD = 2 initialization
+! 
+! 3885 2019-04-11 11:29:34Z kanani
 ! Changes related to global restructuring of location messages and introduction 
 ! of additional debug messages
@@ -1204,12 +1207,66 @@
           ENDDO
 !
-!--       Exchange ghost points in case of level-of-detail = 2
-          IF( init_3d%lod_u == 2 )   CALL exchange_horiz( u, nbgp )
-          IF( init_3d%lod_v == 2 )   CALL exchange_horiz( v, nbgp )
-          IF( init_3d%lod_w == 2 )   CALL exchange_horiz( w, nbgp )
+!--       Exchange ghost points and set boundary conditions in case of 
+!--       level-of-detail = 2
+          IF( init_3d%lod_u == 2 )  CALL exchange_horiz( u, nbgp )
+          IF( init_3d%lod_v == 2 )  CALL exchange_horiz( v, nbgp )
+          IF( init_3d%lod_w == 2 )  CALL exchange_horiz( w, nbgp )
           IF( .NOT. neutral  .AND.  init_3d%lod_pt == 2 )                      &
              CALL exchange_horiz( pt, nbgp )
           IF( humidity  .AND.  init_3d%lod_q == 2 )                            &
              CALL exchange_horiz( q, nbgp )
+          
+          IF ( bc_dirichlet_l )  THEN
+             DO  j = nysg, nyng
+                DO  k = nzb, nzt+1
+                   IF( init_3d%lod_u == 2 )  u(k,j,nxlg:nxl)   = u(k,j,nxlu)
+                   IF( init_3d%lod_v == 2 )  v(k,j,nxlg:nxl-1) = v(k,j,nxl)
+                   IF( init_3d%lod_w == 2 )  w(k,j,nxlg:nxl-1) = w(k,j,nxl)
+                   IF( .NOT. neutral  .AND.  init_3d%lod_pt == 2 )                      &
+                      pt(k,j,nxlg:nxl-1) = pt(k,j,nxl)
+                   IF( humidity  .AND.  init_3d%lod_q == 2 )                            &
+                      q(k,j,nxlg:nxl-1)  = q(k,j,nxl) 
+                ENDDO
+             ENDDO
+          ENDIF
+          IF ( bc_dirichlet_r )  THEN
+             DO  j = nysg, nyng
+                DO  k = nzb, nzt+1
+                   IF( init_3d%lod_u == 2 )  u(k,j,nxr+1:nxrg) = u(k,j,nxr)
+                   IF( init_3d%lod_v == 2 )  v(k,j,nxr+1:nxrg) = v(k,j,nxr)
+                   IF( init_3d%lod_w == 2 )  w(k,j,nxr+1:nxrg) = w(k,j,nxr)
+                   IF( .NOT. neutral  .AND.  init_3d%lod_pt == 2 )                      &
+                      pt(k,j,nxr+1:nxrg) = pt(k,j,nxr)
+                   IF( humidity  .AND.  init_3d%lod_q == 2 )                            &
+                      q(k,j,nxr+1:nxrg)  = q(k,j,nxr) 
+                ENDDO
+             ENDDO
+          ENDIF
+          IF ( bc_dirichlet_s )  THEN
+             DO  i = nxlg, nxrg
+                DO  k = nzb, nzt+1
+                   IF( init_3d%lod_u == 2 )  u(k,nysg:nys-1,i) = u(k,nys,i)
+                   IF( init_3d%lod_v == 2 )  v(k,nysg:nys,i)   = v(k,nysv,i)
+                   IF( init_3d%lod_w == 2 )  w(k,nysg:nys-1,i) = w(k,nys,i)
+                   IF( .NOT. neutral  .AND.  init_3d%lod_pt == 2 )                      &
+                      pt(k,nysg:nys-1,i) = pt(k,nys,i)
+                   IF( humidity  .AND.  init_3d%lod_q == 2 )                            &
+                      q(k,nysg:nys-1,i)  = q(k,nys,i)
+                ENDDO
+             ENDDO
+          ENDIF
+          IF ( bc_dirichlet_n )  THEN
+             DO  i = nxlg, nxrg
+                DO  k = nzb, nzt+1
+                   IF( init_3d%lod_u == 2 )  u(k,nyn+1:nyng,i) = u(k,nyn,i)
+                   IF( init_3d%lod_v == 2 )  v(k,nyn+1:nyng,i) = v(k,nyn,i)
+                   IF( init_3d%lod_w == 2 )  w(k,nyn+1:nyng,i) = w(k,nyn,i)
+                   IF( .NOT. neutral  .AND.  init_3d%lod_pt == 2 )                      &
+                      pt(k,nyn+1:nyng,i) = pt(k,nyn,i)
+                   IF( humidity  .AND.  init_3d%lod_q == 2 )                            &
+                      q(k,nyn+1:nyng,i)  = q(k,nyn,i)
+                ENDDO
+             ENDDO
+          ENDIF
 !
 !--       Set geostrophic wind components.  
Index: palm/trunk/SOURCE/radiation_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/radiation_model_mod.f90	(revision 3899)
+++ palm/trunk/SOURCE/radiation_model_mod.f90	(revision 3900)
@@ -28,4 +28,7 @@
 ! -----------------
 ! $Id$
+! Fixed initialization problem
+! 
+! 3885 2019-04-11 11:29:34Z kanani
 ! Changes related to global restructuring of location messages and introduction 
 ! of additional debug messages
@@ -2216,7 +2219,7 @@
                 ioff = surf_usm_v(l)%ioff
                 joff = surf_usm_v(l)%joff
-                DO  m = 1, surf_usm_h%ns
-                   i = surf_usm_h%i(m) + joff
-                   j = surf_usm_h%j(m) + joff
+                DO  m = 1, surf_usm_v(l)%ns
+                   i = surf_usm_v(l)%i(m) + joff
+                   j = surf_usm_v(l)%j(m) + joff
                    IF ( albedo_pars_f%pars_xy(0,j,i) /= albedo_pars_f%fill )  THEN
                       IF ( surf_usm_v(l)%albedo_type(ind_veg_wall,m) == 0 )    &
@@ -2225,5 +2228,5 @@
                          surf_usm_v(l)%albedo(ind_pav_green,m) = albedo_pars_f%pars_xy(0,j,i)
                       IF ( surf_usm_v(l)%albedo_type(ind_wat_win,m) == 0 )     &
-                         surf_lsm_v(l)%albedo(ind_wat_win,m) = albedo_pars_f%pars_xy(0,j,i)
+                         surf_usm_v(l)%albedo(ind_wat_win,m) = albedo_pars_f%pars_xy(0,j,i)
                    ENDIF
                 ENDDO
Index: palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90
===================================================================
--- palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90	(revision 3899)
+++ palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90	(revision 3900)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Missing re-calculation of perturbation seeds in case of restarts
+! 
+! 3891 2019-04-12 17:52:01Z suehring
 ! Bugfix in initialization in case of restart runs. 
 ! 
@@ -899,4 +902,36 @@
                 ELSE
                    fw_yz = 0._wp
+                ENDIF
+
+             ENDDO
+          ENDDO
+       ENDIF
+       
+       IF ( myidy == id_stg_south  .OR.  myidy == id_stg_north )  THEN
+
+          IF ( myidy == id_stg_south )  j = -1
+          IF ( myidy == id_stg_north )  j = nyn+1
+
+          DO  i = nxlg, nxrg
+             DO  k = nzb, nzt+1
+
+                IF  ( a11(k) .NE. 0._wp ) THEN
+                   fu_xz(k,i) = ( u(k,j,i) / mc_factor - u_init(k) ) / a11(k)
+                ELSE
+                   fu_xz(k,i) = 0._wp
+                ENDIF
+
+                IF  ( a22(k) .NE. 0._wp ) THEN
+                   fv_xz(k,i) = ( v(k,j,i) / mc_factor - a21(k) * fu_yz(k,i) - &
+                               v_init(k) ) / a22(k)
+                ELSE
+                   fv_xz(k,i) = 0._wp
+                ENDIF
+
+                IF  ( a33(k) .NE. 0._wp ) THEN
+                   fw_xz(k,i) = ( w(k,j,i) / mc_factor - a31(k) * fu_yz(k,i) - &
+                               a32(k) * fv_yz(k,i) ) / a33(k)
+                ELSE
+                   fw_xz = 0._wp
                 ENDIF
 
