Index: palm/trunk/SOURCE/parin.f90
===================================================================
--- palm/trunk/SOURCE/parin.f90	(revision 2940)
+++ palm/trunk/SOURCE/parin.f90	(revision 2941)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Fix for spinup in case of restart run
+! 
+! 2938 2018-03-27 15:52:42Z suehring
 ! Change initialization in case child domain should be initialized with Inifor.
 ! 
@@ -849,5 +852,6 @@
                 ENDIF
                 end_time = end_time + spinup_time
-                spinup = .TRUE.
+                IF ( TRIM( initializing_actions ) /= 'read_restart_data' )     &
+                   spinup = .TRUE.
              ENDIF
           ENDIF
Index: palm/trunk/SOURCE/radiation_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/radiation_model_mod.f90	(revision 2940)
+++ palm/trunk/SOURCE/radiation_model_mod.f90	(revision 2941)
@@ -28,4 +28,10 @@
 ! -----------------
 ! $Id$
+! No read of nsurfl from SVF file since it is calculated in
+! radiation_interaction_init,
+! allocation of arrays in radiation_read_svf only if not yet allocated,
+! update of 2920 revision comment.
+! 
+! 2932 2018-03-26 09:39:22Z maronga
 ! renamed radiation_par to radiation_parameters
 ! 
@@ -37,19 +43,19 @@
 ! 2920 2018-03-22 11:22:01Z kanani
 ! - Bugfix: Initialize pcbl array (=-1)
-! moh.hefny:
-! - Use precalculated apparent solar positions for direct irradiance
-! - Cumulative commit for radiation changes - merged RTM version 2.0:
-! - New version of radiation interaction
-! - Added new 2D raytracing process using whole vertical column at once (e.g.
-!   memory efficiency & much less RMA)
-! - Removed virtual surfaces
-! - Separate processing of direct and diffuse solar radiation, new discreti
-!   zation by azimuth and elevation angles
-! - Diffuse radiation processed cumulatively using sky view factor
-! - Enabled limiting of number of view factors between real surfaces, thus
-!   greatly enhancing scalability
-! - Minor bugfixes and enhancements
-! - Fixing bugs from moving radiation interaction from urban_surface_mod
-! 
+! RTM version 2.0 (Jaroslav Resler, Pavel Krc, Mohamed Salim):
+! - new major version of radiation interactions
+! - substantially enhanced performance and scalability
+! - processing of direct and diffuse solar radiation separated from reflected 
+!   radiation, removed virtual surfaces
+! - new type of sky discretization by azimuth and elevation angles
+! - diffuse radiation processed cumulatively using sky view factor
+! - used precalculated apparent solar positions for direct irradiance
+! - added new 2D raytracing process for processing whole vertical column at once
+!   to increase memory efficiency and decrease number of MPI RMA operations
+! - enabled limiting the number of view factors between surfaces by the distance
+!   and value
+! - fixing issues induced by transferring radiation interactions from 
+!   urban_surface_mod to radiation_mod
+! - bugfixes and other minor enhancements
 ! 
 ! 2906 2018-03-19 08:56:40Z Giersch
@@ -6649,4 +6655,5 @@
         INTEGER(iwp)                 :: fsvf = 88
         INTEGER(iwp)                 :: i
+        INTEGER(iwp)                 :: nsurfl_from_file = 0
         CHARACTER(rad_version_len)   :: rad_version_field
         CHARACTER(svf_code_len)      :: svf_code_field
@@ -6669,5 +6676,5 @@
                 
 !--             read nsvfl, ncsfl
-                READ ( fsvf ) nsvfl, ncsfl, nsurfl
+                READ ( fsvf ) nsvfl, ncsfl, nsurfl_from_file
                 IF ( nsvfl <= 0  .OR.  ncsfl < 0 )  THEN
                     WRITE( message_string, * ) 'Wrong number of SVF or CSF'
@@ -6678,9 +6685,15 @@
                     CALL location_message( message_string, .TRUE. )
                 ENDIF
+                IF ( nsurfl_from_file /= nsurfl )  THEN
+                    WRITE( message_string, * ) 'nsurfl from SVF file does not ', &
+                                               'match calculated nsurfl from ',  &
+                                               'radiation_interaction_init'
+                    CALL message( 'radiation_read_svf', 'PA0490', 1, 2, 0, 6, 0 )
+                ENDIF
                 
-                ALLOCATE(skyvf(nsurfl))
-                ALLOCATE(skyvft(nsurfl))
-                ALLOCATE(svf(ndsvf,nsvfl))
-                ALLOCATE(svfsurf(idsvf,nsvfl))
+                IF ( .NOT. ALLOCATED( skyvf ) )    ALLOCATE( skyvf(nsurfl) )
+                IF ( .NOT. ALLOCATED( skyvft ) )   ALLOCATE( skyvft(nsurfl) )
+                IF ( .NOT. ALLOCATED( svf ) )      ALLOCATE( svf(ndsvf,nsvfl) )
+                IF ( .NOT. ALLOCATED( svfsurf ) )  ALLOCATE( svfsurf(idsvf,nsvfl) )
                 READ(fsvf) skyvf
                 READ(fsvf) skyvft
@@ -6688,6 +6701,6 @@
                 READ(fsvf) svfsurf
                 IF ( plant_canopy )  THEN
-                    ALLOCATE(csf(ndcsf,ncsfl))
-                    ALLOCATE(csfsurf(idcsf,ncsfl))
+                    IF ( .NOT. ALLOCATED( csf ) )      ALLOCATE( csf(ndcsf,ncsfl) )
+                    IF ( .NOT. ALLOCATED( csfsurf ) )  ALLOCATE( csfsurf(idcsf,ncsfl) )
                     READ(fsvf) csf
                     READ(fsvf) csfsurf
Index: palm/trunk/SOURCE/time_integration.f90
===================================================================
--- palm/trunk/SOURCE/time_integration.f90	(revision 2940)
+++ palm/trunk/SOURCE/time_integration.f90	(revision 2941)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Deduct spinup_time from RUN_CONTROL output of main 3d run 
+! (use time_since_reference_point instead of simulated_time)
+! 
+! 2938 2018-03-27 15:52:42Z suehring
 ! Nesting of dissipation rate in case of RANS mode and TKE-e closure is applied
 ! 
@@ -1059,6 +1063,7 @@
        current_timestep_number    = current_timestep_number + 1
        simulated_time             = simulated_time   + dt_3d
-       simulated_time_chr         = time_to_string( simulated_time )
        time_since_reference_point = simulated_time - coupling_start_time
+       simulated_time_chr         = time_to_string( time_since_reference_point )
+
 
 
