Index: palm/trunk/SOURCE/Makefile
===================================================================
--- palm/trunk/SOURCE/Makefile	(revision 4801)
+++ palm/trunk/SOURCE/Makefile	(revision 4802)
@@ -25,4 +25,7 @@
 # -----------------
 # $Id$
+# Add depedency for indoor model
+#
+# 4778 2020-11-09 13:40:05Z raasch
 # particle output routine and dependencies added
 #
@@ -1098,4 +1101,5 @@
 	cpulog_mod.o \
 	gust_mod.o \
+	indoor_model_mod.o \
 	mod_kinds.o \
 	model_1d_mod.o \
@@ -1414,4 +1418,5 @@
 	bulk_cloud_model_mod.o \
 	gust_mod.o \
+	indoor_model_mod.o \
 	mod_kinds.o \
 	model_1d_mod.o \
Index: palm/trunk/SOURCE/read_restart_data_mod.f90
===================================================================
--- palm/trunk/SOURCE/read_restart_data_mod.f90	(revision 4801)
+++ palm/trunk/SOURCE/read_restart_data_mod.f90	(revision 4802)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! include time_indoor into restart mechanism
+!
+! 4777 2020-11-06 14:50:49Z raasch
 ! bugfix for reading spectra data with MPI-I/O (they are global arrays!)
 !
@@ -171,4 +174,7 @@
         ONLY:  nbgp, nx, nxl, nxlg, nxr, nxrg, nx_on_file, ny, nys, nysg, nyn, &
                nyng, ny_on_file, nz, nzb, nzt
+
+    USE indoor_model_mod,                                                                          &
+        ONLY:  time_indoor
 
     USE kinds
@@ -719,4 +725,6 @@
              CASE ( 'time_dots' )
                 READ ( 13 )  time_dots
+             CASE ( 'time_indoor' )
+                READ ( 13 )  time_indoor
              CASE ( 'time_radiation' )
                 READ ( 13 )  time_radiation
@@ -1099,4 +1107,5 @@
        CALL rrd_mpi_io( 'time_dosp', time_dosp )
        CALL rrd_mpi_io( 'time_dots', time_dots )
+       CALL rrd_mpi_io( 'time_indoor', time_indoor )
        CALL rrd_mpi_io( 'time_radiation', time_radiation )
        CALL rrd_mpi_io( 'time_restart', time_restart )
Index: palm/trunk/SOURCE/time_integration.f90
===================================================================
--- palm/trunk/SOURCE/time_integration.f90	(revision 4801)
+++ palm/trunk/SOURCE/time_integration.f90	(revision 4802)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Bugfix in time-control of indoor model at the very first time step
+!
+! 4732 2020-10-07 14:46:34Z schwenkel
 ! Add use statements for OPENACC
 !
@@ -654,5 +657,6 @@
 
     CALL location_message( 'atmosphere (and/or ocean) time-stepping', 'start' )
-
+write(9,*) "time_indoor begin", time_indoor
+flush(9)
 !
 !-- Start of the time loop
@@ -1164,5 +1168,5 @@
           IF ( time_indoor >= dt_indoor  .OR.  current_timestep_number == 0 )  THEN
 
-             time_indoor = time_indoor - dt_indoor
+             IF ( time_indoor >= dt_indoor )  time_indoor = time_indoor - dt_indoor
 
              CALL cpu_log( log_point(76), 'indoor_model', 'start' )
Index: palm/trunk/SOURCE/time_integration_spinup.f90
===================================================================
--- palm/trunk/SOURCE/time_integration_spinup.f90	(revision 4801)
+++ palm/trunk/SOURCE/time_integration_spinup.f90	(revision 4802)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Bugfix in time-control of indoor model at the very first time step
+!
+! 4750 2020-10-16 14:27:48Z suehring
 ! - bugfix, call hourly-based indoor model only once per hour, not every timestep.
 ! - optionally switch-off/on the indoor model during spinup
@@ -502,5 +505,5 @@
           IF ( time_indoor >= dt_indoor  .OR.  current_timestep_number_spinup == 0 )  THEN
 
-             time_indoor = time_indoor - dt_indoor
+             IF ( time_indoor >= dt_indoor )  time_indoor = time_indoor - dt_indoor
 
              CALL im_main_heatcool
Index: palm/trunk/SOURCE/write_restart_data_mod.f90
===================================================================
--- palm/trunk/SOURCE/write_restart_data_mod.f90	(revision 4801)
+++ palm/trunk/SOURCE/write_restart_data_mod.f90	(revision 4802)
@@ -24,4 +24,7 @@
 ! -----------------
 ! $Id$
+! include time_indoor into restart mechanism
+!
+! 4777 2020-11-06 14:50:49Z raasch
 ! bugfix for writing spectra data with MPI-I/O (they are global arrays!)
 !
@@ -109,4 +112,7 @@
         ONLY:  nx, nxl, nxr, ny, nys, nyn, nz, nzb, nzt
 
+    USE indoor_model_mod,                                                                          &
+        ONLY:  time_indoor
+
     USE kinds
 
@@ -716,4 +722,7 @@
        CALL wrd_write_string( 'time_dots' )
        WRITE ( 14 )  time_dots
+
+       CALL wrd_write_string( 'time_indoor' )
+       WRITE ( 14 )  time_indoor
 
        CALL wrd_write_string( 'time_radiation' )
@@ -1081,4 +1090,5 @@
        CALL wrd_mpi_io( 'time_dosp', time_dosp )
        CALL wrd_mpi_io( 'time_dots', time_dots )
+       CALL wrd_mpi_io( 'time_indoor', time_indoor )
        CALL wrd_mpi_io( 'time_radiation', time_radiation )
        CALL wrd_mpi_io( 'time_restart', time_restart )
