Index: /palm/trunk/SOURCE/Makefile
===================================================================
--- /palm/trunk/SOURCE/Makefile	(revision 2962)
+++ /palm/trunk/SOURCE/Makefile	(revision 2963)
@@ -25,4 +25,8 @@
 # -----------------
 # $Id$
+# Introduce index for vegetation/wall, pavement/green-wall and water/window 
+# surfaces, for clearer access of surface fraction, albedo, emissivity, etc. .
+# 
+# 2955 2018-04-09 15:14:01Z suehring
 # Add log-points to measure CPU time of NetCDF data input.
 # 
@@ -1174,5 +1178,6 @@
 	cpulog_mod.o \
 	mod_kinds.o \
-	modules.o
+	modules.o   \
+	surface_mod.o
 netcdf_interface_mod.o: \
 	chemistry_model_mod.o \
Index: /palm/trunk/SOURCE/data_output_2d.f90
===================================================================
--- /palm/trunk/SOURCE/data_output_2d.f90	(revision 2962)
+++ /palm/trunk/SOURCE/data_output_2d.f90	(revision 2963)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Introduce index for vegetation/wall, pavement/green-wall and water/window 
+! surfaces, for clearer access of surface fraction, albedo, emissivity, etc. .
+! 
+! 2817 2018-02-19 16:32:21Z knoop
 ! Preliminary gust module interface implemented
 ! 
@@ -263,5 +267,6 @@
 
     USE surface_mod,                                                           &
-        ONLY:  surf_def_h, surf_lsm_h, surf_usm_h
+        ONLY:  ind_pav_green, ind_veg_wall, ind_wat_win, surf_def_h,           &
+               surf_lsm_h, surf_usm_h
 
     USE turbulence_closure_mod,                                                &
@@ -568,9 +573,9 @@
                       i                   = surf_usm_h%i(m)            
                       j                   = surf_usm_h%j(m)
-                      local_pf(i,j,nzb+1) = surf_usm_h%frac(0,m)     *          &
+                      local_pf(i,j,nzb+1) = surf_usm_h%frac(ind_veg_wall,m)  *  &
                                             surf_usm_h%wghf_eb(m)        +      &
-                                            surf_usm_h%frac(1,m)     *          &
+                                            surf_usm_h%frac(ind_pav_green,m) *  &
                                             surf_usm_h%wghf_eb_green(m)  +      &
-                                            surf_usm_h%frac(2,m)     *          &
+                                            surf_usm_h%frac(ind_wat_win,m)   *  &
                                             surf_usm_h%wghf_eb_window(m)
                    ENDDO
@@ -915,7 +920,10 @@
                       j   = surf_usm_h%j(m)
                       local_pf(i,j,nzb+1) =                                          &
-                                 ( surf_usm_h%frac(0,m) * surf_usm_h%r_a(m)       +  & 
-                                   surf_usm_h%frac(1,m) * surf_usm_h%r_a_green(m) +  & 
-                                   surf_usm_h%frac(2,m) * surf_usm_h%r_a_window(m) )
+                                 ( surf_usm_h%frac(ind_veg_wall,m)  *                &
+                                   surf_usm_h%r_a(m)       +                         & 
+                                   surf_usm_h%frac(ind_pav_green,m) *                &
+                                   surf_usm_h%r_a_green(m) +                         & 
+                                   surf_usm_h%frac(ind_wat_win,m)   *                &
+                                   surf_usm_h%r_a_window(m) )
                    ENDDO
                 ELSE
Index: /palm/trunk/SOURCE/land_surface_model_mod.f90
===================================================================
--- /palm/trunk/SOURCE/land_surface_model_mod.f90	(revision 2962)
+++ /palm/trunk/SOURCE/land_surface_model_mod.f90	(revision 2963)
@@ -25,4 +25,10 @@
 ! -----------------
 ! $Id$
+! - In initialization of surface types, consider the case that surface_fractions
+!   is not given in static input file.
+! - Introduce index for vegetation/wall, pavement/green-wall and water/window 
+!   surfaces, for clearer access of surface fraction, albedo, emissivity, etc. .
+! 
+! 2938 2018-03-27 15:52:42Z suehring
 ! Initialization of soil moisture and temperature via Inifor-provided data also
 ! in nested child domains, even if no dynamic input file is available for 
@@ -416,5 +422,6 @@
 
     USE surface_mod,                                                           &
-        ONLY :  surf_lsm_h, surf_lsm_v, surf_type, surface_restore_elements
+        ONLY :  ind_pav_green, ind_veg_wall, ind_wat_win, surf_lsm_h,          &
+                surf_lsm_v, surf_type, surface_restore_elements
 
     IMPLICIT NONE
@@ -711,10 +718,5 @@
                                    'pond        ',                   & ! 4
                                    'fountain    '                    & ! 5
-                                                                  /)                                                                  
-!
-!-- IDs for vegetation, pavement and water surfaces
-    INTEGER(iwp) ::  ind_veg = 0    !< index for vegetation surfaces, used to assess surface-fraction, albedo, etc.      
-    INTEGER(iwp) ::  ind_pav = 1    !< index for pavement surfaces, used to assess surface-fraction, albedo, etc.        
-    INTEGER(iwp) ::  ind_wat = 2    !< index for vegetation surfaces, used to assess surface-fraction, albedo, etc.                          
+                                                                  /)                                                                                  
                     
 !
@@ -2560,8 +2562,8 @@
          
              surf_lsm_h%vegetation_surface = .TRUE.
-             surf_lsm_h%frac(ind_veg,:) = 1.0_wp
+             surf_lsm_h%frac(ind_veg_wall,:) = 1.0_wp
              DO  l = 0, 3
                 surf_lsm_v(l)%vegetation_surface = .TRUE.
-                surf_lsm_v(l)%frac(ind_veg,:) = 1.0_wp
+                surf_lsm_v(l)%frac(ind_veg_wall,:) = 1.0_wp
              ENDDO
    
@@ -2569,10 +2571,10 @@
              
              surf_lsm_h%water_surface = .TRUE.
-             surf_lsm_h%frac(ind_wat,:) = 1.0_wp
+             surf_lsm_h%frac(ind_wat_win,:) = 1.0_wp
 !
 !--          Note, vertical water surface does not really make sense.
              DO  l = 0, 3  
                 surf_lsm_v(l)%water_surface   = .TRUE.
-                surf_lsm_v(l)%frac(ind_wat,:) = 1.0_wp
+                surf_lsm_v(l)%frac(ind_wat_win,:) = 1.0_wp
              ENDDO
 
@@ -2580,8 +2582,8 @@
              
              surf_lsm_h%pavement_surface = .TRUE.
-                surf_lsm_h%frac(ind_pav,:) = 1.0_wp
+                surf_lsm_h%frac(ind_pav_green,:) = 1.0_wp
              DO  l = 0, 3
                 surf_lsm_v(l)%pavement_surface   = .TRUE.
-                surf_lsm_v(l)%frac(ind_pav,:) = 1.0_wp
+                surf_lsm_v(l)%frac(ind_pav_green,:) = 1.0_wp
              ENDDO
 
@@ -2631,6 +2633,9 @@
 !--    In case of netcdf input file, further initialize surface fractions. 
 !--    At the moment only 1 surface is given at a location, so that the fraction
-!--    is either 0 or 1. This will be revised later. 
-       IF ( input_pids_static )  THEN
+!--    is either 0 or 1. This will be revised later. If surface fraction 
+!--    is not given in static input file, relative fractions will be derived
+!--    from given surface type. In this case, only 1 type is given at a certain
+!--    location (already checked).  
+       IF ( input_pids_static  .AND.  surface_fraction_f%from_file )  THEN
           DO  m = 1, surf_lsm_h%ns
              i = surf_lsm_h%i(m)
@@ -2638,7 +2643,10 @@
 !
 !--          0 - vegetation fraction, 1 - pavement fraction, 2 - water fraction             
-             surf_lsm_h%frac(ind_veg,m) = surface_fraction_f%frac(ind_veg,j,i)         
-             surf_lsm_h%frac(ind_pav,m) = surface_fraction_f%frac(ind_pav,j,i)        
-             surf_lsm_h%frac(ind_wat,m) = surface_fraction_f%frac(ind_wat,j,i)
+             surf_lsm_h%frac(ind_veg_wall,m)  =                                &
+                                    surface_fraction_f%frac(ind_veg_wall,j,i)         
+             surf_lsm_h%frac(ind_pav_green,m) =                                &
+                                    surface_fraction_f%frac(ind_pav_green,j,i)        
+             surf_lsm_h%frac(ind_wat_win,m)   =                                &
+                                    surface_fraction_f%frac(ind_wat_win,j,i)
 
           ENDDO
@@ -2651,8 +2659,39 @@
 !
 !--             0 - vegetation fraction, 1 - pavement fraction, 2 - water fraction        
-                surf_lsm_v(l)%frac(ind_veg,m) = surface_fraction_f%frac(ind_veg,j,i)         
-                surf_lsm_v(l)%frac(ind_pav,m) = surface_fraction_f%frac(ind_pav,j,i)        
-                surf_lsm_v(l)%frac(ind_wat,m) = surface_fraction_f%frac(ind_wat,j,i)
-
+                surf_lsm_v(l)%frac(ind_veg_wall,m)  =                          &
+                                    surface_fraction_f%frac(ind_veg_wall,j,i)         
+                surf_lsm_v(l)%frac(ind_pav_green,m) =                          &
+                                    surface_fraction_f%frac(ind_pav_green,j,i)        
+                surf_lsm_v(l)%frac(ind_wat_win,m)   =                          &
+                                    surface_fraction_f%frac(ind_wat_win,j,i)
+
+             ENDDO
+          ENDDO
+       ELSEIF ( input_pids_static  .AND.  .NOT. surface_fraction_f%from_file ) &
+       THEN
+          DO  m = 1, surf_lsm_h%ns
+             i = surf_lsm_h%i(m)
+             j = surf_lsm_h%j(m)
+
+             IF ( vegetation_type_f%var(j,i) /= vegetation_type_f%fill )       &        
+                surf_lsm_h%frac(ind_veg_wall,m)  = 1.0_wp
+             IF ( pavement_type_f%var(j,i)   /= pavement_type_f%fill   )       &        
+                surf_lsm_h%frac(ind_pav_green,m) = 1.0_wp 
+             IF ( water_type_f%var(j,i)      /= water_type_f%fill      )       &        
+                surf_lsm_h%frac(ind_wat_win,m)   = 1.0_wp       
+          ENDDO
+          DO  l = 0, 3
+             DO  m = 1, surf_lsm_v(l)%ns
+                i = surf_lsm_v(l)%i(m) + MERGE( 0, surf_lsm_v(l)%ioff,         &
+                                                surf_lsm_v(l)%building_covered(m) ) 
+                j = surf_lsm_v(l)%j(m) + MERGE( 0, surf_lsm_v(l)%joff,         &
+                                                surf_lsm_v(l)%building_covered(m) ) 
+     
+                IF ( vegetation_type_f%var(j,i) /= vegetation_type_f%fill )    &        
+                   surf_lsm_v(l)%frac(ind_veg_wall,m)  = 1.0_wp
+                IF ( pavement_type_f%var(j,i)   /= pavement_type_f%fill   )    &        
+                   surf_lsm_v(l)%frac(ind_pav_green,m) = 1.0_wp 
+                IF ( water_type_f%var(j,i)      /= water_type_f%fill      )    &        
+                   surf_lsm_v(l)%frac(ind_wat_win,m)   = 1.0_wp     
              ENDDO
           ENDDO
@@ -3016,6 +3055,6 @@
              surf_lsm_h%f_sw_in(m)          = f_shortwave_incoming
              surf_lsm_h%c_surface(m)        = c_surface
-             surf_lsm_h%albedo_type(ind_veg,m) = albedo_type
-             surf_lsm_h%emissivity(ind_veg,m)  = emissivity
+             surf_lsm_h%albedo_type(ind_veg_wall,m) = albedo_type
+             surf_lsm_h%emissivity(ind_veg_wall,m)  = emissivity
           ELSE
              surf_lsm_h%lai(m)   = 0.0_wp
@@ -3042,6 +3081,6 @@
                 surf_lsm_v(l)%f_sw_in(m)          = f_shortwave_incoming
                 surf_lsm_v(l)%c_surface(m)        = c_surface
-                surf_lsm_v(l)%albedo_type(ind_veg,m) = albedo_type
-                surf_lsm_v(l)%emissivity(ind_veg,m)  = emissivity
+                surf_lsm_v(l)%albedo_type(ind_veg_wall,m) = albedo_type
+                surf_lsm_v(l)%emissivity(ind_veg_wall,m)  = emissivity
              ELSE
                 surf_lsm_v(l)%lai(m)   = 0.0_wp
@@ -3077,6 +3116,6 @@
                 surf_lsm_h%f_sw_in(m)          = vegetation_pars(ind_v_f_sw_in,st)
                 surf_lsm_h%c_surface(m)        = vegetation_pars(ind_v_c_surf,st)
-                surf_lsm_h%albedo_type(ind_veg,m) = INT( vegetation_pars(ind_v_at,st) )
-                surf_lsm_h%emissivity(ind_veg,m)  = vegetation_pars(ind_v_emis,st)
+                surf_lsm_h%albedo_type(ind_veg_wall,m) = INT( vegetation_pars(ind_v_at,st) )
+                surf_lsm_h%emissivity(ind_veg_wall,m)  = vegetation_pars(ind_v_emis,st)
              ENDIF
           ENDDO
@@ -3103,6 +3142,6 @@
                    surf_lsm_v(l)%f_sw_in(m)          = vegetation_pars(ind_v_f_sw_in,st)
                    surf_lsm_v(l)%c_surface(m)        = vegetation_pars(ind_v_c_surf,st)
-                   surf_lsm_v(l)%albedo_type(ind_veg,m) = INT( vegetation_pars(ind_v_at,st) )
-                   surf_lsm_v(l)%emissivity(ind_veg,m)  = vegetation_pars(ind_v_emis,st)
+                   surf_lsm_v(l)%albedo_type(ind_veg_wall,m) = INT( vegetation_pars(ind_v_at,st) )
+                   surf_lsm_v(l)%emissivity(ind_veg_wall,m)  = vegetation_pars(ind_v_emis,st)
                 ENDIF
              ENDDO
@@ -3179,9 +3218,9 @@
                 IF ( vegetation_pars_f%pars_xy(ind_v_at,j,i) /=                &
                      vegetation_pars_f%fill )                                  &
-                   surf_lsm_h%albedo_type(ind_veg,m) =                         &
+                   surf_lsm_h%albedo_type(ind_veg_wall,m) =                    &
                                    INT( vegetation_pars_f%pars_xy(ind_v_at,j,i) )
                 IF ( vegetation_pars_f%pars_xy(ind_v_emis,j,i) /=              &
                      vegetation_pars_f%fill )                                  &
-                   surf_lsm_h%emissivity(ind_veg,m)  =                         &
+                   surf_lsm_h%emissivity(ind_veg_wall,m)  =                    &
                                    vegetation_pars_f%pars_xy(ind_v_emis,j,i)
              ENDIF
@@ -3255,9 +3294,9 @@
                    IF ( vegetation_pars_f%pars_xy(ind_v_at,j,i) /=             &
                         vegetation_pars_f%fill )                               &
-                      surf_lsm_v(l)%albedo_type(ind_veg,m) =                   &
+                      surf_lsm_v(l)%albedo_type(ind_veg_wall,m) =              &
                                    INT( vegetation_pars_f%pars_xy(ind_v_at,j,i) )
                    IF ( vegetation_pars_f%pars_xy(ind_v_emis,j,i) /=           &
                         vegetation_pars_f%fill )                               &
-                      surf_lsm_v(l)%emissivity(ind_veg,m)  =                   &
+                      surf_lsm_v(l)%emissivity(ind_veg_wall,m)  =              &
                                    vegetation_pars_f%pars_xy(ind_v_emis,j,i)
                 ENDIF
@@ -3305,6 +3344,6 @@
              surf_lsm_h%lambda_surface_u(m) = 1.0E10_wp               
              surf_lsm_h%c_surface(m)        = 0.0_wp
-             surf_lsm_h%albedo_type(ind_wat,m) = albedo_type
-             surf_lsm_h%emissivity(ind_wat,m)  = emissivity
+             surf_lsm_h%albedo_type(ind_wat_win,m) = albedo_type
+             surf_lsm_h%emissivity(ind_wat_win,m)  = emissivity
           ENDIF
        ENDDO
@@ -3323,6 +3362,6 @@
                 surf_lsm_v(l)%lambda_surface_u(m) = 1.0E10_wp               
                 surf_lsm_v(l)%c_surface(m)        = 0.0_wp
-                surf_lsm_v(l)%albedo_type(ind_wat,m) = albedo_type
-                surf_lsm_v(l)%emissivity(ind_wat,m)  = emissivity
+                surf_lsm_v(l)%albedo_type(ind_wat_win,m) = albedo_type
+                surf_lsm_v(l)%emissivity(ind_wat_win,m)  = emissivity
              ENDIF 
           ENDDO
@@ -3353,6 +3392,6 @@
                 surf_lsm_h%lambda_surface_u(m) = water_pars(ind_w_lambda_u,st)              
                 surf_lsm_h%c_surface(m)        = 0.0_wp
-                surf_lsm_h%albedo_type(ind_wat,m) = INT( water_pars(ind_w_at,st) )
-                surf_lsm_h%emissivity(ind_wat,m)  = water_pars(ind_w_emis,st)
+                surf_lsm_h%albedo_type(ind_wat_win,m) = INT( water_pars(ind_w_at,st) )
+                surf_lsm_h%emissivity(ind_wat_win,m)  = water_pars(ind_w_emis,st)
              ENDIF
           ENDDO
@@ -3378,7 +3417,7 @@
                                                    water_pars(ind_w_lambda_u,st)           
                    surf_lsm_v(l)%c_surface(m)     = 0.0_wp
-                   surf_lsm_v(l)%albedo_type(ind_wat,m) =                      &
+                   surf_lsm_v(l)%albedo_type(ind_wat_win,m) =                  &
                                                   INT( water_pars(ind_w_at,st) )
-                   surf_lsm_v(l)%emissivity(ind_wat,m)  =                      &
+                   surf_lsm_v(l)%emissivity(ind_wat_win,m)  =                  &
                                                   water_pars(ind_w_emis,st)
                 ENDIF
@@ -3434,10 +3473,10 @@
                 IF ( water_pars_f%pars_xy(ind_w_at,j,i) /=                     &
                      water_pars_f%fill )                                       &
-                   surf_lsm_h%albedo_type(ind_wat,m) =                         &
+                   surf_lsm_h%albedo_type(ind_wat_win,m) =                     &
                                        INT( water_pars_f%pars_xy(ind_w_at,j,i) )
 
                 IF ( water_pars_f%pars_xy(ind_w_emis,j,i) /=                   &
                      water_pars_f%fill )                                       &
-                   surf_lsm_h%emissivity(ind_wat,m) =                          &
+                   surf_lsm_h%emissivity(ind_wat_win,m) =                      &
                    water_pars_f%pars_xy(ind_w_emis,j,i)  
              ENDIF
@@ -3494,10 +3533,10 @@
                    IF ( water_pars_f%pars_xy(ind_w_at,j,i) /=                  &
                         water_pars_f%fill )                                    &
-                      surf_lsm_v(l)%albedo_type(ind_wat,m)    =                &
+                      surf_lsm_v(l)%albedo_type(ind_wat_win,m) =               &
                                       INT( water_pars_f%pars_xy(ind_w_at,j,i) )
 
                    IF ( water_pars_f%pars_xy(ind_w_emis,j,i) /=                &
                         water_pars_f%fill )                                    &
-                      surf_lsm_v(l)%emissivity(ind_wat,m)     =                &
+                      surf_lsm_v(l)%emissivity(ind_wat_win,m)  =               &
                                       water_pars_f%pars_xy(ind_w_emis,j,i)  
                 ENDIF
@@ -3576,6 +3615,6 @@
                                                         * 0.25_wp                                   
 
-             surf_lsm_h%albedo_type(ind_pav,m) = albedo_type
-             surf_lsm_h%emissivity(ind_pav,m)  = emissivity      
+             surf_lsm_h%albedo_type(ind_pav_green,m) = albedo_type
+             surf_lsm_h%emissivity(ind_pav_green,m)  = emissivity      
       
              IF ( pavement_type /= 0 )  THEN
@@ -3611,6 +3650,6 @@
                                                         * 0.25_wp                                      
 
-                surf_lsm_v(l)%albedo_type(ind_pav,m) = albedo_type
-                surf_lsm_v(l)%emissivity(ind_pav,m)  = emissivity
+                surf_lsm_v(l)%albedo_type(ind_pav_green,m) = albedo_type
+                surf_lsm_v(l)%emissivity(ind_pav_green,m)  = emissivity
 
                 IF ( pavement_type /= 0 )  THEN
@@ -3668,6 +3707,6 @@
                                                         * dz_soil(nzb_soil)    &
                                                         * 0.25_wp                               
-                surf_lsm_h%albedo_type(ind_pav,m) = INT( pavement_pars(ind_p_at,st) )
-                surf_lsm_h%emissivity(ind_pav,m)  = pavement_pars(ind_p_emis,st)  
+                surf_lsm_h%albedo_type(ind_pav_green,m) = INT( pavement_pars(ind_p_at,st) )
+                surf_lsm_h%emissivity(ind_pav_green,m)  = pavement_pars(ind_p_emis,st)  
 
                 DO  k = nzb_soil, surf_lsm_h%nzt_pavement(m)
@@ -3718,13 +3757,13 @@
                                                         * dz_soil(nzb_soil)    &
                                                         * 0.25_wp                                    
-                   surf_lsm_v(l)%albedo_type(ind_pav,m) =                      &
+                   surf_lsm_v(l)%albedo_type(ind_pav_green,m) =                &
                                               INT( pavement_pars(ind_p_at,st) )
-                   surf_lsm_v(l)%emissivity(ind_pav,m)  =                      &
+                   surf_lsm_v(l)%emissivity(ind_pav_green,m)  =                &
                                               pavement_pars(ind_p_emis,st)    
 
                    DO  k = nzb_soil, surf_lsm_h%nzt_pavement(m)
-                      surf_lsm_v(l)%lambda_h_def(k,m)    =                    &
+                      surf_lsm_v(l)%lambda_h_def(k,m)    =                     &
                                     pavement_subsurface_pars_1(k,pavement_type)                       
-                      surf_lsm_v(l)%rho_c_total_def(k,m) =                    &
+                      surf_lsm_v(l)%rho_c_total_def(k,m) =                     &
                                     pavement_subsurface_pars_2(k,pavement_type) 
                    ENDDO   
@@ -3784,9 +3823,9 @@
                 IF ( pavement_pars_f%pars_xy(ind_p_at,j,i) /=                  &
                      pavement_pars_f%fill )                                    &
-                   surf_lsm_h%albedo_type(ind_pav,m) =                         &
+                   surf_lsm_h%albedo_type(ind_pav_green,m) =                   &
                                               INT( pavement_pars(ind_p_at,st) )
                 IF ( pavement_pars_f%pars_xy(ind_p_emis,j,i) /=                &
                      pavement_pars_f%fill )                                    &
-                   surf_lsm_h%emissivity(ind_pav,m)  =                         &
+                   surf_lsm_h%emissivity(ind_pav_green,m)  =                   &
                                               pavement_pars(ind_p_emis,st) 
              ENDIF 
@@ -3844,10 +3883,10 @@
                    IF ( pavement_pars_f%pars_xy(ind_p_at,j,i) /=               &
                         pavement_pars_f%fill )                                 &
-                      surf_lsm_v(l)%albedo_type(ind_pav,m) =                   &
+                      surf_lsm_v(l)%albedo_type(ind_pav_green,m) =             &
                                             INT( pavement_pars(ind_p_at,st) )
 
                    IF ( pavement_pars_f%pars_xy(ind_p_emis,j,i) /=             &
                         pavement_pars_f%fill )                                 &
-                      surf_lsm_v(l)%emissivity(ind_pav,m)  =                   &
+                      surf_lsm_v(l)%emissivity(ind_pav_green,m)  =             &
                                             pavement_pars(ind_p_emis,st)  
                 ENDIF 
Index: /palm/trunk/SOURCE/netcdf_data_input_mod.f90
===================================================================
--- /palm/trunk/SOURCE/netcdf_data_input_mod.f90	(revision 2962)
+++ /palm/trunk/SOURCE/netcdf_data_input_mod.f90	(revision 2963)
@@ -25,4 +25,9 @@
 ! -----------------
 ! $Id$
+! - Revise checks for static input variables.
+! - Introduce index for vegetation/wall, pavement/green-wall and water/window 
+!   surfaces, for clearer access of surface fraction, albedo, emissivity, etc. .
+! 
+! 2958 2018-04-11 15:38:13Z suehring
 ! Synchronize longitude and latitude between nested model domains, values are
 ! taken from the root model.
@@ -126,4 +131,7 @@
 
     USE pegrid
+
+    USE surface_mod,                                                           &
+        ONLY:  ind_pav_green, ind_veg_wall, ind_wat_win
 !
 !-- Define type for dimensions. 
@@ -2980,4 +2988,5 @@
 !--    More advanced methods, e.g. a nearest neighbor algorithm as used in GIS
 !--    systems might be implemented later. 
+!--    Please note, if no terrain height is provided, it is set to 0. 
        IF ( ANY( terrain_height_f%var == terrain_height_f%fill ) )  THEN
           message_string = 'NetCDF variable orography_2D is not ' //           &
@@ -3012,14 +3021,15 @@
 !--    Check for minimum requirement of surface-classification data in case
 !--    static input file is used.
-       IF ( .NOT. vegetation_type_f%from_file  .OR.                            &
-            .NOT. pavement_type_f%from_file    .OR.                            &
-            .NOT. building_type_f%from_file    .OR.                            &
-            .NOT. water_type_f%from_file       .OR.                            &
-            .NOT. soil_type_f%from_file             )  THEN
+       IF ( ( .NOT. vegetation_type_f%from_file  .OR.                          &
+              .NOT. pavement_type_f%from_file    .OR.                          &
+              .NOT. water_type_f%from_file       .OR.                          &
+              .NOT. soil_type_f%from_file             ) .OR.                   &
+             ( urban_surface  .AND.  .NOT. building_type_f%from_file ) )  THEN
           message_string = 'Minimum requirement for surface classification ' //&
                            'is not fulfilled. At least ' //                    &
                            'vegetation_type, pavement_type, ' //               &
-                           'building_type, soil_type and water_type are '//    &
-                           'required.'
+                           'soil_type and water_type are '//                   &
+                           'required. If urban-surface model is applied, ' //  &
+                           'also building_type ist required' 
           CALL message( 'netcdf_data_input_mod', 'NDI016', 1, 2, 0, 6, 0 )
        ENDIF
@@ -3129,8 +3139,8 @@
                   building_type_f%var(j,i)   == building_type_f%fill    .AND.  &
                   water_type_f%var(j,i)      == water_type_f%fill )  THEN
-                message_string = 'At least one of the paramters '       //     &
+                WRITE( message_string, * ) 'At least one of the parameters '// &
                                  'vegetation_type, pavement_type, '     //     &
                                  'building_type, or water_type must be set '// &
-                                 'to a non-missing value'
+                                 'to a non-missing value. Grid point: ', j, i
                 CALL message( 'netcdf_data_input_mod', 'NDI025', 2, 2, 0, 6, 0 )
              ENDIF
@@ -3188,14 +3198,17 @@
 !--          surface vegetation fraction is zero. 
              IF ( ( vegetation_type_f%var(j,i) /= vegetation_type_f%fill  .AND.&
-                 ( surface_fraction_f%frac(0,j,i) == 0.0_wp .OR.               &
-                   surface_fraction_f%frac(0,j,i) == surface_fraction_f%fill ) &
+                 ( surface_fraction_f%frac(ind_veg_wall,j,i) == 0.0_wp .OR.    &
+                   surface_fraction_f%frac(ind_veg_wall,j,i) ==                &
+                                                     surface_fraction_f%fill ) &
                   )  .OR.                                                      &
                   ( pavement_type_f%var(j,i) /= pavement_type_f%fill     .AND. &
-                 ( surface_fraction_f%frac(1,j,i) == 0.0_wp .OR.               &
-                   surface_fraction_f%frac(1,j,i) == surface_fraction_f%fill ) &
+                 ( surface_fraction_f%frac(ind_pav_green,j,i) == 0.0_wp .OR.   &
+                   surface_fraction_f%frac(ind_pav_green,j,i) ==               &
+                                                     surface_fraction_f%fill ) &
                   )  .OR.                                                      &
                   ( water_type_f%var(j,i) /= water_type_f%fill           .AND. &
-                 ( surface_fraction_f%frac(2,j,i) == 0.0_wp .OR.               &
-                   surface_fraction_f%frac(2,j,i) == surface_fraction_f%fill ) &
+                 ( surface_fraction_f%frac(ind_wat_win,j,i) == 0.0_wp .OR.     &
+                   surface_fraction_f%frac(ind_wat_win,j,i) ==                 &
+                                                     surface_fraction_f%fill ) &
                   ) )  THEN 
                 WRITE( message_string, * ) 'Mismatch in setting of '     //    &
@@ -3210,14 +3223,17 @@
 !--          surface vegetation fraction is non-zero. 
              IF ( ( vegetation_type_f%var(j,i) == vegetation_type_f%fill  .AND.&
-                 ( surface_fraction_f%frac(0,j,i) /= 0.0_wp .AND.              &
-                   surface_fraction_f%frac(0,j,i) /= surface_fraction_f%fill ) &
+                 ( surface_fraction_f%frac(ind_veg_wall,j,i) /= 0.0_wp .AND.   &
+                   surface_fraction_f%frac(ind_veg_wall,j,i) /=                &
+                                                     surface_fraction_f%fill ) &
                   )  .OR.                                                      &
                   ( pavement_type_f%var(j,i) == pavement_type_f%fill     .AND. &
-                 ( surface_fraction_f%frac(1,j,i) /= 0.0_wp .AND.              &
-                   surface_fraction_f%frac(1,j,i) /= surface_fraction_f%fill ) &
+                 ( surface_fraction_f%frac(ind_pav_green,j,i) /= 0.0_wp .AND.  &
+                   surface_fraction_f%frac(ind_pav_green,j,i) /=               &
+                                                     surface_fraction_f%fill ) &
                   )  .OR.                                                      &
                   ( water_type_f%var(j,i) == water_type_f%fill           .AND. &
-                 ( surface_fraction_f%frac(2,j,i) /= 0.0_wp .AND.              &
-                   surface_fraction_f%frac(2,j,i) /= surface_fraction_f%fill ) &
+                 ( surface_fraction_f%frac(ind_wat_win,j,i) /= 0.0_wp .AND.    &
+                   surface_fraction_f%frac(ind_wat_win,j,i) /=                 &
+                                                     surface_fraction_f%fill ) &
                   ) )  THEN 
                 WRITE( message_string, * ) 'Mismatch in setting of '     //    &
Index: /palm/trunk/SOURCE/radiation_model_mod.f90
===================================================================
--- /palm/trunk/SOURCE/radiation_model_mod.f90	(revision 2962)
+++ /palm/trunk/SOURCE/radiation_model_mod.f90	(revision 2963)
@@ -28,4 +28,9 @@
 ! -----------------
 ! $Id$
+! - Introduce index for vegetation/wall, pavement/green-wall and water/window 
+!   surfaces, for clearer access of surface fraction, albedo, emissivity, etc. .
+! - Minor bugfix in initialization of albedo for window surfaces
+! 
+! 2944 2018-04-03 16:20:18Z suehring
 ! Fixed bad commit
 ! 
@@ -361,4 +366,5 @@
     USE surface_mod,                                                           &
         ONLY:  get_topography_top_index, get_topography_top_index_ji,          &
+               ind_pav_green, ind_veg_wall, ind_wat_win,                       &
                surf_lsm_h, surf_lsm_v, surf_type, surf_usm_h, surf_usm_v
 
@@ -1524,48 +1530,48 @@
 !--       Only if albedo_type is non-zero
           DO  m = 1, surf_lsm_h%ns
-             IF ( surf_lsm_h%albedo_type(0,m) /= 0 )                           &
-                surf_lsm_h%albedo(0,m) =                                       &
-                                      albedo_pars(2,surf_lsm_h%albedo_type(0,m))
-             IF ( surf_lsm_h%albedo_type(1,m) /= 0 )                           &
-                surf_lsm_h%albedo(1,m) =                                       &
-                                      albedo_pars(2,surf_lsm_h%albedo_type(1,m))
-             IF ( surf_lsm_h%albedo_type(2,m) /= 0 )                           &
-                surf_lsm_h%albedo(2,m) =                                       &
-                                      albedo_pars(2,surf_lsm_h%albedo_type(2,m))
+             IF ( surf_lsm_h%albedo_type(ind_veg_wall,m) /= 0 )                &
+                surf_lsm_h%albedo(ind_veg_wall,m) =                            &
+                           albedo_pars(2,surf_lsm_h%albedo_type(ind_veg_wall,m))
+             IF ( surf_lsm_h%albedo_type(ind_pav_green,m) /= 0 )               &
+                surf_lsm_h%albedo(ind_pav_green,m) =                           &
+                           albedo_pars(2,surf_lsm_h%albedo_type(ind_pav_green,m))
+             IF ( surf_lsm_h%albedo_type(ind_wat_win,m) /= 0 )                 &
+                surf_lsm_h%albedo(ind_wat_win,m) =                             &
+                           albedo_pars(2,surf_lsm_h%albedo_type(ind_wat_win,m))
           ENDDO
           DO  m = 1, surf_usm_h%ns
-             IF ( surf_usm_h%albedo_type(0,m) /= 0 )                           &
-                surf_usm_h%albedo(0,m) =                                       &
-                                      albedo_pars(2,surf_usm_h%albedo_type(0,m))
-             IF ( surf_usm_h%albedo_type(1,m) /= 0 )                           &
-                surf_usm_h%albedo(1,m) =                                       &
-                                      albedo_pars(2,surf_usm_h%albedo_type(1,m))
-             IF ( surf_usm_h%albedo_type(2,m) /= 0 )                           &
-                surf_usm_h%albedo(2,m) =                                       &
-                                      albedo_pars(2,surf_usm_h%albedo_type(2,m))
+             IF ( surf_usm_h%albedo_type(ind_veg_wall,m) /= 0 )                &
+                surf_usm_h%albedo(ind_veg_wall,m) =                            &
+                           albedo_pars(2,surf_usm_h%albedo_type(ind_veg_wall,m))
+             IF ( surf_usm_h%albedo_type(ind_pav_green,m) /= 0 )               &
+                surf_usm_h%albedo(ind_pav_green,m) =                           &
+                           albedo_pars(2,surf_usm_h%albedo_type(ind_pav_green,m))
+             IF ( surf_usm_h%albedo_type(ind_wat_win,m) /= 0 )                 &
+                surf_usm_h%albedo(ind_wat_win,m) =                             &
+                           albedo_pars(2,surf_usm_h%albedo_type(ind_wat_win,m))
           ENDDO
 
           DO  l = 0, 3
              DO  m = 1, surf_lsm_v(l)%ns
-                IF ( surf_lsm_v(l)%albedo_type(0,m) /= 0 )                     &
-                   surf_lsm_v(l)%albedo(0,m) =                                 &
-                                   albedo_pars(2,surf_lsm_v(l)%albedo_type(0,m))
-                IF ( surf_lsm_v(l)%albedo_type(1,m) /= 0 )                     &
-                   surf_lsm_v(l)%albedo(1,m) =                                 &
-                                   albedo_pars(2,surf_lsm_v(l)%albedo_type(1,m))
-                IF ( surf_lsm_v(l)%albedo_type(2,m) /= 0 )                     &
-                   surf_lsm_v(l)%albedo(2,m) =                                 &
-                                   albedo_pars(2,surf_lsm_v(l)%albedo_type(2,m))
+                IF ( surf_lsm_v(l)%albedo_type(ind_veg_wall,m) /= 0 )          &
+                   surf_lsm_v(l)%albedo(ind_veg_wall,m) =                      &
+                        albedo_pars(2,surf_lsm_v(l)%albedo_type(ind_veg_wall,m))
+                IF ( surf_lsm_v(l)%albedo_type(ind_pav_green,m) /= 0 )         &
+                   surf_lsm_v(l)%albedo(ind_pav_green,m) =                     &
+                        albedo_pars(2,surf_lsm_v(l)%albedo_type(ind_pav_green,m))
+                IF ( surf_lsm_v(l)%albedo_type(ind_wat_win,m) /= 0 )           &
+                   surf_lsm_v(l)%albedo(ind_wat_win,m) =                       &
+                        albedo_pars(2,surf_lsm_v(l)%albedo_type(ind_wat_win,m))
              ENDDO
              DO  m = 1, surf_usm_v(l)%ns
-                IF ( surf_usm_v(l)%albedo_type(0,m) /= 0 )                     &
-                   surf_usm_v(l)%albedo(0,m) =                                 &
-                                   albedo_pars(2,surf_usm_v(l)%albedo_type(0,m))
-                IF ( surf_usm_v(l)%albedo_type(1,m) /= 0 )                     &
-                   surf_usm_v(l)%albedo(1,m) =                                 &
-                                   albedo_pars(2,surf_usm_v(l)%albedo_type(1,m))
-                IF ( surf_usm_v(l)%albedo_type(2,m) /= 0 )                     &
-                   surf_usm_v(l)%albedo(2,m) =                                 &
-                                   albedo_pars(2,surf_usm_v(l)%albedo_type(2,m))
+                IF ( surf_usm_v(l)%albedo_type(ind_veg_wall,m) /= 0 )          &
+                   surf_usm_v(l)%albedo(ind_veg_wall,m) =                      &
+                        albedo_pars(2,surf_usm_v(l)%albedo_type(ind_veg_wall,m))
+                IF ( surf_usm_v(l)%albedo_type(ind_pav_green,m) /= 0 )         &
+                   surf_usm_v(l)%albedo(ind_pav_green,m) =                     &
+                        albedo_pars(2,surf_usm_v(l)%albedo_type(ind_pav_green,m))
+                IF ( surf_usm_v(l)%albedo_type(ind_wat_win,m) /= 0 )           &
+                   surf_usm_v(l)%albedo(ind_wat_win,m) =                       &
+                        albedo_pars(2,surf_usm_v(l)%albedo_type(ind_wat_win,m))
              ENDDO
           ENDDO
@@ -1582,10 +1588,10 @@
                 j = surf_lsm_h%j(m)
                 IF ( albedo_pars_f%pars_xy(0,j,i) /= albedo_pars_f%fill )  THEN
-                   IF ( surf_lsm_h%albedo_type(0,m) == 0 )                     &
-                      surf_lsm_h%albedo(0,m) = albedo_pars_f%pars_xy(0,j,i)
-                   IF ( surf_lsm_h%albedo_type(1,m) == 0 )                     &
-                      surf_lsm_h%albedo(1,m) = albedo_pars_f%pars_xy(0,j,i)
-                   IF ( surf_lsm_h%albedo_type(2,m) == 0 )                     &
-                      surf_lsm_h%albedo(2,m) = albedo_pars_f%pars_xy(0,j,i)
+                   IF ( surf_lsm_h%albedo_type(ind_veg_wall,m) == 0 )          &
+                      surf_lsm_h%albedo(ind_veg_wall,m) = albedo_pars_f%pars_xy(0,j,i)
+                   IF ( surf_lsm_h%albedo_type(ind_pav_green,m) == 0 )         &
+                      surf_lsm_h%albedo(ind_pav_green,m) = albedo_pars_f%pars_xy(0,j,i)
+                   IF ( surf_lsm_h%albedo_type(ind_wat_win,m) == 0 )           &
+                      surf_lsm_h%albedo(ind_wat_win,m) = albedo_pars_f%pars_xy(0,j,i)
                 ENDIF
              ENDDO
@@ -1594,10 +1600,10 @@
                 j = surf_usm_h%j(m)
                 IF ( albedo_pars_f%pars_xy(0,j,i) /= albedo_pars_f%fill )  THEN
-                   IF ( surf_usm_h%albedo_type(0,m) == 0 )                     &
-                      surf_usm_h%albedo(0,m) = albedo_pars_f%pars_xy(0,j,i)
-                   IF ( surf_usm_h%albedo_type(1,m) == 0 )                     &
-                      surf_usm_h%albedo(1,m) = albedo_pars_f%pars_xy(0,j,i)
-                   IF ( surf_usm_h%albedo_type(2,m) == 0 )                     &
-                      surf_usm_h%albedo(2,m) = albedo_pars_f%pars_xy(0,j,i)
+                   IF ( surf_usm_h%albedo_type(ind_veg_wall,m) == 0 )          &
+                      surf_usm_h%albedo(ind_veg_wall,m) = albedo_pars_f%pars_xy(0,j,i)
+                   IF ( surf_usm_h%albedo_type(ind_pav_green,m) == 0 )         &
+                      surf_usm_h%albedo(ind_pav_green,m) = albedo_pars_f%pars_xy(0,j,i)
+                   IF ( surf_usm_h%albedo_type(ind_wat_win,m) == 0 )           &
+                      surf_usm_h%albedo(ind_wat_win,m) = albedo_pars_f%pars_xy(0,j,i)
                 ENDIF
              ENDDO 
@@ -1612,10 +1618,10 @@
                    j = surf_lsm_v(l)%j(m) + joff
                    IF ( albedo_pars_f%pars_xy(0,j,i) /= albedo_pars_f%fill )  THEN
-                      IF ( surf_lsm_v(l)%albedo_type(0,m) == 0 )               &
-                         surf_lsm_v(l)%albedo(1,m) = albedo_pars_f%pars_xy(0,j,i)
-                      IF ( surf_lsm_v(l)%albedo_type(1,m) == 0 )               &
-                         surf_lsm_v(l)%albedo(1,m) = albedo_pars_f%pars_xy(0,j,i)
-                      IF ( surf_lsm_v(l)%albedo_type(2,m) == 0 )               &
-                         surf_lsm_v(l)%albedo(2,m) = albedo_pars_f%pars_xy(0,j,i)
+                      IF ( surf_lsm_v(l)%albedo_type(ind_veg_wall,m) == 0 )    &
+                         surf_lsm_v(l)%albedo(ind_veg_wall,m) = albedo_pars_f%pars_xy(0,j,i)
+                      IF ( surf_lsm_v(l)%albedo_type(ind_pav_green,m) == 0 )   &
+                         surf_lsm_v(l)%albedo(ind_pav_green,m) = albedo_pars_f%pars_xy(0,j,i)
+                      IF ( surf_lsm_v(l)%albedo_type(ind_wat_win,m) == 0 )     &
+                         surf_lsm_v(l)%albedo(ind_wat_win,m) = albedo_pars_f%pars_xy(0,j,i)
                    ENDIF
                 ENDDO
@@ -1627,10 +1633,10 @@
                    j = surf_usm_h%j(m) + joff
                    IF ( albedo_pars_f%pars_xy(0,j,i) /= albedo_pars_f%fill )  THEN
-                      IF ( surf_usm_v(l)%albedo_type(0,m) == 0 )               &
-                         surf_usm_v(l)%albedo(1,m) = albedo_pars_f%pars_xy(0,j,i)
-                      IF ( surf_usm_v(l)%albedo_type(1,m) == 0 )               &
-                         surf_usm_v(l)%albedo(1,m) = albedo_pars_f%pars_xy(0,j,i)
-                      IF ( surf_usm_v(l)%albedo_type(2,m) == 0 )               &
-                         surf_lsm_v(l)%albedo(2,m) = albedo_pars_f%pars_xy(0,j,i)
+                      IF ( surf_usm_v(l)%albedo_type(ind_veg_wall,m) == 0 )    &
+                         surf_usm_v(l)%albedo(ind_veg_wall,m) = albedo_pars_f%pars_xy(0,j,i)
+                      IF ( surf_usm_v(l)%albedo_type(ind_pav_green,m) == 0 )   &
+                         surf_usm_v(l)%albedo(ind_pav_green,m) = albedo_pars_f%pars_xy(0,j,i)
+                      IF ( surf_usm_v(l)%albedo_type(ind_wat_win,m) == 0 )     &
+                         surf_lsm_v(l)%albedo(ind_wat_win,m) = albedo_pars_f%pars_xy(0,j,i)
                    ENDIF
                 ENDDO
@@ -2288,12 +2294,18 @@
 !--                calculated fluxes below are not actually used as they are 
 !--                overwritten in radiation_interaction.
-                   surf%rad_sw_out(m) = ( surf%frac(0,m) * surf%albedo(0,m)    &
-                                        + surf%frac(1,m) * surf%albedo(1,m)    &
-                                        + surf%frac(2,m) * surf%albedo(2,m) )  &
+                   surf%rad_sw_out(m) = ( surf%frac(ind_veg_wall,m)  *         &
+                                          surf%albedo(ind_veg_wall,m)          &
+                                        + surf%frac(ind_pav_green,m) *         &
+                                          surf%albedo(ind_pav_green,m)         &
+                                        + surf%frac(ind_wat_win,m)   *         &
+                                          surf%albedo(ind_wat_win,m) )         &
                                         * surf%rad_sw_in(m)
 
-                   surf%rad_lw_out(m) = ( surf%frac(0,m) * surf%emissivity(0,m)&
-                                        + surf%frac(1,m) * surf%emissivity(1,m)&
-                                        + surf%frac(2,m) * surf%emissivity(2,m)&
+                   surf%rad_lw_out(m) = ( surf%frac(ind_veg_wall,m)  *         &
+                                          surf%emissivity(ind_veg_wall,m)      &
+                                        + surf%frac(ind_pav_green,m) *         &
+                                          surf%emissivity(ind_pav_green,m)     &
+                                        + surf%frac(ind_wat_win,m)   *         &
+                                          surf%emissivity(ind_wat_win,m)       &
                                         )                                      &
                                         * sigma_sb                             &
@@ -2301,7 +2313,10 @@
 
                    surf%rad_lw_out_change_0(m) =                               &
-                                      ( surf%frac(0,m) * surf%emissivity(0,m)  &
-                                      + surf%frac(1,m) * surf%emissivity(1,m)  &
-                                      + surf%frac(2,m) * surf%emissivity(2,m)  &
+                                      ( surf%frac(ind_veg_wall,m)  *           &
+                                        surf%emissivity(ind_veg_wall,m)        &
+                                      + surf%frac(ind_pav_green,m) *           &
+                                        surf%emissivity(ind_pav_green,m)       &
+                                      + surf%frac(ind_wat_win,m)   *           &
+                                        surf%emissivity(ind_wat_win,m)         &
                                       ) * 3.0_wp * sigma_sb                    &
                                       * ( surf%pt_surface(m) * exn )** 3
@@ -2474,7 +2489,10 @@
 !
 !--                Weighted average according to surface fraction. 
-                   surf%rad_lw_out(m) = ( surf%frac(0,m) * surf%emissivity(0,m)&
-                                        + surf%frac(1,m) * surf%emissivity(1,m)&
-                                        + surf%frac(2,m) * surf%emissivity(2,m)&
+                   surf%rad_lw_out(m) = ( surf%frac(ind_veg_wall,m)  *         &
+                                          surf%emissivity(ind_veg_wall,m)      &
+                                        + surf%frac(ind_pav_green,m) *         &
+                                          surf%emissivity(ind_pav_green,m)     &
+                                        + surf%frac(ind_wat_win,m)   *         &
+                                          surf%emissivity(ind_wat_win,m)       &
                                         )                                      &
                                       * sigma_sb                               &
@@ -2484,12 +2502,18 @@
                                        + surf%rad_lw_out(m) )                  &
                                        / ( 1.0_wp -                            &
-                                          ( surf%frac(0,m) * surf%albedo(0,m) +&
-                                            surf%frac(1,m) * surf%albedo(1,m) +&
-                                            surf%frac(1,m) * surf%albedo(1,m) )&
+                                          ( surf%frac(ind_veg_wall,m)  *       &
+                                            surf%albedo(ind_veg_wall,m)        &
+                                         +  surf%frac(ind_pav_green,m) *       &
+                                            surf%albedo(ind_pav_green,m)       &
+                                         +  surf%frac(ind_wat_win,m)   *       &
+                                            surf%albedo(ind_wat_win,m) )       &
                                          )
 
-                   surf%rad_sw_out(m) = ( surf%frac(0,m) * surf%albedo(0,m)    &
-                                        + surf%frac(1,m) * surf%albedo(1,m)    &
-                                        + surf%frac(2,m) * surf%albedo(2,m) )  &
+                   surf%rad_sw_out(m) = ( surf%frac(ind_veg_wall,m)  *         &
+                                          surf%albedo(ind_veg_wall,m)          &
+                                        + surf%frac(ind_pav_green,m) *         &
+                                          surf%albedo(ind_pav_green,m)         &
+                                        + surf%frac(ind_wat_win,m)   *         &
+                                          surf%albedo(ind_wat_win,m) )         &
                                       * surf%rad_sw_in(m)
 
@@ -3099,15 +3123,21 @@
 !--             surfaces. 
                 DO  m = surf_lsm_h%start_index(j,i), surf_lsm_h%end_index(j,i)
-                   rrtm_emis = surf_lsm_h%frac(0,m) * surf_lsm_h%emissivity(0,m) +&
-                               surf_lsm_h%frac(1,m) * surf_lsm_h%emissivity(1,m) +& 
-                               surf_lsm_h%frac(2,m) * surf_lsm_h%emissivity(2,m)
-                   rrtm_tsfc = pt(surf_lsm_h%k(m)+surf_lsm_h%koff,j,i) *          &
+                   rrtm_emis = surf_lsm_h%frac(ind_veg_wall,m)  *              &
+                               surf_lsm_h%emissivity(ind_veg_wall,m)  +        &
+                               surf_lsm_h%frac(ind_pav_green,m) *              &
+                               surf_lsm_h%emissivity(ind_pav_green,m) +        & 
+                               surf_lsm_h%frac(ind_wat_win,m)   *              &
+                               surf_lsm_h%emissivity(ind_wat_win,m)
+                   rrtm_tsfc = pt(surf_lsm_h%k(m)+surf_lsm_h%koff,j,i) *       &
                                        (surface_pressure / 1000.0_wp )**0.286_wp
                 ENDDO             
                 DO  m = surf_usm_h%start_index(j,i), surf_usm_h%end_index(j,i)
-                   rrtm_emis = surf_usm_h%frac(0,m) * surf_usm_h%emissivity(0,m) +&
-                               surf_usm_h%frac(1,m) * surf_usm_h%emissivity(1,m) +& 
-                               surf_usm_h%frac(2,m) * surf_usm_h%emissivity(2,m)
-                   rrtm_tsfc = pt(surf_usm_h%k(m)+surf_usm_h%koff,j,i) *          &
+                   rrtm_emis = surf_usm_h%frac(ind_veg_wall,m)  *              &
+                               surf_usm_h%emissivity(ind_veg_wall,m)  +        &
+                               surf_usm_h%frac(ind_pav_green,m) *              &
+                               surf_usm_h%emissivity(ind_pav_green,m) +        & 
+                               surf_usm_h%frac(ind_wat_win,m)   *              &
+                               surf_usm_h%emissivity(ind_wat_win,m)
+                   rrtm_tsfc = pt(surf_usm_h%k(m)+surf_usm_h%koff,j,i) *       &
                                        (surface_pressure / 1000.0_wp )**0.286_wp
                 ENDDO
Index: /palm/trunk/SOURCE/sum_up_3d_data.f90
===================================================================
--- /palm/trunk/SOURCE/sum_up_3d_data.f90	(revision 2962)
+++ /palm/trunk/SOURCE/sum_up_3d_data.f90	(revision 2963)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Introduce index for vegetation/wall, pavement/green-wall and water/window 
+! surfaces, for clearer access of surface fraction, albedo, emissivity, etc. .
+! 
+! 2894 2018-03-15 09:17:58Z Giersch
 ! Changed comment
 ! 
@@ -223,5 +227,6 @@
 
     USE surface_mod,                                                           &
-        ONLY:  surf_def_h, surf_lsm_h, surf_usm_h
+        ONLY:  ind_pav_green, ind_veg_wall, ind_wat_win,                       &
+               surf_def_h, surf_lsm_h, surf_usm_h
 
     USE turbulence_closure_mod,                                                &
@@ -577,9 +582,9 @@
                 i   = surf_usm_h%i(m)            
                 j   = surf_usm_h%j(m)
-                ghf_av(j,i) = ghf_av(j,i) + surf_usm_h%frac(0,m)     *          &
-                                            surf_usm_h%wghf_eb(m)        +      &
-                                            surf_usm_h%frac(1,m)     *          &
-                                            surf_usm_h%wghf_eb_green(m)  +      &
-                                            surf_usm_h%frac(2,m)     *          &
+                ghf_av(j,i) = ghf_av(j,i) + surf_usm_h%frac(ind_veg_wall,m)  * &
+                                            surf_usm_h%wghf_eb(m)        +     &
+                                            surf_usm_h%frac(ind_pav_green,m) * &
+                                            surf_usm_h%wghf_eb_green(m)  +     &
+                                            surf_usm_h%frac(ind_wat_win,m)   * &
                                             surf_usm_h%wghf_eb_window(m)
              ENDDO
@@ -841,7 +846,10 @@
                 j   = surf_usm_h%j(m)
                 r_a_av(j,i) = r_a_av(j,i) +                                    &
-                           ( surf_usm_h%frac(0,m) * surf_usm_h%r_a(m)       +  & 
-                             surf_usm_h%frac(1,m) * surf_usm_h%r_a_green(m) +  & 
-                             surf_usm_h%frac(2,m) * surf_usm_h%r_a_window(m) )
+                           ( surf_usm_h%frac(ind_veg_wall,m)  *                &
+                             surf_usm_h%r_a(m)       +                         & 
+                             surf_usm_h%frac(ind_pav_green,m) *                &
+                             surf_usm_h%r_a_green(m) +                         & 
+                             surf_usm_h%frac(ind_wat_win,m)   *                &
+                             surf_usm_h%r_a_window(m) )
              ENDDO
 
Index: /palm/trunk/SOURCE/surface_mod.f90
===================================================================
--- /palm/trunk/SOURCE/surface_mod.f90	(revision 2962)
+++ /palm/trunk/SOURCE/surface_mod.f90	(revision 2963)
@@ -26,4 +26,8 @@
 ! -----------------
 ! $Id$
+! Introduce index for vegetation/wall, pavement/green-wall and water/window 
+! surfaces, for clearer access of surface fraction, albedo, emissivity, etc. .
+! 
+! 2942 2018-04-03 13:51:09Z suehring
 ! Bugfix in assigning surface element data after restart
 ! 
@@ -435,4 +439,8 @@
     TYPE (surf_type), DIMENSION(0:3), TARGET ::  surf_usm_v  !< vertical urban surfaces (North, South, East, West)
 
+    INTEGER(iwp), PARAMETER ::  ind_veg_wall  = 0            !< index for vegetation / wall-surface fraction, used for access of albedo, emissivity, etc., for each surface type   
+    INTEGER(iwp), PARAMETER ::  ind_pav_green = 1            !< index for pavement / green-wall surface fraction, used for access of albedo, emissivity, etc., for each surface type
+    INTEGER(iwp), PARAMETER ::  ind_wat_win   = 2            !< index for water / window-surface fraction, used for access of albedo, emissivity, etc., for each surface type
+
     INTEGER(iwp) ::  ns_h_on_file(0:2)                       !< total number of horizontal surfaces with the same facing, required for writing restart data 
     INTEGER(iwp) ::  ns_v_on_file(0:3)                       !< total number of vertical surfaces with the same facing, required for writing restart data 
@@ -474,6 +482,7 @@
 !
 !-- Public variables
-    PUBLIC bc_h, ns_h_on_file, ns_v_on_file, surf_def_h, surf_def_v,           &
-           surf_lsm_h, surf_lsm_v, surf_usm_h, surf_usm_v, surf_type
+    PUBLIC bc_h, ind_pav_green, ind_veg_wall, ind_wat_win, ns_h_on_file,       &
+           ns_v_on_file, surf_def_h, surf_def_v, surf_lsm_h, surf_lsm_v,       &
+           surf_usm_h, surf_usm_v, surf_type
 !
 !-- Public subroutines and functions
Index: /palm/trunk/SOURCE/urban_surface_mod.f90
===================================================================
--- /palm/trunk/SOURCE/urban_surface_mod.f90	(revision 2962)
+++ /palm/trunk/SOURCE/urban_surface_mod.f90	(revision 2963)
@@ -28,4 +28,8 @@
 ! -----------------
 ! $Id$
+! Introduce index for vegetation/wall, pavement/green-wall and water/window 
+! surfaces, for clearer access of surface fraction, albedo, emissivity, etc. .
+! 
+! 2943 2018-04-03 16:17:10Z suehring
 ! Calculate exner function at all height levels and remove some un-used
 ! variables.
@@ -322,5 +326,8 @@
         ONLY:  hom, statistic_regions
 
-    USE surface_mod
+    USE surface_mod,                                                           &
+        ONLY:  get_topography_top_index_ji, get_topography_top_index,          &
+               ind_pav_green, ind_veg_wall, ind_wat_win, surf_usm_h,           &
+               surf_usm_v, surface_restore_elements
 
 
@@ -2458,10 +2465,10 @@
                     j = surf_usm_h%j(m)
                     k = surf_usm_h%k(m)
-                    temp_pf(k,j,i) = surf_usm_h%frac(0,m)     *                   &
-                                     surf_usm_h%albedo(0,m) +                     &
-                                     surf_usm_h%frac(1,m)     *                   &
-                                     surf_usm_h%albedo(1,m) +                     &
-                                     surf_usm_h%frac(2,m)     *                   &
-                                     surf_usm_h%albedo(2,m)
+                    temp_pf(k,j,i) = surf_usm_h%frac(ind_veg_wall,m)     *     &
+                                     surf_usm_h%albedo(ind_veg_wall,m)  +      &
+                                     surf_usm_h%frac(ind_pav_green,m)    *     &
+                                     surf_usm_h%albedo(ind_pav_green,m) +      &
+                                     surf_usm_h%frac(ind_wat_win,m)      *     &
+                                     surf_usm_h%albedo(ind_wat_win,m)
                  ENDDO
               ELSE
@@ -2471,10 +2478,10 @@
                     j = surf_usm_v(l)%j(m)
                     k = surf_usm_v(l)%k(m)
-                    temp_pf(k,j,i) = surf_usm_v(l)%frac(0,m)     *             &
-                                     surf_usm_v(l)%albedo(0,m) +               &
-                                     surf_usm_v(l)%frac(1,m)     *             &
-                                     surf_usm_v(l)%albedo(1,m) +               &
-                                     surf_usm_v(l)%frac(2,m)     *             &
-                                     surf_usm_v(l)%albedo(2,m)
+                    temp_pf(k,j,i) = surf_usm_v(l)%frac(ind_veg_wall,m)     *  &
+                                     surf_usm_v(l)%albedo(ind_veg_wall,m)  +   &
+                                     surf_usm_v(l)%frac(ind_pav_green,m)    *  &
+                                     surf_usm_v(l)%albedo(ind_pav_green,m) +   &
+                                     surf_usm_v(l)%frac(ind_wat_win,m)      *  &
+                                     surf_usm_v(l)%albedo(ind_wat_win,m)
                  ENDDO
               ENDIF
@@ -2487,10 +2494,10 @@
                     j = surf_usm_h%j(m)
                     k = surf_usm_h%k(m)
-                    temp_pf(k,j,i) =  surf_usm_h%frac(0,m)     *                  &
-                                      surf_usm_h%emissivity(0,m) +                &
-                                      surf_usm_h%frac(1,m)     *                  &
-                                      surf_usm_h%emissivity(1,m) +                &
-                                      surf_usm_h%frac(2,m)     *                  &
-                                      surf_usm_h%emissivity(2,m)
+                    temp_pf(k,j,i) =  surf_usm_h%frac(ind_veg_wall,m)      *   &
+                                      surf_usm_h%emissivity(ind_veg_wall,m)  + &
+                                      surf_usm_h%frac(ind_pav_green,m)     *   &
+                                      surf_usm_h%emissivity(ind_pav_green,m) + &
+                                      surf_usm_h%frac(ind_wat_win,m)       *   &
+                                      surf_usm_h%emissivity(ind_wat_win,m)
                  ENDDO
               ELSE
@@ -2500,10 +2507,10 @@
                     j = surf_usm_v(l)%j(m)
                     k = surf_usm_v(l)%k(m)
-                    temp_pf(k,j,i) = surf_usm_v(l)%frac(0,m)       *           &
-                                     surf_usm_v(l)%emissivity(0,m) +           &
-                                     surf_usm_v(l)%frac(1,m) *                 &
-                                     surf_usm_v(l)%emissivity(1,m) +           &
-                                     surf_usm_v(l)%frac(2,m)     *             &
-                                     surf_usm_v(l)%emissivity(2,m)
+                    temp_pf(k,j,i) = surf_usm_v(l)%frac(ind_veg_wall,m)       *&
+                                     surf_usm_v(l)%emissivity(ind_veg_wall,m) +&
+                                     surf_usm_v(l)%frac(ind_pav_green,m)      *&
+                                     surf_usm_v(l)%emissivity(ind_pav_green,m)+&
+                                     surf_usm_v(l)%frac(ind_wat_win,m)        *&
+                                     surf_usm_v(l)%emissivity(ind_wat_win,m)
                  ENDDO
               ENDIF
@@ -3677,8 +3684,8 @@
 !
 !--        Initialize relatvie wall- (0), green- (1) and window (2) fractions
-           surf_usm_h%frac(0,m)  = building_pars(ind_wall_frac,building_type)   
-           surf_usm_h%frac(1,m)  = building_pars(ind_green_frac_r,building_type)  
-           surf_usm_h%frac(2,m)  = building_pars(ind_win_frac,building_type)  
-           surf_usm_h%lai(m)     = building_pars(ind_green_frac_r,building_type)  
+           surf_usm_h%frac(ind_veg_wall,m)  = building_pars(ind_wall_frac,building_type)   
+           surf_usm_h%frac(ind_pav_green,m) = building_pars(ind_green_frac_r,building_type)  
+           surf_usm_h%frac(ind_wat_win,m)   = building_pars(ind_win_frac,building_type)  
+           surf_usm_h%lai(m)                = building_pars(ind_green_frac_r,building_type)  
 
            surf_usm_h%rho_c_wall(nzb_wall,m)   = building_pars(ind_hc1,building_type)  
@@ -3711,7 +3718,7 @@
 !
 !--        emissivity of wall-, green- and window fraction 
-           surf_usm_h%emissivity(0,m)        = building_pars(ind_emis_wall,building_type)
-           surf_usm_h%emissivity(1,m)        = building_pars(ind_emis_green,building_type)
-           surf_usm_h%emissivity(2,m)        = building_pars(ind_emis_win,building_type)
+           surf_usm_h%emissivity(ind_veg_wall,m)  = building_pars(ind_emis_wall,building_type)
+           surf_usm_h%emissivity(ind_pav_green,m) = building_pars(ind_emis_green,building_type)
+           surf_usm_h%emissivity(ind_wat_win,m)   = building_pars(ind_emis_win,building_type)
 
            surf_usm_h%transmissivity(m)      = building_pars(ind_trans,building_type)
@@ -3722,7 +3729,7 @@
 !
 !--        albedo type for wall fraction, green fraction, window fraction
-           surf_usm_h%albedo_type(0,m)       = INT( building_pars(ind_alb_wall,building_type)  )
-           surf_usm_h%albedo_type(1,m)       = INT( building_pars(ind_alb_green,building_type) )
-           surf_usm_h%albedo_type(2,m)       = INT( building_pars(ind_alb_win,building_type)   )
+           surf_usm_h%albedo_type(ind_veg_wall,m)  = INT( building_pars(ind_alb_wall,building_type)  )
+           surf_usm_h%albedo_type(ind_pav_green,m) = INT( building_pars(ind_alb_green,building_type) )
+           surf_usm_h%albedo_type(ind_wat_win,m)   = INT( building_pars(ind_alb_win,building_type)   )
 
            surf_usm_h%zw(nzb_wall,m)         = building_pars(ind_thick_1,building_type)
@@ -3796,7 +3803,7 @@
 !
 !--           Initialize relatvie wall- (0), green- (1) and window (2) fractions
-              surf_usm_v(l)%frac(0,m)              = building_pars(ind_wall_frac,building_type)   
-              surf_usm_v(l)%frac(1,m)              = building_pars(ind_green_frac_w,building_type) 
-              surf_usm_v(l)%frac(2,m)              = building_pars(ind_win_frac,building_type)  
+              surf_usm_v(l)%frac(ind_veg_wall,m)   = building_pars(ind_wall_frac,building_type)   
+              surf_usm_v(l)%frac(ind_pav_green,m)  = building_pars(ind_green_frac_w,building_type) 
+              surf_usm_v(l)%frac(ind_wat_win,m)    = building_pars(ind_win_frac,building_type)  
               surf_usm_v(l)%lai(m)                 = building_pars(ind_lai_w,building_type)  
 
@@ -3835,7 +3842,7 @@
 !
 !--           emissivity of wall-, green- and window fraction 
-              surf_usm_v(l)%emissivity(0,m)        = building_pars(ind_emis_wall,building_type)
-              surf_usm_v(l)%emissivity(1,m)        = building_pars(ind_emis_green,building_type)
-              surf_usm_v(l)%emissivity(2,m)        = building_pars(ind_emis_win,building_type)
+              surf_usm_v(l)%emissivity(ind_veg_wall,m)  = building_pars(ind_emis_wall,building_type)
+              surf_usm_v(l)%emissivity(ind_pav_green,m) = building_pars(ind_emis_green,building_type)
+              surf_usm_v(l)%emissivity(ind_wat_win,m)   = building_pars(ind_emis_win,building_type)
 
               surf_usm_v(l)%transmissivity(m)      = building_pars(ind_trans,building_type)
@@ -3845,7 +3852,7 @@
               surf_usm_v(l)%z0q(m)                 = building_pars(ind_z0qh,building_type)
 
-              surf_usm_v(l)%albedo_type(0,m)       = INT( building_pars(ind_alb_wall,building_type) )
-              surf_usm_v(l)%albedo_type(1,m)       = INT( building_pars(ind_alb_green,building_type) )
-              surf_usm_v(l)%albedo_type(2,m)       = INT( building_pars(ind_alb_win,building_type) )
+              surf_usm_v(l)%albedo_type(ind_veg_wall,m)  = INT( building_pars(ind_alb_wall,building_type) )
+              surf_usm_v(l)%albedo_type(ind_pav_green,m) = INT( building_pars(ind_alb_green,building_type) )
+              surf_usm_v(l)%albedo_type(ind_wat_win,m)   = INT( building_pars(ind_alb_win,building_type) )
 
               surf_usm_v(l)%zw(nzb_wall,m)         = building_pars(ind_thick_1,building_type)
@@ -3926,8 +3933,8 @@
 !
 !--              Initialize relatvie wall- (0), green- (1) and window (2) fractions
-                 surf_usm_h%frac(0,m)   = building_pars(ind_wall_frac,st)   
-                 surf_usm_h%frac(1,m)   = building_pars(ind_green_frac_r,st)  
-                 surf_usm_h%frac(2,m)   = building_pars(ind_win_frac,st)  
-                 surf_usm_h%lai(m)      = building_pars(ind_green_frac_r,st)  
+                 surf_usm_h%frac(ind_veg_wall,m)  = building_pars(ind_wall_frac,st)   
+                 surf_usm_h%frac(ind_pav_green,m) = building_pars(ind_green_frac_r,st)  
+                 surf_usm_h%frac(ind_wat_win,m)   = building_pars(ind_win_frac,st)  
+                 surf_usm_h%lai(m)                = building_pars(ind_green_frac_r,st)  
 
                  surf_usm_h%rho_c_wall(nzb_wall,m)   = building_pars(ind_hc1,st)  
@@ -3962,7 +3969,7 @@
 !
 !--              emissivity of wall-, green- and window fraction 
-                 surf_usm_h%emissivity(0,m)        = building_pars(ind_emis_wall,st)
-                 surf_usm_h%emissivity(1,m)        = building_pars(ind_emis_green,st)
-                 surf_usm_h%emissivity(2,m)        = building_pars(ind_emis_win,st)
+                 surf_usm_h%emissivity(ind_veg_wall,m)  = building_pars(ind_emis_wall,st)
+                 surf_usm_h%emissivity(ind_pav_green,m) = building_pars(ind_emis_green,st)
+                 surf_usm_h%emissivity(ind_wat_win,m)   = building_pars(ind_emis_win,st)
 
                  surf_usm_h%transmissivity(m)      = building_pars(ind_trans,st)
@@ -3973,7 +3980,7 @@
 !
 !--              albedo type for wall fraction, green fraction, window fraction
-                 surf_usm_h%albedo_type(0,m)       = INT( building_pars(ind_alb_wall,st) )
-                 surf_usm_h%albedo_type(1,m)       = INT( building_pars(ind_alb_green,st) )
-                 surf_usm_h%albedo_type(2,m)       = INT( building_pars(ind_alb_win,st) )
+                 surf_usm_h%albedo_type(ind_veg_wall,m)  = INT( building_pars(ind_alb_wall,st) )
+                 surf_usm_h%albedo_type(ind_pav_green,m) = INT( building_pars(ind_alb_green,st) )
+                 surf_usm_h%albedo_type(ind_wat_win,m)   = INT( building_pars(ind_alb_win,st) )
 
                  surf_usm_h%zw(nzb_wall,m)         = building_pars(ind_thick_1,st)
@@ -4054,8 +4061,8 @@
 !
 !--                 Initialize relatvie wall- (0), green- (1) and window (2) fractions
-                    surf_usm_v(l)%frac(0,m) = building_pars(ind_wall_frac,st)   
-                    surf_usm_v(l)%frac(1,m) = building_pars(ind_green_frac_w,st)  
-                    surf_usm_v(l)%frac(2,m) = building_pars(ind_win_frac,st)   
-                    surf_usm_v(l)%lai(m)    = building_pars(ind_lai_w,st)  
+                    surf_usm_v(l)%frac(ind_veg_wall,m)  = building_pars(ind_wall_frac,st)   
+                    surf_usm_v(l)%frac(ind_pav_green,m) = building_pars(ind_green_frac_w,st)  
+                    surf_usm_v(l)%frac(ind_wat_win,m)   = building_pars(ind_win_frac,st)   
+                    surf_usm_v(l)%lai(m)                = building_pars(ind_lai_w,st)  
 
                     surf_usm_v(l)%rho_c_wall(nzb_wall,m)   = building_pars(ind_hc1,st)  
@@ -4093,7 +4100,7 @@
 !
 !--                 emissivity of wall-, green- and window fraction 
-                    surf_usm_v(l)%emissivity(0,m)        = building_pars(ind_emis_wall,st)
-                    surf_usm_v(l)%emissivity(1,m)        = building_pars(ind_emis_green,st)
-                    surf_usm_v(l)%emissivity(2,m)        = building_pars(ind_emis_win,st)
+                    surf_usm_v(l)%emissivity(ind_veg_wall,m)  = building_pars(ind_emis_wall,st)
+                    surf_usm_v(l)%emissivity(ind_pav_green,m) = building_pars(ind_emis_green,st)
+                    surf_usm_v(l)%emissivity(ind_wat_win,m)   = building_pars(ind_emis_win,st)
 
                     surf_usm_v(l)%transmissivity(m)      = building_pars(ind_trans,st)
@@ -4103,7 +4110,7 @@
                     surf_usm_v(l)%z0q(m)                 = building_pars(ind_z0qh,st)
 
-                    surf_usm_v(l)%albedo_type(0,m)       = INT( building_pars(ind_alb_wall,st) )
-                    surf_usm_v(l)%albedo_type(1,m)       = INT( building_pars(ind_alb_green,st) )
-                    surf_usm_v(l)%albedo_type(2,m)       = INT( building_pars(ind_alb_win,st) )
+                    surf_usm_v(l)%albedo_type(ind_veg_wall,m)  = INT( building_pars(ind_alb_wall,st) )
+                    surf_usm_v(l)%albedo_type(ind_pav_green,m) = INT( building_pars(ind_alb_green,st) )
+                    surf_usm_v(l)%albedo_type(ind_wat_win,m)   = INT( building_pars(ind_alb_win,st) )
 
                     surf_usm_v(l)%zw(nzb_wall,m)         = building_pars(ind_thick_1,st)
@@ -4185,9 +4192,9 @@
 !--           Initialize relatvie wall- (0), green- (1) and window (2) fractions
               IF ( building_pars_f%pars_xy(ind_wall_frac,j,i) /= building_pars_f%fill )    &
-                 surf_usm_h%frac(0,m)  = building_pars_f%pars_xy(ind_wall_frac,j,i)   
+                 surf_usm_h%frac(ind_veg_wall,m)  = building_pars_f%pars_xy(ind_wall_frac,j,i)   
               IF ( building_pars_f%pars_xy(ind_green_frac_r,j,i) /= building_pars_f%fill ) & 
-                 surf_usm_h%frac(1,m)  = building_pars_f%pars_xy(ind_green_frac_r,j,i) 
+                 surf_usm_h%frac(ind_pav_green,m) = building_pars_f%pars_xy(ind_green_frac_r,j,i) 
               IF ( building_pars_f%pars_xy(ind_win_frac,j,i) /= building_pars_f%fill )     & 
-                 surf_usm_h%frac(2,m)  = building_pars_f%pars_xy(ind_win_frac,j,i)
+                 surf_usm_h%frac(ind_wat_win,m)   = building_pars_f%pars_xy(ind_win_frac,j,i)
 
  
@@ -4251,9 +4258,9 @@
 
               IF ( building_pars_f%pars_xy(ind_emis_wall,j,i) /= building_pars_f%fill ) & 
-                 surf_usm_h%emissivity(0,m)        = building_pars_f%pars_xy(ind_emis_wall,j,i)
+                 surf_usm_h%emissivity(ind_veg_wall,m)  = building_pars_f%pars_xy(ind_emis_wall,j,i)
               IF ( building_pars_f%pars_xy(ind_emis_green,j,i) /= building_pars_f%fill )& 
-                 surf_usm_h%emissivity(1,m)        = building_pars_f%pars_xy(ind_emis_green,j,i)
+                 surf_usm_h%emissivity(ind_pav_green,m) = building_pars_f%pars_xy(ind_emis_green,j,i)
               IF ( building_pars_f%pars_xy(ind_emis_win,j,i) /= building_pars_f%fill )  & 
-                 surf_usm_h%emissivity(2,m)        = building_pars_f%pars_xy(ind_emis_win,j,i)
+                 surf_usm_h%emissivity(ind_wat_win,m)   = building_pars_f%pars_xy(ind_emis_win,j,i)
 
               IF ( building_pars_f%pars_xy(ind_trans,j,i) /= building_pars_f%fill )    & 
@@ -4268,9 +4275,9 @@
 
               IF ( building_pars_f%pars_xy(ind_alb_wall,j,i) /= building_pars_f%fill )    & 
-                 surf_usm_h%albedo_type(0,m)       = building_pars_f%pars_xy(ind_alb_wall,j,i)
+                 surf_usm_h%albedo_type(ind_veg_wall,m)  = building_pars_f%pars_xy(ind_alb_wall,j,i)
               IF ( building_pars_f%pars_xy(ind_alb_green,j,i) /= building_pars_f%fill )    & 
-                 surf_usm_h%albedo_type(1,m)       = building_pars_f%pars_xy(ind_alb_green,j,i)
+                 surf_usm_h%albedo_type(ind_pav_green,m) = building_pars_f%pars_xy(ind_alb_green,j,i)
               IF ( building_pars_f%pars_xy(ind_alb_win,j,i) /= building_pars_f%fill )    & 
-                 surf_usm_h%albedo_type(2,m)       = building_pars_f%pars_xy(ind_alb_win,j,i)
+                 surf_usm_h%albedo_type(ind_wat_win,m)   = building_pars_f%pars_xy(ind_alb_win,j,i)
 
               IF ( building_pars_f%pars_xy(ind_thick_1,j,i) /= building_pars_f%fill )    & 
@@ -4364,11 +4371,14 @@
                  IF ( building_pars_f%pars_xy(ind_wall_frac,j,i) /=                     &
                       building_pars_f%fill )                                            &
-                    surf_usm_v(l)%frac(0,m)  = building_pars_f%pars_xy(ind_wall_frac,j,i)   
+                    surf_usm_v(l)%frac(ind_veg_wall,m)  =                               &
+                                      building_pars_f%pars_xy(ind_wall_frac,j,i)   
                  IF ( building_pars_f%pars_xy(ind_green_frac_w,j,i) /=                  &
                       building_pars_f%fill )                                            & 
-                    surf_usm_v(l)%frac(1,m)  = building_pars_f%pars_xy(ind_green_frac_w,j,i) 
+                    surf_usm_v(l)%frac(ind_pav_green,m) =                               &
+                                      building_pars_f%pars_xy(ind_green_frac_w,j,i) 
                  IF ( building_pars_f%pars_xy(ind_win_frac,j,i) /=                      &
                       building_pars_f%fill )                                            & 
-                    surf_usm_v(l)%frac(2,m)  = building_pars_f%pars_xy(ind_win_frac,j,i)
+                    surf_usm_v(l)%frac(ind_wat_win,m)   =                               &
+                                      building_pars_f%pars_xy(ind_win_frac,j,i)
   
                  IF ( building_pars_f%pars_xy(ind_lai_w,j,i) /= building_pars_f%fill )  & 
@@ -4438,9 +4448,9 @@
 
                  IF ( building_pars_f%pars_xy(ind_emis_wall,j,i) /= building_pars_f%fill ) & 
-                    surf_usm_v(l)%emissivity(0,m)        = building_pars_f%pars_xy(ind_emis_wall,j,i)
+                    surf_usm_v(l)%emissivity(ind_veg_wall,m)  = building_pars_f%pars_xy(ind_emis_wall,j,i)
                  IF ( building_pars_f%pars_xy(ind_emis_green,j,i) /= building_pars_f%fill )& 
-                    surf_usm_v(l)%emissivity(1,m)        = building_pars_f%pars_xy(ind_emis_green,j,i)
+                    surf_usm_v(l)%emissivity(ind_pav_green,m) = building_pars_f%pars_xy(ind_emis_green,j,i)
                  IF ( building_pars_f%pars_xy(ind_emis_win,j,i) /= building_pars_f%fill )  & 
-                    surf_usm_v(l)%emissivity(2,m)        = building_pars_f%pars_xy(ind_emis_win,j,i)
+                    surf_usm_v(l)%emissivity(ind_wat_win,m)   = building_pars_f%pars_xy(ind_emis_win,j,i)
 
                  IF ( building_pars_f%pars_xy(ind_trans,j,i) /= building_pars_f%fill )    & 
@@ -4455,9 +4465,9 @@
 
                  IF ( building_pars_f%pars_xy(ind_alb_wall,j,i) /= building_pars_f%fill )    & 
-                    surf_usm_v(l)%albedo_type(0,m)       = building_pars_f%pars_xy(ind_alb_wall,j,i)
+                    surf_usm_v(l)%albedo_type(ind_veg_wall,m)  = building_pars_f%pars_xy(ind_alb_wall,j,i)
                  IF ( building_pars_f%pars_xy(ind_alb_green,j,i) /= building_pars_f%fill )    & 
-                    surf_usm_v(l)%albedo_type(1,m)       = building_pars_f%pars_xy(ind_alb_green,j,i)
+                    surf_usm_v(l)%albedo_type(ind_pav_green,m) = building_pars_f%pars_xy(ind_alb_green,j,i)
                  IF ( building_pars_f%pars_xy(ind_alb_win,j,i) /= building_pars_f%fill )    & 
-                    surf_usm_v(l)%albedo_type(2,m)       = building_pars_f%pars_xy(ind_alb_win,j,i)
+                    surf_usm_v(l)%albedo_type(ind_wat_win,m)   = building_pars_f%pars_xy(ind_alb_win,j,i)
 
                  IF ( building_pars_f%pars_xy(ind_thick_1,j,i) /= building_pars_f%fill )    & 
@@ -4683,11 +4693,11 @@
                                          - t_wall_h(nzb_wall,m) ) *                &
                                          surf_usm_h%ddz_wall(nzb_wall+1,m)         &
-                                       + surf_usm_h%frac(0,m)                      &
-                                         / (surf_usm_h%frac(0,m)                   &
-                                           + surf_usm_h%frac(1,m) )                &
+                                       + surf_usm_h%frac(ind_veg_wall,m)           &
+                                         / (surf_usm_h%frac(ind_veg_wall,m)        &
+                                           + surf_usm_h%frac(ind_pav_green,m) )    &
                                          * surf_usm_h%wghf_eb(m)                   &
-                                       - surf_usm_h%frac(1,m)                      &
-                                          / (surf_usm_h%frac(0,m)                  &
-                                            + surf_usm_h%frac(1,m) )               &
+                                       - surf_usm_h%frac(ind_pav_green,m)          &
+                                          / (surf_usm_h%frac(ind_veg_wall,m)       &
+                                            + surf_usm_h%frac(ind_pav_green,m) )   &
                                          * ( surf_usm_h%lambda_h_green(nzt_wall,m) &
                                            * surf_usm_h%ddz_green(nzt_wall,m)      &
@@ -4853,11 +4863,11 @@
                                          - t_wall_v(l)%t(nzb_wall,m) ) *              &
                                          surf_usm_v(l)%ddz_wall(nzb_wall+1,m)         &
-                                       + surf_usm_v(l)%frac(0,m)                      &
-                                         / (surf_usm_v(l)%frac(0,m)                   &
-                                           + surf_usm_v(l)%frac(1,m) )                &
+                                       + surf_usm_v(l)%frac(ind_veg_wall,m)           &
+                                         / (surf_usm_v(l)%frac(ind_veg_wall,m)        &
+                                           + surf_usm_v(l)%frac(ind_pav_green,m) )    &
                                          * surf_usm_v(l)%wghf_eb(m)                   &
-                                       - surf_usm_v(l)%frac(1,m)                      &
-                                         / (surf_usm_v(l)%frac(0,m)                    &
-                                           + surf_usm_v(l)%frac(1,m) )                &
+                                       - surf_usm_v(l)%frac(ind_pav_green,m)          &
+                                         / (surf_usm_v(l)%frac(ind_veg_wall,m)        &
+                                           + surf_usm_v(l)%frac(ind_pav_green,m) )    &
                                          * ( surf_usm_v(l)%lambda_h_green(nzt_wall,m) &
                                            * surf_usm_v(l)%ddz_green(nzt_wall,m)      &
@@ -6772,5 +6782,5 @@
 !
 !--        Albedo
-           IF ( surf_usm_h%albedo(0,m) < 0.0_wp )  THEN
+           IF ( surf_usm_h%albedo(ind_veg_wall,m) < 0.0_wp )  THEN
               surf_usm_h%albedo(:,m) = surface_params(ialbedo,ip)
            ENDIF
@@ -6944,5 +6954,5 @@
 !
 !--           Albedo
-              IF ( surf_usm_v(l)%albedo(0,m) < 0.0_wp )  THEN
+              IF ( surf_usm_v(l)%albedo(ind_veg_wall,m) < 0.0_wp )  THEN
                  surf_usm_v(l)%albedo(:,m) = surface_params(ialbedo,ip)
               ENDIF
@@ -7240,28 +7250,28 @@
 !--           is used
            coef_1 = surf_usm_h%rad_net_l(m) +                                  & 
-                 ( 3.0_wp + 1.0_wp ) * surf_usm_h%emissivity(0,m) * sigma_sb * &
-                                       t_surf_h(m) ** 4 +                      &  
-                                       f_shf * surf_usm_h%pt1(m) +                           &
+                 ( 3.0_wp + 1.0_wp ) * surf_usm_h%emissivity(ind_veg_wall,m) * &
+                                       sigma_sb * t_surf_h(m) ** 4 +           &  
+                                       f_shf * surf_usm_h%pt1(m) +             &
                                        lambda_surface * t_wall_h(nzb_wall,m)
-           coef_window_1 = surf_usm_h%rad_net_l(m) +                                  & 
-                   ( 3.0_wp + 1.0_wp ) * surf_usm_h%emissivity(2,m) * sigma_sb * &
-                                       t_surf_window_h(m) ** 4 +                      &  
-                                       f_shf_window * surf_usm_h%pt1(m) +                           &
+           coef_window_1 = surf_usm_h%rad_net_l(m) +                           & 
+                   ( 3.0_wp + 1.0_wp ) * surf_usm_h%emissivity(ind_wat_win,m)  &
+                                       * sigma_sb * t_surf_window_h(m) ** 4 +  &  
+                                       f_shf_window * surf_usm_h%pt1(m) +      &
                                        lambda_surface_window * t_window_h(nzb_wall,m)
-           coef_green_1 = surf_usm_h%rad_net_l(m) +                                  & 
-                   ( 3.0_wp + 1.0_wp ) * surf_usm_h%emissivity(1,m) * sigma_sb * &
-                                       t_surf_green_h(m) ** 4 +                      &  
-                                       f_shf_green * surf_usm_h%pt1(m) +                           &
+           coef_green_1 = surf_usm_h%rad_net_l(m) +                            & 
+                 ( 3.0_wp + 1.0_wp ) * surf_usm_h%emissivity(ind_pav_green,m) *&
+                                       sigma_sb * t_surf_green_h(m) ** 4 +     &  
+                                       f_shf_green * surf_usm_h%pt1(m) +       &
                                        lambda_surface_green * t_wall_h(nzb_wall,m)
 
 !--        denominator of the prognostic equation
-           coef_2 = 4.0_wp * surf_usm_h%emissivity(0,m) * sigma_sb *          &
-                             t_surf_h(m) ** 3                                 &
+           coef_2 = 4.0_wp * surf_usm_h%emissivity(ind_veg_wall,m) *           &
+                             sigma_sb * t_surf_h(m) ** 3                       &
                            + lambda_surface + f_shf / exn(k)
-           coef_window_2 = 4.0_wp * surf_usm_h%emissivity(2,m) * sigma_sb *  &
-                             t_surf_window_h(m) ** 3                              &
+           coef_window_2 = 4.0_wp * surf_usm_h%emissivity(ind_wat_win,m) *     &
+                             sigma_sb * t_surf_window_h(m) ** 3                &
                            + lambda_surface_window + f_shf_window / exn(k)
-           coef_green_2 = 4.0_wp * surf_usm_h%emissivity(1,m) * sigma_sb *    &
-                             t_surf_green_h(m) ** 3                               &
+           coef_green_2 = 4.0_wp * surf_usm_h%emissivity(ind_pav_green,m) *    &
+                             sigma_sb * t_surf_green_h(m) ** 3                 &
                            + lambda_surface_green + f_shf_green / exn(k)
 
@@ -7287,7 +7297,7 @@
 !
 !--        Store surface temperature        
-           surf_usm_h%pt_surface(m) = ( surf_usm_h%frac(0,m) * t_surf_h_p(m)   &
-                               + surf_usm_h%frac(2,m) * t_surf_window_h_p(m)   &
-                               + surf_usm_h%frac(1,m) * t_surf_green_h_p(m) )  &
+           surf_usm_h%pt_surface(m) = ( surf_usm_h%frac(ind_veg_wall,m) * t_surf_h_p(m)   &
+                               + surf_usm_h%frac(ind_wat_win,m) * t_surf_window_h_p(m)   &
+                               + surf_usm_h%frac(ind_pav_green,m) * t_surf_green_h_p(m) )  &
                                / exn(k)
                        
@@ -7328,12 +7338,12 @@
 !--        rad_net_l is never used!           
            surf_usm_h%rad_net_l(m) = surf_usm_h%rad_net_l(m) +                           &
-                                     surf_usm_h%frac(0,m) *                              &
-                                     sigma_sb * surf_usm_h%emissivity(0,m) *             &
+                                     surf_usm_h%frac(ind_veg_wall,m) *                   &
+                                     sigma_sb * surf_usm_h%emissivity(ind_veg_wall,m) *  &
                                      ( t_surf_h_p(m)**4 - t_surf_h(m)**4 )               &
-                                    + surf_usm_h%frac(2,m) *                         &
-                                     sigma_sb * surf_usm_h%emissivity(2,m) *             &
+                                    + surf_usm_h%frac(ind_wat_win,m) *                   &
+                                     sigma_sb * surf_usm_h%emissivity(ind_wat_win,m) *   &
                                      ( t_surf_window_h_p(m)**4 - t_surf_window_h(m)**4 ) &
-                                    + surf_usm_h%frac(1,m) *                         &
-                                     sigma_sb * surf_usm_h%emissivity(1,m) *             &
+                                    + surf_usm_h%frac(ind_pav_green,m) *                 &
+                                     sigma_sb * surf_usm_h%emissivity(ind_pav_green,m) * &
                                      ( t_surf_green_h_p(m)**4 - t_surf_green_h(m)**4 )
 
@@ -7348,9 +7358,9 @@
 !--        ground/wall/roof surface heat flux
            surf_usm_h%wshf_eb(m)   = - f_shf  * ( surf_usm_h%pt1(m) - t_surf_h_p(m) / exn(k) ) *               &
-                                       surf_usm_h%frac(0,m)                         &
+                                       surf_usm_h%frac(ind_veg_wall,m)         &
                                      - f_shf_window  * ( surf_usm_h%pt1(m) - t_surf_window_h_p(m) / exn(k) ) * &
-                                       surf_usm_h%frac(2,m)                          &
+                                       surf_usm_h%frac(ind_wat_win,m)          &
                                      - f_shf_green  * ( surf_usm_h%pt1(m) - t_surf_green_h_p(m) / exn(k) ) *   &
-                                       surf_usm_h%frac(1,m)
+                                       surf_usm_h%frac(ind_pav_green,m)
 !           
 !--        store kinematic surface heat fluxes for utilization in other processes
@@ -7431,29 +7441,29 @@
 !--           numerator of the prognostic equation
               coef_1 = surf_usm_v(l)%rad_net_l(m) +                            & ! coef +1 corresponds to -lwout included in calculation of radnet_l
-             ( 3.0_wp + 1.0_wp ) * surf_usm_v(l)%emissivity(0,m) * sigma_sb *  &
-                                     t_surf_v(l)%t(m) ** 4 +                   &  
-                                     f_shf * surf_usm_v(l)%pt1(m) +                             &
+             ( 3.0_wp + 1.0_wp ) * surf_usm_v(l)%emissivity(ind_veg_wall,m) *  &
+                                     sigma_sb *  t_surf_v(l)%t(m) ** 4 +       &  
+                                     f_shf * surf_usm_v(l)%pt1(m) +            &
                                      lambda_surface * t_wall_v(l)%t(nzb_wall,m)
-              coef_window_1 = surf_usm_v(l)%rad_net_l(m) +                            & ! coef +1 corresponds to -lwout included in calculation of radnet_l
-               ( 3.0_wp + 1.0_wp ) * surf_usm_v(l)%emissivity(2,m) * sigma_sb *  &
-                                     t_surf_window_v(l)%t(m) ** 4 +                   &  
-                                     f_shf * surf_usm_v(l)%pt1(m) +                             &
+              coef_window_1 = surf_usm_v(l)%rad_net_l(m) +                     & ! coef +1 corresponds to -lwout included in calculation of radnet_l
+               ( 3.0_wp + 1.0_wp ) * surf_usm_v(l)%emissivity(ind_wat_win,m) * &
+                                     sigma_sb * t_surf_window_v(l)%t(m) ** 4 + &  
+                                     f_shf * surf_usm_v(l)%pt1(m) +            &
                                      lambda_surface_window * t_window_v(l)%t(nzb_wall,m)
 
               coef_green_1 = surf_usm_v(l)%rad_net_l(m) +                            & ! coef +1 corresponds to -lwout included in calculation of radnet_l
-               ( 3.0_wp + 1.0_wp ) * surf_usm_v(l)%emissivity(1,m) * sigma_sb *  &
-                                     t_surf_green_v(l)%t(m) ** 4 +                   &  
-                                     f_shf * surf_usm_v(l)%pt1(m) +                             &
+              ( 3.0_wp + 1.0_wp ) * surf_usm_v(l)%emissivity(ind_pav_green,m) *&
+                                     sigma_sb * t_surf_green_v(l)%t(m) ** 4 +  &  
+                                     f_shf * surf_usm_v(l)%pt1(m) +            &
                                      lambda_surface_green * t_wall_v(l)%t(nzb_wall,m)
 
 !--           denominator of the prognostic equation
-              coef_2 = 4.0_wp * surf_usm_v(l)%emissivity(0,m) * sigma_sb *     &
-                                t_surf_v(l)%t(m) ** 3                          &
+              coef_2 = 4.0_wp * surf_usm_v(l)%emissivity(ind_veg_wall,m) *     &
+                                sigma_sb * t_surf_v(l)%t(m) ** 3               &
                               + lambda_surface + f_shf / exn(k)
-              coef_window_2 = 4.0_wp * surf_usm_v(l)%emissivity(2,m) * sigma_sb *     &
-                                t_surf_window_v(l)%t(m) ** 3                         &
+              coef_window_2 = 4.0_wp * surf_usm_v(l)%emissivity(ind_wat_win,m) *&
+                                sigma_sb * t_surf_window_v(l)%t(m) ** 3        &
                               + lambda_surface_window + f_shf / exn(k)
-              coef_green_2 = 4.0_wp * surf_usm_v(l)%emissivity(1,m) * sigma_sb *       &
-                                t_surf_green_v(l)%t(m) ** 3                          &
+              coef_green_2 = 4.0_wp * surf_usm_v(l)%emissivity(ind_pav_green,m) *&
+                                sigma_sb * t_surf_green_v(l)%t(m) ** 3         &
                               + lambda_surface_green + f_shf / exn(k)
 
@@ -7482,7 +7492,7 @@
 !
 !--           Store surface temperature        
-              surf_usm_v(l)%pt_surface(m) =  ( surf_usm_v(l)%frac(0,m) * t_surf_v_p(l)%t(m)  &
-                                      + surf_usm_v(l)%frac(2,m) * t_surf_window_v_p(l)%t(m)  &
-                                      + surf_usm_v(l)%frac(1,m) * t_surf_green_v_p(l)%t(m) ) &
+              surf_usm_v(l)%pt_surface(m) =  ( surf_usm_v(l)%frac(ind_veg_wall,m) * t_surf_v_p(l)%t(m)  &
+                                      + surf_usm_v(l)%frac(ind_wat_win,m) * t_surf_window_v_p(l)%t(m)  &
+                                      + surf_usm_v(l)%frac(ind_pav_green,m) * t_surf_green_v_p(l)%t(m) ) &
                                       / exn(k) 
             
@@ -7523,15 +7533,15 @@
 !--           calculate fluxes
 !--           prognostic rad_net_l is used just for output!           
-              surf_usm_v(l)%rad_net_l(m) = surf_usm_v(l)%frac(0,m) *                             &
+              surf_usm_v(l)%rad_net_l(m) = surf_usm_v(l)%frac(ind_veg_wall,m) *                      &
                                            ( surf_usm_v(l)%rad_net_l(m) +                            &
                                            3.0_wp * sigma_sb *                                       &
                                            t_surf_v(l)%t(m)**4 - 4.0_wp * sigma_sb *                 &
                                            t_surf_v(l)%t(m)**3 * t_surf_v_p(l)%t(m) )                &
-                                         + surf_usm_v(l)%frac(2,m) *                              &
+                                         + surf_usm_v(l)%frac(ind_wat_win,m) *                       &
                                            ( surf_usm_v(l)%rad_net_l(m) +                            &
                                            3.0_wp * sigma_sb *                                       &
                                            t_surf_window_v(l)%t(m)**4 - 4.0_wp * sigma_sb *          &
                                            t_surf_window_v(l)%t(m)**3 * t_surf_window_v_p(l)%t(m) )  &
-                                         + surf_usm_v(l)%frac(1,m) *                            &
+                                         + surf_usm_v(l)%frac(ind_pav_green,m) *                     &
                                            ( surf_usm_v(l)%rad_net_l(m) +                            &
                                            3.0_wp * sigma_sb *                                       &
@@ -7549,9 +7559,9 @@
               surf_usm_v(l)%wshf_eb(m)   =                                     &
                  - f_shf  * ( surf_usm_v(l)%pt1(m) -                           &
-                 t_surf_v_p(l)%t(m) / exn(k) ) * surf_usm_v(l)%frac(0,m)       &
+                 t_surf_v_p(l)%t(m) / exn(k) ) * surf_usm_v(l)%frac(ind_veg_wall,m)       &
                  - f_shf_window  * ( surf_usm_v(l)%pt1(m) -                    &
-                 t_surf_window_v_p(l)%t(m) / exn(k) ) * surf_usm_v(l)%frac(2,m)&
+                 t_surf_window_v_p(l)%t(m) / exn(k) ) * surf_usm_v(l)%frac(ind_wat_win,m)&
                  - f_shf_green  * ( surf_usm_v(l)%pt1(m) -                     &
-                 t_surf_green_v_p(l)%t(m) / exn(k) ) * surf_usm_v(l)%frac(1,m)
+                 t_surf_green_v_p(l)%t(m) / exn(k) ) * surf_usm_v(l)%frac(ind_pav_green,m)
 
 !           
