Index: palm/trunk/SOURCE/land_surface_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/land_surface_model_mod.f90	(revision 4668)
+++ palm/trunk/SOURCE/land_surface_model_mod.f90	(revision 4669)
@@ -20,9 +20,12 @@
 ! Current revisions:
 ! -----------------
-! 
-! 
+!
+!
 ! Former revisions:
 ! -----------------
 ! $Id$
+! Fix calculation of force_radiation_call
+! 
+! 4666 2020-09-04 19:22:56Z maronga
 ! Bugfix: wrong value for g_d for vegetation_type = 7 (0.13 -> 0.03)
 !
@@ -2196,9 +2199,11 @@
          == intermediate_timestep_count_max-1 )  THEN
 #if defined( __parallel )
-       IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
-       CALL MPI_ALLREDUCE( force_radiation_call_l, force_radiation_call,       &
-                           1, MPI_LOGICAL, MPI_LOR, comm2d, ierr )
+       IF ( .NOT. force_radiation_call ) THEN
+          IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
+          CALL MPI_ALLREDUCE( force_radiation_call_l, force_radiation_call,       &
+                              1, MPI_LOGICAL, MPI_LOR, comm2d, ierr )
+       ENDIF
 #else
-       force_radiation_call = force_radiation_call_l
+       force_radiation_call = force_radiation_call .OR. force_radiation_call_l
 #endif
        force_radiation_call_l = .FALSE.
Index: palm/trunk/SOURCE/time_integration.f90
===================================================================
--- palm/trunk/SOURCE/time_integration.f90	(revision 4668)
+++ palm/trunk/SOURCE/time_integration.f90	(revision 4669)
@@ -25,4 +25,9 @@
 ! -----------------
 ! $Id$
+! - Fix missing call of radiation after spinup
+! - Fix calculation of force_radiation_call
+! - Fix calculation of radiation times
+!
+! 4668 2020-09-09 13:00:16Z pavelkrc
 ! Improve debug messages during timestepping
 ! 
@@ -1194,5 +1199,5 @@
 !
 !--    If required, calculate radiative fluxes and heating rates
-       IF ( radiation  .AND.  time_since_reference_point > skip_time_do_radiation )  THEN
+       IF ( radiation  .AND.  time_since_reference_point >= skip_time_do_radiation )  THEN
 
           time_radiation = time_radiation + dt_3d
@@ -1202,5 +1207,5 @@
              CALL cpu_log( log_point(50), 'radiation', 'start' )
 
-             IF ( .NOT. force_radiation_call )  THEN
+             IF ( time_radiation >= dt_radiation )  THEN
                 time_radiation = time_radiation - dt_radiation
              ENDIF
@@ -1211,6 +1216,6 @@
 !--          solar positions
              time_since_reference_point_save = time_since_reference_point
-             time_since_reference_point = REAL( FLOOR( time_since_reference_point /             &
-                                                       dt_radiation ), wp ) * dt_radiation
+             time_since_reference_point = time_since_reference_point -                            &
+                                          MODULO(time_since_reference_point, dt_radiation)
 
              CALL radiation_control
@@ -1225,4 +1230,7 @@
 !--          Return the current time to its original value
              time_since_reference_point = time_since_reference_point_save
+!
+!--          Reset forcing of radiation call
+             force_radiation_call = .FALSE.
 
              CALL cpu_log( log_point(50), 'radiation', 'stop' )
Index: palm/trunk/SOURCE/time_integration_spinup.f90
===================================================================
--- palm/trunk/SOURCE/time_integration_spinup.f90	(revision 4668)
+++ palm/trunk/SOURCE/time_integration_spinup.f90	(revision 4669)
@@ -25,4 +25,9 @@
 ! -----------------
 ! $Id$
+! - Fix missing call of radiation after spinup
+! - Fix calculation of force_radiation_call
+! - Fix calculation of radiation times
+!
+! 4668 2020-09-09 13:00:16Z pavelkrc
 ! Improve debug messages during timestepping
 !
@@ -481,4 +486,8 @@
                 CALL radiation_interaction
              ENDIF
+!
+!--          Reset forcing of radiation call
+             force_radiation_call = .FALSE.
+
           ENDIF
        ENDIF
@@ -632,4 +641,7 @@
 !-- Reset time step
     dt_3d = dt_save
+!-- Force radiation step in time zero
+!-- It is performed at the end of init_radiation in case of run without spinup
+    time_radiation = dt_radiation
 
     DEALLOCATE(pt_save)
Index: palm/trunk/SOURCE/urban_surface_mod.f90
===================================================================
--- palm/trunk/SOURCE/urban_surface_mod.f90	(revision 4668)
+++ palm/trunk/SOURCE/urban_surface_mod.f90	(revision 4669)
@@ -27,4 +27,7 @@
 ! -----------------
 ! $Id$
+! Fix calculation of force_radiation_call
+!
+! 4668 2020-09-09 13:00:16Z pavelkrc
 ! Limit vertical r_a similarly to horizontal
 !
@@ -8427,9 +8430,11 @@
       IF ( intermediate_timestep_count == intermediate_timestep_count_max-1 )  THEN
 #if defined( __parallel )
-        IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
-        CALL MPI_ALLREDUCE( force_radiation_call_l, force_radiation_call,                          &
-                            1, MPI_LOGICAL, MPI_LOR, comm2d, ierr )
+        IF ( .NOT. force_radiation_call ) THEN
+           IF ( collective_wait )  CALL MPI_BARRIER( comm2d, ierr )
+           CALL MPI_ALLREDUCE( force_radiation_call_l, force_radiation_call,                      &
+                               1, MPI_LOGICAL, MPI_LOR, comm2d, ierr )
+        ENDIF
 #else
-        force_radiation_call = force_radiation_call_l
+        force_radiation_call = force_radiation_call .OR. force_radiation_call_l
 #endif
         force_radiation_call_l = .FALSE.
