Index: palm/trunk/SOURCE/radiation_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/radiation_model_mod.f90	(revision 2156)
+++ palm/trunk/SOURCE/radiation_model_mod.f90	(revision 2157)
@@ -20,5 +20,5 @@
 ! Current revisions:
 ! -----------------
-! 
+! Bugfix in read_restart data
 ! 
 ! Former revisions:
@@ -3399,4 +3399,8 @@
           tmp_3d   !< 
 
+    REAL(wp),                                                                  &
+       DIMENSION(0:0,nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp) ::&
+          tmp_3d2   !< 
+
 
 
@@ -3437,33 +3441,89 @@
                 CASE ( 'rad_lw_in' )
                    IF ( .NOT. ALLOCATED( rad_lw_in ) )  THEN
-                      ALLOCATE( rad_lw_in(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+                      IF ( radiation_scheme == 'clear-sky'  .OR.               &
+                           radiation_scheme == 'constant')  THEN
+                         ALLOCATE( rad_lw_in(0:0,nysg:nyng,nxlg:nxrg) )
+                      ELSE
+                         ALLOCATE( rad_lw_in(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+                      ENDIF
                    ENDIF  
-                   IF ( k == 1 )  READ ( 13 )  tmp_3d
-                   rad_lw_in(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &
+                   IF ( k == 1 )  THEN
+                      IF ( radiation_scheme == 'clear-sky'  .OR.               &
+                           radiation_scheme == 'constant')  THEN
+                         READ ( 13 )  tmp_2d
+                         rad_lw_in(0:0,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =&
+                             tmp_3d2(0:0,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
+                      ELSE
+                         READ ( 13 )  tmp_3d
+                         rad_lw_in(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =&
                              tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
+                      ENDIF
+                   ENDIF
 
                 CASE ( 'rad_lw_in_av' )
                    IF ( .NOT. ALLOCATED( rad_lw_in_av ) )  THEN
-                      ALLOCATE( rad_lw_in_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+                      IF ( radiation_scheme == 'clear-sky'  .OR.               &
+                           radiation_scheme == 'constant')  THEN
+                         ALLOCATE( rad_lw_in_av(0:0,nysg:nyng,nxlg:nxrg) )
+                      ELSE
+                         ALLOCATE( rad_lw_in_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+                      ENDIF
                    ENDIF  
-                   IF ( k == 1 )  READ ( 13 )  tmp_3d
-                   rad_lw_in_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &
+                   IF ( k == 1 )  THEN
+                      IF ( radiation_scheme == 'clear-sky'  .OR.               &
+                           radiation_scheme == 'constant')  THEN
+                         READ ( 13 )  tmp_2d
+                         rad_lw_in_av(0:0,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =&
+                             tmp_3d2(0:0,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
+                      ELSE
+                         READ ( 13 )  tmp_3d
+                         rad_lw_in_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =&
                              tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
+                      ENDIF
+                   ENDIF
 
                 CASE ( 'rad_lw_out' )
                    IF ( .NOT. ALLOCATED( rad_lw_out ) )  THEN
-                      ALLOCATE( rad_lw_out(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+                      IF ( radiation_scheme == 'clear-sky'  .OR.               &
+                           radiation_scheme == 'constant')  THEN
+                         ALLOCATE( rad_lw_out(0:0,nysg:nyng,nxlg:nxrg) )
+                      ELSE
+                         ALLOCATE( rad_lw_out(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+                      ENDIF
                    ENDIF  
-                   IF ( k == 1 )  READ ( 13 )  tmp_3d
-                   rad_lw_out(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &
+                   IF ( k == 1 )  THEN
+                      IF ( radiation_scheme == 'clear-sky'  .OR.               &
+                           radiation_scheme == 'constant')  THEN
+                         READ ( 13 )  tmp_2d
+                         rad_lw_out(0:0,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =&
+                             tmp_3d2(0:0,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
+                      ELSE
+                         READ ( 13 )  tmp_3d
+                         rad_lw_out(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =&
                              tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
+                      ENDIF
+                   ENDIF
 
                 CASE ( 'rad_lw_out_av' )
                    IF ( .NOT. ALLOCATED( rad_lw_out_av ) )  THEN
-                      ALLOCATE( rad_lw_out_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+                      IF ( radiation_scheme == 'clear-sky'  .OR.               &
+                           radiation_scheme == 'constant')  THEN
+                         ALLOCATE( rad_lw_out_av(0:0,nysg:nyng,nxlg:nxrg) )
+                      ELSE
+                         ALLOCATE( rad_lw_out_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+                      ENDIF
                    ENDIF  
-                   IF ( k == 1 )  READ ( 13 )  tmp_3d
-                   rad_lw_out_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &
+                   IF ( k == 1 )  THEN
+                      IF ( radiation_scheme == 'clear-sky'  .OR.               &
+                           radiation_scheme == 'constant')  THEN
+                         READ ( 13 )  tmp_2d
+                         rad_lw_out_av(0:0,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =&
+                             tmp_3d2(0:0,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
+                      ELSE
+                         READ ( 13 )  tmp_3d
+                         rad_lw_out_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =&
                              tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
+                      ENDIF
+                   ENDIF
 
                 CASE ( 'rad_lw_out_change_0' )
@@ -3509,33 +3569,89 @@
                 CASE ( 'rad_sw_in' )
                    IF ( .NOT. ALLOCATED( rad_sw_in ) )  THEN
-                      ALLOCATE( rad_sw_in(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+                      IF ( radiation_scheme == 'clear-sky'  .OR.               &
+                           radiation_scheme == 'constant')  THEN
+                         ALLOCATE( rad_sw_in(0:0,nysg:nyng,nxlg:nxrg) )
+                      ELSE
+                         ALLOCATE( rad_sw_in(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+                      ENDIF
                    ENDIF  
-                   IF ( k == 1 )  READ ( 13 )  tmp_3d
-                   rad_sw_in(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &
+                   IF ( k == 1 )  THEN
+                      IF ( radiation_scheme == 'clear-sky'  .OR.               &
+                           radiation_scheme == 'constant')  THEN
+                         READ ( 13 )  tmp_2d
+                         rad_sw_in(0:0,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =&
+                             tmp_3d2(0:0,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
+                      ELSE
+                         READ ( 13 )  tmp_3d
+                         rad_sw_in(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =&
                              tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
+                      ENDIF
+                   ENDIF
 
                 CASE ( 'rad_sw_in_av' )
                    IF ( .NOT. ALLOCATED( rad_sw_in_av ) )  THEN
-                      ALLOCATE( rad_sw_in_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+                      IF ( radiation_scheme == 'clear-sky'  .OR.               &
+                           radiation_scheme == 'constant')  THEN
+                         ALLOCATE( rad_sw_in_av(0:0,nysg:nyng,nxlg:nxrg) )
+                      ELSE
+                         ALLOCATE( rad_sw_in_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+                      ENDIF
                    ENDIF  
-                   IF ( k == 1 )  READ ( 13 )  tmp_3d
-                   rad_sw_in_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &
+                   IF ( k == 1 )  THEN
+                      IF ( radiation_scheme == 'clear-sky'  .OR.               &
+                           radiation_scheme == 'constant')  THEN
+                         READ ( 13 )  tmp_2d
+                         rad_sw_in_av(0:0,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =&
+                             tmp_3d2(0:0,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
+                      ELSE
+                         READ ( 13 )  tmp_3d
+                         rad_sw_in_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =&
                              tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
+                      ENDIF
+                   ENDIF
 
                 CASE ( 'rad_sw_out' )
                    IF ( .NOT. ALLOCATED( rad_sw_out ) )  THEN
-                      ALLOCATE( rad_sw_out(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+                      IF ( radiation_scheme == 'clear-sky'  .OR.               &
+                           radiation_scheme == 'constant')  THEN
+                         ALLOCATE( rad_sw_out(0:0,nysg:nyng,nxlg:nxrg) )
+                      ELSE
+                         ALLOCATE( rad_sw_out(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+                      ENDIF
                    ENDIF  
-                   IF ( k == 1 )  READ ( 13 )  tmp_3d
-                   rad_sw_out(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &
+                   IF ( k == 1 )  THEN
+                      IF ( radiation_scheme == 'clear-sky'  .OR.               &
+                           radiation_scheme == 'constant')  THEN
+                         READ ( 13 )  tmp_2d
+                         rad_sw_out(0:0,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =&
+                             tmp_3d2(0:0,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
+                      ELSE
+                         READ ( 13 )  tmp_3d
+                         rad_sw_out(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =&
                              tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
+                      ENDIF
+                   ENDIF
 
                 CASE ( 'rad_sw_out_av' )
                    IF ( .NOT. ALLOCATED( rad_sw_out_av ) )  THEN
-                      ALLOCATE( rad_sw_out_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+                      IF ( radiation_scheme == 'clear-sky'  .OR.               &
+                           radiation_scheme == 'constant')  THEN
+                         ALLOCATE( rad_sw_out_av(0:0,nysg:nyng,nxlg:nxrg) )
+                      ELSE
+                         ALLOCATE( rad_sw_out_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+                      ENDIF
                    ENDIF  
-                   IF ( k == 1 )  READ ( 13 )  tmp_3d
-                   rad_sw_out_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) = &
+                   IF ( k == 1 )  THEN
+                      IF ( radiation_scheme == 'clear-sky'  .OR.               &
+                           radiation_scheme == 'constant')  THEN
+                         READ ( 13 )  tmp_2d
+                         rad_sw_out_av(0:0,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =&
+                             tmp_3d2(0:0,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
+                      ELSE
+                         READ ( 13 )  tmp_3d
+                         rad_sw_out_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =&
                              tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
+                      ENDIF
+                   ENDIF
 
                 CASE ( 'rad_sw_cs_hr' )
