Index: /palm/trunk/SOURCE/read_var_list.f90
===================================================================
--- /palm/trunk/SOURCE/read_var_list.f90	(revision 2817)
+++ /palm/trunk/SOURCE/read_var_list.f90	(revision 2818)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Added spinup_time to allow for restarts with spinup in precursor run.
+! 
+! 2776 2018-01-31 10:44:42Z Giersch
 ! Change skip_var_list: Skipping of module related parameter is only necessary 
 ! if restart data was outputted at the end of the precursor run
@@ -294,5 +297,5 @@
 !-- Make version number check first
     READ ( 13 )  version_on_file
-    binary_version = '4.5'
+    binary_version = '4.6'
     IF ( TRIM( version_on_file ) /= TRIM( binary_version ) )  THEN
        WRITE( message_string, * ) 'version mismatch concerning control ', &
@@ -693,4 +696,6 @@
           CASE ( 'simulated_time' )
              READ ( 13 )  simulated_time
+          CASE ( 'spinup_time' ) 
+             READ ( 13 )  spinup_time
           CASE ( 'surface_heatflux' )
              READ ( 13 )  surface_heatflux
Index: /palm/trunk/SOURCE/time_integration_spinup.f90
===================================================================
--- /palm/trunk/SOURCE/time_integration_spinup.f90	(revision 2817)
+++ /palm/trunk/SOURCE/time_integration_spinup.f90	(revision 2818)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Velocity components near walls/ground are now set to the profiles stored in
+! u_init and v_init. Activated soil moisture calculation during spinup.
+! 
+! 2782 2018-02-02 11:51:10Z maronga
 ! Bugfix and re-activation of homogeneous setting of velocity components 
 ! during spinup
@@ -76,5 +80,5 @@
  
     USE arrays_3d,                                                             &
-        ONLY:  pt, pt_p, u, v
+        ONLY:  pt, pt_p, u, u_init, v, v_init
 
     USE control_parameters,                                                    &
@@ -183,6 +187,6 @@
           j   = surf_lsm_h%j(m)
           k   = surf_lsm_h%k(m)
-          u(k,j,i) =  SIGN(1.0_wp,u(k,j,i)) * MAX(ug_surface,0.1_wp)
-          v(k,j,i) =  SIGN(1.0_wp,v(k,j,i)) * MAX(vg_surface,0.1_wp)
+          u(k,j,i) = SIGN(1.0_wp,u_init(k)) * MAX(u_init(k),0.1_wp)
+          v(k,j,i) = SIGN(1.0_wp,v_init(k)) * MAX(v_init(k),0.1_wp)
        ENDDO
 
@@ -192,6 +196,6 @@
              j   = surf_lsm_v(l)%j(m)
              k   = surf_lsm_v(l)%k(m)
-             u(k,j,i) =  SIGN(1.0_wp,u(k,j,i)) * MAX(ug_surface,0.1_wp)
-             v(k,j,i) =  SIGN(1.0_wp,v(k,j,i)) * MAX(vg_surface,0.1_wp)
+             u(k,j,i) = SIGN(1.0_wp,u_init(k)) * MAX(u_init(k),0.1_wp)
+             v(k,j,i) = SIGN(1.0_wp,v_init(k)) * MAX(v_init(k),0.1_wp)
           ENDDO
        ENDDO
@@ -203,6 +207,6 @@
           j   = surf_usm_h%j(m)
           k   = surf_usm_h%k(m)
-          u(k,j,i) =  SIGN(1.0_wp,u(k,j,i)) * MAX(ug_surface,0.1_wp)
-          v(k,j,i) =  SIGN(1.0_wp,v(k,j,i)) * MAX(vg_surface,0.1_wp)
+          u(k,j,i) = SIGN(1.0_wp,u_init(k)) * MAX(u_init(k),0.1_wp)
+          v(k,j,i) = SIGN(1.0_wp,v_init(k)) * MAX(v_init(k),0.1_wp)
        ENDDO
 
@@ -212,9 +216,12 @@
              j   = surf_usm_v(l)%j(m)
              k   = surf_usm_v(l)%k(m)
-             u(k,j,i) =  SIGN(1.0_wp,u(k,j,i)) * MAX(ug_surface,0.1_wp)
-             v(k,j,i) =  SIGN(1.0_wp,v(k,j,i)) * MAX(vg_surface,0.1_wp)
+             u(k,j,i) = SIGN(1.0_wp,u_init(k)) * MAX(u_init(k),0.1_wp)
+             v(k,j,i) = SIGN(1.0_wp,v_init(k)) * MAX(v_init(k),0.1_wp)
           ENDDO
        ENDDO
     ENDIF
+
+    CALL exchange_horiz( u,  nbgp )
+    CALL exchange_horiz( v,  nbgp )
 
     dt_save = dt_3d
@@ -289,4 +296,7 @@
           ENDIF
 
+          CALL exchange_horiz( pt,  nbgp )    
+
+
 !
 !--       Swap the time levels in preparation for the next time step.
@@ -338,21 +348,21 @@
 !--             Call for horizontal upward-facing surfaces
                 CALL lsm_energy_balance( .TRUE., -1 )
-                CALL lsm_soil_model( .TRUE., -1, .FALSE. )
+                CALL lsm_soil_model( .TRUE., -1, .TRUE. )
 !
 !--             Call for northward-facing surfaces
                 CALL lsm_energy_balance( .FALSE., 0 )
-                CALL lsm_soil_model( .FALSE., 0, .FALSE. )
+                CALL lsm_soil_model( .FALSE., 0, .TRUE. )
 !
 !--             Call for southward-facing surfaces
                 CALL lsm_energy_balance( .FALSE., 1 )
-                CALL lsm_soil_model( .FALSE., 1, .FALSE. )
+                CALL lsm_soil_model( .FALSE., 1, .TRUE. )
 !
 !--             Call for eastward-facing surfaces
                 CALL lsm_energy_balance( .FALSE., 2 )
-                CALL lsm_soil_model( .FALSE., 2, .FALSE. )
+                CALL lsm_soil_model( .FALSE., 2, .TRUE. )
 !
 !--             Call for westward-facing surfaces
                 CALL lsm_energy_balance( .FALSE., 3 )
-                CALL lsm_soil_model( .FALSE., 3, .FALSE. )
+                CALL lsm_soil_model( .FALSE., 3, .TRUE. )
 
                 CALL cpu_log( log_point(54), 'land_surface', 'stop' )
Index: /palm/trunk/SOURCE/write_var_list.f90
===================================================================
--- /palm/trunk/SOURCE/write_var_list.f90	(revision 2817)
+++ /palm/trunk/SOURCE/write_var_list.f90	(revision 2818)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Added spinup_time to allow for restarts with spinup in precursor run.
+! 
+! 2776 2018-01-31 10:44:42Z Giersch
 ! Variable synthetic_turbulence_generator has been abbreviated
 ! 
@@ -268,5 +271,5 @@
 
 
-    binary_version = '4.5'
+    binary_version = '4.6'
 
     WRITE ( 14 )  binary_version
@@ -601,4 +604,6 @@
     WRITE ( 14 )  'simulated_time                '
     WRITE ( 14 )  simulated_time
+    WRITE ( 14 )  'spinup_time                   '
+    WRITE ( 14 )  spinup_time
     WRITE ( 14 )  'surface_heatflux              '
     WRITE ( 14 )  surface_heatflux
