Index: palm/trunk/SOURCE/land_surface_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/land_surface_model_mod.f90	(revision 2705)
+++ palm/trunk/SOURCE/land_surface_model_mod.f90	(revision 2706)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! Bugfix, read surface temperature in case of restart runs.
 ! 
 ! Former revisions:
@@ -1768,4 +1768,5 @@
                         (0.81_wp * (0.004_wp * surf%rad_sw_in(m)               &
                          + 1.0_wp)) )
+
 !
 !--    f2: correction for soil moisture availability to plants (the 
@@ -1915,5 +1916,4 @@
 
        ENDIF
-
 
        tend = 0.0_wp
@@ -4052,32 +4052,4 @@
              ENDDO
           ENDDO
-
-!
-!--    Actions for restart runs
-       ELSE
-!
-!--       Horizontal surfaces
-          DO  m = 1, surf_lsm_h%ns
-             i   = surf_lsm_h%i(m)            
-             j   = surf_lsm_h%j(m)
-             k   = surf_lsm_h%k(m)          
-             t_surface_h%var_1d(m) = pt(k-1,j,i) * exn
-          ENDDO
-!
-!--       Vertical surfaces
-          DO  l = 0, 3
-!
-!--          Set index offset of surface element, seen from atmospheric grid point 
-             j_off = surf_lsm_v(l)%joff
-             i_off = surf_lsm_v(l)%ioff
-
-             DO  m = 1, surf_lsm_v(l)%ns
-                i   = surf_lsm_v(l)%i(m)            
-                j   = surf_lsm_v(l)%j(m)
-                k   = surf_lsm_v(l)%k(m)          
-                t_surface_v(l)%var_1d(m) = pt(k,j+j_off,i+i_off) * exn
-             ENDDO
-          ENDDO
-
        ENDIF
 !
@@ -4245,10 +4217,10 @@
        t_soil_h_p    = t_soil_h
        m_soil_h_p    = m_soil_h
-       m_liq_h_p  = m_liq_h
+       m_liq_h_p     = m_liq_h
        t_surface_h_p = t_surface_h
 
        t_soil_v_p    = t_soil_v
        m_soil_v_p    = m_soil_v
-       m_liq_v_p  = m_liq_v
+       m_liq_v_p     = m_liq_v
        t_surface_v_p = t_surface_v
 
@@ -5824,5 +5796,4 @@
        ENDDO
 
-
        WRITE ( 14 ) 'lsm_start_index_h   '
        WRITE ( 14 ) surf_lsm_h%start_index
@@ -5841,4 +5812,22 @@
           WRITE ( 14 ) m_liq_v(l)%var_1d          
        ENDDO
+
+       WRITE ( 14 ) 'lsm_start_index_h   '
+       WRITE ( 14 ) surf_lsm_h%start_index
+       WRITE ( 14 ) 'lsm_end_index_h     '
+       WRITE ( 14 ) surf_lsm_h%end_index
+       WRITE ( 14 ) 't_surface_h         '
+       WRITE ( 14 ) t_surface_h%var_1d
+       
+       DO  l = 0, 3
+          WRITE ( 14 ) 'lsm_start_index_v   '
+          WRITE ( 14 ) surf_lsm_v(l)%start_index
+          WRITE ( 14 ) 'lsm_end_index_v     '
+          WRITE ( 14 ) surf_lsm_v(l)%end_index
+          WRITE( dum, '(I1)')  l          
+          WRITE ( 14 ) 't_surface_v(' // dum // ')      ' 
+          WRITE ( 14 ) t_surface_v(l)%var_1d         
+       ENDDO
+
 
        WRITE ( 14 )  '*** end lsm ***     '
@@ -6340,4 +6329,94 @@
 
 
+                CASE ( 't_surface_h' )
+                 
+                   IF ( k == 1 )  THEN
+                      IF ( .NOT.  ALLOCATED( t_surface_h%var_1d ) )            &
+                         ALLOCATE( t_surface_h%var_1d(1:surf_lsm_h%ns) )
+                      READ ( 13 )  tmp_walltype_h_1d%var_1d
+                   ENDIF
+                   CALL surface_restore_elements(                              &
+                                              t_surface_h%var_1d,              &
+                                              tmp_walltype_h_1d%var_1d,        &
+                                              surf_lsm_h%start_index,          & 
+                                              start_index_on_file,             &
+                                              end_index_on_file,               &
+                                              nxlc, nysc,                      &
+                                              nxlf, nxrf, nysf, nynf,          &
+                                              nys_on_file, nyn_on_file,        &
+                                              nxl_on_file,nxr_on_file )
+
+                CASE ( 't_surface_v(0)' )
+                 
+                   IF ( k == 1 )  THEN
+                      IF ( .NOT.  ALLOCATED( t_surface_v(0)%var_1d ) )         &
+                         ALLOCATE( t_surface_v(0)%var_1d(1:surf_lsm_v(0)%ns) )
+                      READ ( 13 )  tmp_walltype_v_1d(0)%var_1d
+                   ENDIF
+                   CALL surface_restore_elements(                              &
+                                           t_surface_v(0)%var_1d,              &
+                                           tmp_walltype_v_1d(0)%var_1d,        &
+                                           surf_lsm_v(0)%start_index,          & 
+                                           start_index_on_file,                &
+                                           end_index_on_file,                  &
+                                           nxlc, nysc,                         &
+                                           nxlf, nxrf, nysf, nynf,             &
+                                           nys_on_file, nyn_on_file,           &
+                                           nxl_on_file,nxr_on_file )
+
+                CASE ( 't_surface_v(1)' )
+                 
+                   IF ( k == 1 )  THEN
+                      IF ( .NOT.  ALLOCATED( t_surface_v(1)%var_1d ) )         &
+                         ALLOCATE( t_surface_v(1)%var_1d(1:surf_lsm_v(1)%ns) )
+                      READ ( 13 )  tmp_walltype_v_1d(1)%var_1d
+                   ENDIF
+                   CALL surface_restore_elements(                              &
+                                           t_surface_v(1)%var_1d,              &
+                                           tmp_walltype_v_1d(1)%var_1d,        &
+                                           surf_lsm_v(1)%start_index,          & 
+                                           start_index_on_file,                &
+                                           end_index_on_file,                  &
+                                           nxlc, nysc,                         &
+                                           nxlf, nxrf, nysf, nynf,             &
+                                           nys_on_file, nyn_on_file,           &
+                                           nxl_on_file,nxr_on_file )
+
+                CASE ( 't_surface_v(2)' )
+                 
+                   IF ( k == 1 )  THEN
+                      IF ( .NOT.  ALLOCATED( t_surface_v(2)%var_1d ) )         &
+                         ALLOCATE( t_surface_v(2)%var_1d(1:surf_lsm_v(2)%ns) )
+                      READ ( 13 )  tmp_walltype_v_1d(2)%var_1d
+                   ENDIF
+                   CALL surface_restore_elements(                              &
+                                           t_surface_v(2)%var_1d,              &
+                                           tmp_walltype_v_1d(2)%var_1d,        &
+                                           surf_lsm_v(2)%start_index,          & 
+                                           start_index_on_file,                &
+                                           end_index_on_file,                  &
+                                           nxlc, nysc,                         &
+                                           nxlf, nxrf, nysf, nynf,             &
+                                           nys_on_file, nyn_on_file,           &
+                                           nxl_on_file,nxr_on_file )
+
+                CASE ( 't_surface_v(3)' )
+                 
+                   IF ( k == 1 )  THEN
+                      IF ( .NOT.  ALLOCATED( t_surface_v(3)%var_1d ) )         &
+                         ALLOCATE( t_surface_v(3)%var_1d(1:surf_lsm_v(3)%ns) )
+                      READ ( 13 )  tmp_walltype_v_1d(3)%var_1d
+                   ENDIF
+                   CALL surface_restore_elements(                              &
+                                           t_surface_v(3)%var_1d,              &
+                                           tmp_walltype_v_1d(3)%var_1d,        &
+                                           surf_lsm_v(3)%start_index,          & 
+                                           start_index_on_file,                &
+                                           end_index_on_file,                  &
+                                           nxlc, nysc,                         &
+                                           nxlf, nxrf, nysf, nynf,             &
+                                           nys_on_file, nyn_on_file,           &
+                                           nxl_on_file,nxr_on_file )
+
                CASE DEFAULT
                   WRITE( message_string, * ) 'unknown variable named "',       &
Index: palm/trunk/SOURCE/radiation_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/radiation_model_mod.f90	(revision 2705)
+++ palm/trunk/SOURCE/radiation_model_mod.f90	(revision 2706)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! Bugfix, in average radiation case calculate exner function before using it.
 ! 
 ! Former revisions:
@@ -2323,4 +2323,6 @@
           IF ( cloud_physics )  ql1 = ql1_l
 #endif
+ 
+          exn1 = ( hyp(nzut) / 100000.0_wp )**0.286_wp
           IF ( cloud_physics )  pt1 = pt1 + l_d_cp / exn1 * ql1
 !
Index: palm/trunk/SOURCE/read_3d_binary.f90
===================================================================
--- palm/trunk/SOURCE/read_3d_binary.f90	(revision 2705)
+++ palm/trunk/SOURCE/read_3d_binary.f90	(revision 2706)
@@ -1138,5 +1138,4 @@
     myid_char = myid_char_save
 
-
 !
 !-- End of time measuring for reading binary data
Index: palm/trunk/SOURCE/surface_mod.f90
===================================================================
--- palm/trunk/SOURCE/surface_mod.f90	(revision 2705)
+++ palm/trunk/SOURCE/surface_mod.f90	(revision 2706)
@@ -21,5 +21,5 @@
 ! Current revisions:
 ! ------------------
-! 
+! In case of restarts read and write pt_surface
 ! 
 ! Former revisions:
@@ -2235,4 +2235,6 @@
                    IF ( ALLOCATED( surf_def_h(l)%rib ) )                       &
                       surf_h(l)%rib(mm(l))     = surf_def_h(l)%rib(m)
+                   IF ( ALLOCATED( surf_def_h(l)%pt_surface ) )                &
+                      surf_h(l)%pt_surface(mm(l)) = surf_def_h(l)%pt_surface(m)
                    IF ( ALLOCATED( surf_def_h(l)%usws ) )                      &
                       surf_h(l)%usws(mm(l))    = surf_def_h(l)%usws(m)
@@ -2290,4 +2292,6 @@
                       IF ( ALLOCATED( surf_lsm_h%rib ) )                       &
                          surf_h(0)%rib(mm(0))     = surf_lsm_h%rib(m)
+                      IF ( ALLOCATED( surf_lsm_h%pt_surface ) )                &
+                         surf_h(l)%pt_surface(mm(l)) = surf_lsm_h%pt_surface(m)
                       IF ( ALLOCATED( surf_lsm_h%usws ) )                      &
                          surf_h(0)%usws(mm(0))    = surf_lsm_h%usws(m)
@@ -2345,4 +2349,6 @@
                       IF ( ALLOCATED( surf_usm_h%rib ) )                       &
                          surf_h(0)%rib(mm(0))     = surf_usm_h%rib(m)
+                      IF ( ALLOCATED( surf_usm_h%pt_surface ) )                &
+                         surf_h(l)%pt_surface(mm(l)) = surf_usm_h%pt_surface(m)
                       IF ( ALLOCATED( surf_usm_h%usws ) )                      &
                          surf_h(0)%usws(mm(0))    = surf_usm_h%usws(m)
@@ -2436,4 +2442,6 @@
                    IF ( ALLOCATED( surf_def_v(l)%rib ) )                       &
                       surf_v(l)%rib(mm(l))     = surf_def_v(l)%rib(m)
+                   IF ( ALLOCATED( surf_def_v(l)%pt_surface ) )                &
+                      surf_v(l)%pt_surface(mm(l)) = surf_def_v(l)%pt_surface(m)
                    IF ( ALLOCATED( surf_def_v(l)%shf ) )                       &
                       surf_v(l)%shf(mm(l))     = surf_def_v(l)%shf(m)
@@ -2492,4 +2500,6 @@
                    IF ( ALLOCATED( surf_lsm_v(l)%rib ) )                       &
                       surf_v(l)%rib(mm(l))     = surf_lsm_v(l)%rib(m)
+                   IF ( ALLOCATED( surf_lsm_v(l)%pt_surface ) )                &
+                      surf_v(l)%pt_surface(mm(l)) = surf_lsm_v(l)%pt_surface(m)
                    IF ( ALLOCATED( surf_lsm_v(l)%usws ) )                      &
                       surf_v(l)%usws(mm(l))    = surf_lsm_v(l)%usws(m)
@@ -2552,4 +2562,6 @@
                    IF ( ALLOCATED( surf_usm_v(l)%rib ) )                       &
                       surf_v(l)%rib(mm(l))     = surf_usm_v(l)%rib(m)
+                   IF ( ALLOCATED( surf_usm_v(l)%pt_surface ) )                &
+                      surf_v(l)%pt_surface(mm(l)) = surf_usm_v(l)%pt_surface(m)
                    IF ( ALLOCATED( surf_usm_v(l)%usws ) )                      &
                       surf_v(l)%usws(mm(l))    = surf_usm_v(l)%usws(m)
@@ -2657,4 +2669,8 @@
              WRITE ( 14 )  surf_h(l)%rib
           ENDIF
+          WRITE ( 14 )  'surf_h(' // dum // ')%pt_surface          '  
+          IF ( ALLOCATED ( surf_h(l)%pt_surface ) )  THEN
+             WRITE ( 14 )  surf_h(l)%pt_surface
+          ENDIF
           WRITE ( 14 )  'surf_h(' // dum // ')%usws                '  
           IF ( ALLOCATED ( surf_h(l)%usws ) )  THEN
@@ -2757,4 +2773,8 @@
           IF ( ALLOCATED ( surf_v(l)%rib ) )  THEN
              WRITE ( 14 )  surf_v(l)%rib
+          ENDIF
+          WRITE ( 14 )  'surf_v(' // dum // ')%pt_surface          '  
+          IF ( ALLOCATED ( surf_v(l)%pt_surface ) )  THEN
+             WRITE ( 14 )  surf_v(l)%pt_surface
           ENDIF
           WRITE ( 14 )  'surf_v(' // dum // ')%shf                 '  
@@ -2997,4 +3017,7 @@
                       IF ( ALLOCATED( surf_h(0)%rib )  .AND.  kk == 1 )        &
                          READ ( 13 )  surf_h(0)%rib
+                   CASE ( 'surf_h(0)%pt_surface' )         
+                      IF ( ALLOCATED( surf_h(0)%pt_surface )  .AND.  kk == 1 ) &
+                         READ ( 13 )  surf_h(0)%pt_surface
                    CASE ( 'surf_h(0)%usws' )         
                       IF ( ALLOCATED( surf_h(0)%usws )  .AND.  kk == 1 )       &
@@ -3073,4 +3096,7 @@
                       IF ( ALLOCATED( surf_h(1)%rib )  .AND.  kk == 1 )        &
                          READ ( 13 )  surf_h(1)%rib
+                   CASE ( 'surf_h(1)%pt_surface' )         
+                      IF ( ALLOCATED( surf_h(1)%pt_surface )  .AND.  kk == 1 ) &
+                         READ ( 13 )  surf_h(1)%pt_surface
                    CASE ( 'surf_h(1)%usws' )         
                       IF ( ALLOCATED( surf_h(1)%usws )  .AND.  kk == 1 )       &
@@ -3227,4 +3253,7 @@
                       IF ( ALLOCATED( surf_v(0)%rib )  .AND.  kk == 1 )        &
                          READ ( 13 )  surf_v(0)%rib
+                   CASE ( 'surf_v(0)%pt_surface' )         
+                      IF ( ALLOCATED( surf_v(0)%pt_surface )  .AND.  kk == 1 ) &
+                         READ ( 13 )  surf_v(0)%pt_surface
                    CASE ( 'surf_v(0)%shf' )         
                       IF ( ALLOCATED( surf_v(0)%shf )  .AND.  kk == 1 )        &
@@ -3306,4 +3335,7 @@
                       IF ( ALLOCATED( surf_v(1)%rib )  .AND.  kk == 1 )        &
                          READ ( 13 )  surf_v(1)%rib
+                   CASE ( 'surf_v(1)%pt_surface' )         
+                      IF ( ALLOCATED( surf_v(1)%pt_surface )  .AND.  kk == 1 ) &
+                         READ ( 13 )  surf_v(1)%pt_surface
                    CASE ( 'surf_v(1)%shf' )         
                       IF ( ALLOCATED( surf_v(1)%shf )  .AND.  kk == 1 )        &
@@ -3385,4 +3417,7 @@
                       IF ( ALLOCATED( surf_v(2)%rib )  .AND.  kk == 1 )        &
                          READ ( 13 )  surf_v(2)%rib
+                   CASE ( 'surf_v(2)%pt_surface' )         
+                      IF ( ALLOCATED( surf_v(2)%pt_surface )  .AND.  kk == 1 ) &
+                         READ ( 13 )  surf_v(2)%pt_surface
                    CASE ( 'surf_v(2)%shf' )         
                       IF ( ALLOCATED( surf_v(2)%shf )  .AND.  kk == 1 )        &
@@ -3464,4 +3499,7 @@
                       IF ( ALLOCATED( surf_v(3)%rib )  .AND.  kk == 1 )        &
                          READ ( 13 )  surf_v(3)%rib
+                   CASE ( 'surf_v(3)%pt_surface' )         
+                      IF ( ALLOCATED( surf_v(3)%pt_surface )  .AND.  kk == 1 ) &
+                         READ ( 13 )  surf_v(3)%pt_surface
                    CASE ( 'surf_v(3)%shf' )         
                       IF ( ALLOCATED( surf_v(3)%shf )  .AND.  kk == 1 )        &
@@ -3646,4 +3684,10 @@
              ENDIF
 
+             IF ( INDEX( TRIM( field_chr ), '%pt_surface' ) /= 0 )  THEN 
+                IF ( ALLOCATED( surf_target%pt_surface )  .AND.                &
+                     ALLOCATED( surf_file%pt_surface   ) )                     & 
+                   surf_target%pt_surface(m_target) = surf_file%pt_surface(m_file)
+             ENDIF
+
              IF ( INDEX( TRIM( field_chr ), '%usws' ) /= 0 )  THEN 
                 IF ( ALLOCATED( surf_target%usws )  .AND.                      &
