Index: palm/trunk/SOURCE/chemistry_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/chemistry_model_mod.f90	(revision 4440)
+++ palm/trunk/SOURCE/chemistry_model_mod.f90	(revision 4441)
@@ -22,5 +22,6 @@
 ! Current revisions:
 ! -----------------
-! 
+! Change order of dimension in surface array %frac to allow for better 
+! vectorization.
 !
 ! Former revisions:
@@ -3533,5 +3534,5 @@
 !
 !--    Get land use for i,j and assign to DEPAC lu
-       IF ( surf_lsm_h%frac(ind_veg_wall,m) > 0 )  THEN
+       IF ( surf_lsm_h%frac(m,ind_veg_wall) > 0 )  THEN
           luv_palm = surf_lsm_h%vegetation_type(m)
           IF ( luv_palm == ind_luv_user )  THEN
@@ -3577,5 +3578,5 @@
        ENDIF
 
-       IF ( surf_lsm_h%frac(ind_pav_green,m) > 0 )  THEN
+       IF ( surf_lsm_h%frac(m,ind_pav_green) > 0 )  THEN
           lup_palm = surf_lsm_h%pavement_type(m)
           IF ( lup_palm == ind_lup_user )  THEN
@@ -3615,5 +3616,5 @@
        ENDIF
 
-       IF ( surf_lsm_h%frac(ind_wat_win,m) > 0 )  THEN
+       IF ( surf_lsm_h%frac(m,ind_wat_win) > 0 )  THEN
           luw_palm = surf_lsm_h%water_type(m)     
           IF ( luw_palm == ind_luw_user )  THEN
@@ -3675,5 +3676,5 @@
 !
 !--    Vegetation
-       IF ( surf_lsm_h%frac(ind_veg_wall,m) > 0 )  THEN
+       IF ( surf_lsm_h%frac(m,ind_veg_wall) > 0 )  THEN
 
 !
@@ -3812,5 +3813,5 @@
 !
 !--    Pavement
-       IF ( surf_lsm_h%frac(ind_pav_green,m) > 0 )  THEN
+       IF ( surf_lsm_h%frac(m,ind_pav_green) > 0 )  THEN
 !
 !--       No vegetation on pavements:
@@ -3939,5 +3940,5 @@
 !
 !--    Water
-       IF ( surf_lsm_h%frac(ind_wat_win,m) > 0 )  THEN
+       IF ( surf_lsm_h%frac(m,ind_wat_win) > 0 )  THEN
 !
 !--       No vegetation on water:
@@ -4073,7 +4074,7 @@
        DO  lsp = 1, nspec
 
-          bud(lsp) = surf_lsm_h%frac(ind_veg_wall,m) * bud_luv(lsp) + &
-               surf_lsm_h%frac(ind_pav_green,m) * bud_lup(lsp) + &
-               surf_lsm_h%frac(ind_wat_win,m) * bud_luw(lsp)
+          bud(lsp) = surf_lsm_h%frac(m,ind_veg_wall) * bud_luv(lsp) + &
+               surf_lsm_h%frac(m,ind_pav_green) * bud_lup(lsp) + &
+               surf_lsm_h%frac(m,ind_wat_win) * bud_luw(lsp)
 !
 !--       Compute new concentration:
@@ -4121,5 +4122,5 @@
 !
 !--    Get land use for i,j and assign to DEPAC lu
-       IF ( surf_usm_h%frac(ind_pav_green,m) > 0 )  THEN
+       IF ( surf_usm_h%frac(m,ind_pav_green) > 0 )  THEN
 !
 !--       For green urban surfaces (e.g. green roofs
@@ -4168,5 +4169,5 @@
        ENDIF
 
-       IF ( surf_usm_h%frac(ind_veg_wall,m) > 0 )  THEN
+       IF ( surf_usm_h%frac(m,ind_veg_wall) > 0 )  THEN
 !
 !--       For walls in USM assume concrete walls/roofs,
@@ -4210,5 +4211,5 @@
        ENDIF
 
-       IF ( surf_usm_h%frac(ind_wat_win,m) > 0 )  THEN
+       IF ( surf_usm_h%frac(m,ind_wat_win) > 0 )  THEN
 !
 !--       For windows in USM assume metal as this is
@@ -4295,5 +4296,5 @@
 !
 !--    Walls/roofs
-       IF ( surf_usm_h%frac(ind_veg_wall,m) > 0 )  THEN
+       IF ( surf_usm_h%frac(m,ind_veg_wall) > 0 )  THEN
 !
 !--       No vegetation on non-green walls:
@@ -4426,5 +4427,5 @@
 !
 !--    Green usm surfaces
-       IF ( surf_usm_h%frac(ind_pav_green,m) > 0 )  THEN
+       IF ( surf_usm_h%frac(m,ind_pav_green) > 0 )  THEN
 
 !
@@ -4564,5 +4565,5 @@
 !
 !--    Windows
-       IF ( surf_usm_h%frac(ind_wat_win,m) > 0 )  THEN
+       IF ( surf_usm_h%frac(m,ind_wat_win) > 0 )  THEN
 !
 !--       No vegetation on windows:
@@ -4696,7 +4697,7 @@
 
 
-          bud(lsp) = surf_usm_h%frac(ind_veg_wall,m) * bud_luu(lsp) + &
-               surf_usm_h%frac(ind_pav_green,m) * bud_lug(lsp) + &
-               surf_usm_h%frac(ind_wat_win,m) * bud_lud(lsp)
+          bud(lsp) = surf_usm_h%frac(m,ind_veg_wall) * bud_luu(lsp) + &
+               surf_usm_h%frac(m,ind_pav_green) * bud_lug(lsp) + &
+               surf_usm_h%frac(m,ind_wat_win) * bud_lud(lsp)
 !
 !--       Compute new concentration
Index: palm/trunk/SOURCE/data_output_2d.f90
===================================================================
--- palm/trunk/SOURCE/data_output_2d.f90	(revision 4440)
+++ palm/trunk/SOURCE/data_output_2d.f90	(revision 4441)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! ------------------
-! 
+! Change order of dimension in surface array %frac to allow for better 
+! vectorization.
 ! 
 ! Former revisions:
@@ -426,9 +427,9 @@
                       i                   = surf_usm_h%i(m)            
                       j                   = surf_usm_h%j(m)
-                      local_pf(i,j,nzb+1) = surf_usm_h%frac(ind_veg_wall,m)  *  &
+                      local_pf(i,j,nzb+1) = surf_usm_h%frac(m,ind_veg_wall)  *  &
                                             surf_usm_h%wghf_eb(m)        +      &
-                                            surf_usm_h%frac(ind_pav_green,m) *  &
+                                            surf_usm_h%frac(m,ind_pav_green) *  &
                                             surf_usm_h%wghf_eb_green(m)  +      &
-                                            surf_usm_h%frac(ind_wat_win,m)   *  &
+                                            surf_usm_h%frac(m,ind_wat_win)   *  &
                                             surf_usm_h%wghf_eb_window(m)
                    ENDDO
@@ -755,9 +756,9 @@
                       j   = surf_usm_h%j(m)
                       local_pf(i,j,nzb+1) =                                          &
-                                 ( surf_usm_h%frac(ind_veg_wall,m)  *                &
+                                 ( surf_usm_h%frac(m,ind_veg_wall)  *                &
                                    surf_usm_h%r_a(m)       +                         & 
-                                   surf_usm_h%frac(ind_pav_green,m) *                &
+                                   surf_usm_h%frac(m,ind_pav_green) *                &
                                    surf_usm_h%r_a_green(m) +                         & 
-                                   surf_usm_h%frac(ind_wat_win,m)   *                &
+                                   surf_usm_h%frac(m,ind_wat_win)   *                &
                                    surf_usm_h%r_a_window(m) )
                    ENDDO
Index: palm/trunk/SOURCE/flow_statistics.f90
===================================================================
--- palm/trunk/SOURCE/flow_statistics.f90	(revision 4440)
+++ palm/trunk/SOURCE/flow_statistics.f90	(revision 4441)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! ------------------
-! 
+! Change order of dimension in surface array %frac to allow for better 
+! vectorization.
 ! 
 ! Former revisions:
@@ -1089,11 +1090,11 @@
                       m = surf_def_h(0)%start_index(j,i)
                       sums_l(nzb,108,tn)  = sums_l(nzb,108,tn)  +              &
-                                   surf_def_h(0)%rrtm_aldif(0,m) * rmask(j,i,sr)
+                                   surf_def_h(0)%rrtm_aldif(m,0) * rmask(j,i,sr)
                       sums_l(nzb,109,tn) = sums_l(nzb,109,tn)  +               &
-                                   surf_def_h(0)%rrtm_aldir(0,m) * rmask(j,i,sr)
+                                   surf_def_h(0)%rrtm_aldir(m,0) * rmask(j,i,sr)
                       sums_l(nzb,110,tn) = sums_l(nzb,110,tn)  +               &
-                                   surf_def_h(0)%rrtm_asdif(0,m) * rmask(j,i,sr)
+                                   surf_def_h(0)%rrtm_asdif(m,0) * rmask(j,i,sr)
                       sums_l(nzb,111,tn) = sums_l(nzb,111,tn)  +               &
-                                   surf_def_h(0)%rrtm_asdir(0,m) * rmask(j,i,sr)
+                                   surf_def_h(0)%rrtm_asdir(m,0) * rmask(j,i,sr)
                    ENDIF
                    IF ( surf_lsm_h%end_index(j,i) >=                           &
@@ -1101,15 +1102,15 @@
                       m = surf_lsm_h%start_index(j,i)
                       sums_l(nzb,108,tn)  = sums_l(nzb,108,tn)  +              &
-                               SUM( surf_lsm_h%frac(:,m) *                     &
-                                    surf_lsm_h%rrtm_aldif(:,m) ) * rmask(j,i,sr)
+                               SUM( surf_lsm_h%frac(m,:) *                     &
+                                    surf_lsm_h%rrtm_aldif(m,:) ) * rmask(j,i,sr)
                       sums_l(nzb,109,tn) = sums_l(nzb,109,tn)  +               &
-                               SUM( surf_lsm_h%frac(:,m) *                     &
-                                    surf_lsm_h%rrtm_aldir(:,m) ) * rmask(j,i,sr)
+                               SUM( surf_lsm_h%frac(m,:) *                     &
+                                    surf_lsm_h%rrtm_aldir(m,:) ) * rmask(j,i,sr)
                       sums_l(nzb,110,tn) = sums_l(nzb,110,tn)  +               &
-                               SUM( surf_lsm_h%frac(:,m) *                     &
-                                    surf_lsm_h%rrtm_asdif(:,m) ) * rmask(j,i,sr)
+                               SUM( surf_lsm_h%frac(m,:) *                     &
+                                    surf_lsm_h%rrtm_asdif(m,:) ) * rmask(j,i,sr)
                       sums_l(nzb,111,tn) = sums_l(nzb,111,tn)  +               &
-                               SUM( surf_lsm_h%frac(:,m) *                     &
-                                    surf_lsm_h%rrtm_asdir(:,m) ) * rmask(j,i,sr)
+                               SUM( surf_lsm_h%frac(m,:) *                     &
+                                    surf_lsm_h%rrtm_asdir(m,:) ) * rmask(j,i,sr)
                    ENDIF
                    IF ( surf_usm_h%end_index(j,i) >=                           &
@@ -1117,15 +1118,15 @@
                       m = surf_usm_h%start_index(j,i)
                       sums_l(nzb,108,tn)  = sums_l(nzb,108,tn)  +              &
-                               SUM( surf_usm_h%frac(:,m) *                     &
-                                    surf_usm_h%rrtm_aldif(:,m) ) * rmask(j,i,sr)
+                               SUM( surf_usm_h%frac(m,:) *                     &
+                                    surf_usm_h%rrtm_aldif(m,:) ) * rmask(j,i,sr)
                       sums_l(nzb,109,tn) = sums_l(nzb,109,tn)  +               &
-                               SUM( surf_usm_h%frac(:,m) *                     &
-                                    surf_usm_h%rrtm_aldir(:,m) ) * rmask(j,i,sr)
+                               SUM( surf_usm_h%frac(m,:) *                     &
+                                    surf_usm_h%rrtm_aldir(m,:) ) * rmask(j,i,sr)
                       sums_l(nzb,110,tn) = sums_l(nzb,110,tn)  +               &
-                               SUM( surf_usm_h%frac(:,m) *                     &
-                                    surf_usm_h%rrtm_asdif(:,m) ) * rmask(j,i,sr)
+                               SUM( surf_usm_h%frac(m,:) *                     &
+                                    surf_usm_h%rrtm_asdif(m,:) ) * rmask(j,i,sr)
                       sums_l(nzb,111,tn) = sums_l(nzb,111,tn)  +               &
-                               SUM( surf_usm_h%frac(:,m) *                     &
-                                    surf_usm_h%rrtm_asdir(:,m) ) * rmask(j,i,sr)
+                               SUM( surf_usm_h%frac(m,:) *                     &
+                                    surf_usm_h%rrtm_asdir(m,:) ) * rmask(j,i,sr)
                    ENDIF
 
Index: palm/trunk/SOURCE/indoor_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/indoor_model_mod.f90	(revision 4440)
+++ palm/trunk/SOURCE/indoor_model_mod.f90	(revision 4441)
@@ -21,5 +21,6 @@
 ! Current revisions:
 ! -----------------
-! 
+! Change order of dimension in surface array %frac to allow for better 
+! vectorization.
 ! 
 ! Former revisions:
@@ -1225,5 +1226,5 @@
                                           ( buildings(nb)%num_facades_per_building_h +              &
                                             buildings(nb)%num_facades_per_building_v )                !< [m2] area of total facade
-             window_area_per_facade       = surf_usm_h%frac(ind_wat_win,m)  * facade_element_area     !< [m2] window area per facade element
+             window_area_per_facade       = surf_usm_h%frac(m,ind_wat_win)  * facade_element_area     !< [m2] window area per facade element
 
              buildings(nb)%net_floor_area = buildings(nb)%vol_tot / ( buildings(nb)%height_storey )
@@ -1275,6 +1276,6 @@
              near_facade_temperature = surf_usm_h%pt_10cm(m)
              indoor_wall_window_temperature =                                  &
-                  surf_usm_h%frac(ind_veg_wall,m) * t_wall_h(nzt_wall,m)       &
-                + surf_usm_h%frac(ind_wat_win,m)  * t_window_h(nzt_wall,m)
+                  surf_usm_h%frac(m,ind_veg_wall) * t_wall_h(nzt_wall,m)       &
+                + surf_usm_h%frac(m,ind_wat_win)  * t_window_h(nzt_wall,m)
 !
 !--          Solar thermal gains. If net_sw_in larger than sun-protection 
@@ -1435,5 +1436,5 @@
                                           ( buildings(nb)%num_facades_per_building_h +              &
                                             buildings(nb)%num_facades_per_building_v )                !< [m2] area of total facade
-             window_area_per_facade       = surf_usm_v(l)%frac(ind_wat_win,m)  * facade_element_area  !< [m2] window area per facade element
+             window_area_per_facade       = surf_usm_v(l)%frac(m,ind_wat_win)  * facade_element_area  !< [m2] window area per facade element
 
              buildings(nb)%net_floor_area = buildings(nb)%vol_tot / ( buildings(nb)%height_storey )
@@ -1486,6 +1487,6 @@
              near_facade_temperature = surf_usm_v(l)%pt_10cm(m)
              indoor_wall_window_temperature =                                                       &
-                  surf_usm_v(l)%frac(ind_veg_wall,m) * t_wall_v(l)%t(nzt_wall,m)                    &
-                + surf_usm_v(l)%frac(ind_wat_win,m)  * t_window_v(l)%t(nzt_wall,m)
+                  surf_usm_v(l)%frac(m,ind_veg_wall) * t_wall_v(l)%t(nzt_wall,m)                    &
+                + surf_usm_v(l)%frac(m,ind_wat_win)  * t_window_v(l)%t(nzt_wall,m)
 !
 !--          Solar thermal gains. If net_sw_in larger than sun-protection 
Index: palm/trunk/SOURCE/land_surface_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/land_surface_model_mod.f90	(revision 4440)
+++ palm/trunk/SOURCE/land_surface_model_mod.f90	(revision 4441)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! -----------------
-! 
+! Change order of dimension in surface arrays %frac, %emissivity and %albedo 
+! to allow for better vectorization in the radiation interactions.
 ! 
 ! Former revisions:
@@ -2502,27 +2503,27 @@
 !--    fraction.
 !--    Set default values at each surface element. 
-       ALLOCATE ( surf_lsm_h%albedo_type(0:2,1:surf_lsm_h%ns) )
-       ALLOCATE ( surf_lsm_h%emissivity(0:2,1:surf_lsm_h%ns) )
+       ALLOCATE ( surf_lsm_h%albedo_type(1:surf_lsm_h%ns,0:2) )
+       ALLOCATE ( surf_lsm_h%emissivity(1:surf_lsm_h%ns,0:2) )
 !
 !--    Initialize albedo type according to its default type, in order to set values
 !--    independent on default albedo_type in radiation model. 
-       surf_lsm_h%albedo_type(ind_veg_wall,:)  =                               &
+       surf_lsm_h%albedo_type(:,ind_veg_wall)  =                               &
                              INT( vegetation_pars(ind_v_at,vegetation_type) )
-       surf_lsm_h%albedo_type(ind_wat_win,:)   =                               &
+       surf_lsm_h%albedo_type(:,ind_wat_win)   =                               &
                              INT( water_pars(ind_w_at,water_type)           )
-       surf_lsm_h%albedo_type(ind_pav_green,:) =                               &
+       surf_lsm_h%albedo_type(:,ind_pav_green) =                               &
                              INT( pavement_pars(ind_p_at,pavement_type)     )
        surf_lsm_h%emissivity  = emissivity
        DO  l = 0, 3
-          ALLOCATE ( surf_lsm_v(l)%albedo_type(0:2,1:surf_lsm_v(l)%ns) )
-          ALLOCATE ( surf_lsm_v(l)%emissivity(0:2,1:surf_lsm_v(l)%ns)  )
+          ALLOCATE ( surf_lsm_v(l)%albedo_type(1:surf_lsm_v(l)%ns,0:2) )
+          ALLOCATE ( surf_lsm_v(l)%emissivity(1:surf_lsm_v(l)%ns,0:2)  )
 !
 !--       Initialize albedo type according to its default type, in order to 
 !--       set values independent on default albedo_type in radiation model. 
-          surf_lsm_v(l)%albedo_type(ind_veg_wall,:)  =                         &
+          surf_lsm_v(l)%albedo_type(:,ind_veg_wall)  =                         &
                              INT( vegetation_pars(ind_v_at,vegetation_type) )
-          surf_lsm_v(l)%albedo_type(ind_wat_win,:)   =                         &
+          surf_lsm_v(l)%albedo_type(:,ind_wat_win)   =                         &
                              INT( water_pars(ind_w_at,water_type)           )
-          surf_lsm_v(l)%albedo_type(ind_pav_green,:) =                         &
+          surf_lsm_v(l)%albedo_type(:,ind_pav_green) =                         &
                              INT( pavement_pars(ind_p_at,pavement_type)     )
           surf_lsm_v(l)%emissivity  = emissivity
@@ -2531,8 +2532,8 @@
 !--    Allocate arrays for relative surface fraction. 
 !--    0 - vegetation fraction, 2 - water fraction, 1 - pavement fraction
-       ALLOCATE( surf_lsm_h%frac(0:2,1:surf_lsm_h%ns) )
+       ALLOCATE( surf_lsm_h%frac(1:surf_lsm_h%ns,0:2) )
        surf_lsm_h%frac = 0.0_wp
        DO  l = 0, 3
-          ALLOCATE( surf_lsm_v(l)%frac(0:2,1:surf_lsm_v(l)%ns) )
+          ALLOCATE( surf_lsm_v(l)%frac(1:surf_lsm_v(l)%ns,0:2) )
           surf_lsm_v(l)%frac = 0.0_wp
        ENDDO
@@ -2588,8 +2589,8 @@
          
              surf_lsm_h%vegetation_surface = .TRUE.
-             surf_lsm_h%frac(ind_veg_wall,:) = 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_wall,:) = 1.0_wp
+                surf_lsm_v(l)%frac(:,ind_veg_wall) = 1.0_wp
              ENDDO
    
@@ -2597,10 +2598,10 @@
              
              surf_lsm_h%water_surface = .TRUE.
-             surf_lsm_h%frac(ind_wat_win,:) = 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_win,:) = 1.0_wp
+                surf_lsm_v(l)%frac(:,ind_wat_win) = 1.0_wp
              ENDDO
 
@@ -2608,8 +2609,8 @@
              
              surf_lsm_h%pavement_surface = .TRUE.
-                surf_lsm_h%frac(ind_pav_green,:) = 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_green,:) = 1.0_wp
+                surf_lsm_v(l)%frac(:,ind_pav_green) = 1.0_wp
              ENDDO
 
@@ -2745,15 +2746,15 @@
              IF ( surface_fraction_f%frac(ind_veg_wall,j,i) /=                 &
                   surface_fraction_f%fill )  THEN
-                surf_lsm_h%frac(ind_veg_wall,m)  =                             &
+                surf_lsm_h%frac(m,ind_veg_wall)  =                             &
                                     surface_fraction_f%frac(ind_veg_wall,j,i)
              ENDIF
              IF ( surface_fraction_f%frac(ind_pav_green,j,i) /=                &
                   surface_fraction_f%fill )  THEN
-                surf_lsm_h%frac(ind_pav_green,m) =                             &
+                surf_lsm_h%frac(m,ind_pav_green) =                             &
                                     surface_fraction_f%frac(ind_pav_green,j,i)
              ENDIF
              IF ( surface_fraction_f%frac(ind_wat_win,j,i) /=                  &
                   surface_fraction_f%fill )  THEN
-                surf_lsm_h%frac(ind_wat_win,m)   =                             &
+                surf_lsm_h%frac(m,ind_wat_win)   =                             &
                                     surface_fraction_f%frac(ind_wat_win,j,i)
              ENDIF
@@ -2761,5 +2762,5 @@
 !--          Check if sum of relative fractions is zero. This case, give an
 !--          error message.
-             IF ( SUM ( surf_lsm_h%frac(:,m) ) == 0.0_wp )  THEN
+             IF ( SUM ( surf_lsm_h%frac(m,:) ) == 0.0_wp )  THEN
                 WRITE( message_string, * )                                     &
                                  'surface fractions at grid point (j,i) = (',  &
@@ -2773,8 +2774,8 @@
 !--          fractions to one. Note, at the moment no tile approach is 
 !--          implemented, so that relative fractions are either 1 or zero.
-             IF ( SUM ( surf_lsm_h%frac(:,m) ) > 1.0_wp  .OR.                  &
-                  SUM ( surf_lsm_h%frac(:,m) ) < 1.0_wp  )  THEN
-                surf_lsm_h%frac(:,m) = surf_lsm_h%frac(:,m) /                  &
-                                       SUM ( surf_lsm_h%frac(:,m) )
+             IF ( SUM ( surf_lsm_h%frac(m,:) ) > 1.0_wp  .OR.                  &
+                  SUM ( surf_lsm_h%frac(m,:) ) < 1.0_wp  )  THEN
+                surf_lsm_h%frac(m,:) = surf_lsm_h%frac(m,:) /                  &
+                                       SUM ( surf_lsm_h%frac(m,:) )
 
              ENDIF
@@ -2791,15 +2792,15 @@
                 IF ( surface_fraction_f%frac(ind_veg_wall,j,i) /=              &
                      surface_fraction_f%fill )  THEN
-                   surf_lsm_v(l)%frac(ind_veg_wall,m)  =                       &
+                   surf_lsm_v(l)%frac(m,ind_veg_wall)  =                       &
                                     surface_fraction_f%frac(ind_veg_wall,j,i)
                 ENDIF
                 IF ( surface_fraction_f%frac(ind_pav_green,j,i) /=             &
                      surface_fraction_f%fill )  THEN
-                   surf_lsm_v(l)%frac(ind_pav_green,m)  =                      &
+                   surf_lsm_v(l)%frac(m,ind_pav_green)  =                      &
                                     surface_fraction_f%frac(ind_pav_green,j,i)
                 ENDIF
                 IF ( surface_fraction_f%frac(ind_wat_win,j,i) /=               &
                      surface_fraction_f%fill )  THEN
-                   surf_lsm_v(l)%frac(ind_wat_win,m)  =                        &
+                   surf_lsm_v(l)%frac(m,ind_wat_win)  =                        &
                                     surface_fraction_f%frac(ind_wat_win,j,i)
                 ENDIF
@@ -2807,5 +2808,5 @@
 !--             Check if sum of relative fractions is zero. This case, give an
 !--             error message.
-                IF ( SUM ( surf_lsm_v(l)%frac(:,m) ) == 0.0_wp )  THEN
+                IF ( SUM ( surf_lsm_v(l)%frac(m,:) ) == 0.0_wp )  THEN
                    WRITE( message_string, * )                                  &
                                  'surface fractions at grid point (j,i) = (',  &
@@ -2819,8 +2820,8 @@
 !--             fractions to one. Note, at the moment no tile approach is 
 !--             implemented, so that relative fractions are either 1 or zero.
-                IF ( SUM ( surf_lsm_v(l)%frac(:,m) ) > 1.0_wp  .OR.            &
-                     SUM ( surf_lsm_v(l)%frac(:,m) ) < 1.0_wp  )  THEN
-                   surf_lsm_v(l)%frac(:,m) = surf_lsm_v(l)%frac(:,m) /         &
-                                             SUM ( surf_lsm_v(l)%frac(:,m) )
+                IF ( SUM ( surf_lsm_v(l)%frac(m,:) ) > 1.0_wp  .OR.            &
+                     SUM ( surf_lsm_v(l)%frac(m,:) ) < 1.0_wp  )  THEN
+                   surf_lsm_v(l)%frac(m,:) = surf_lsm_v(l)%frac(m,:) /         &
+                                             SUM ( surf_lsm_v(l)%frac(m,:) )
 
                 ENDIF
@@ -2834,9 +2835,9 @@
 
              IF ( vegetation_type_f%var(j,i) /= vegetation_type_f%fill )       &        
-                surf_lsm_h%frac(ind_veg_wall,m)  = 1.0_wp
+                surf_lsm_h%frac(m,ind_veg_wall)  = 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 
+                surf_lsm_h%frac(m,ind_pav_green) = 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       
+                surf_lsm_h%frac(m,ind_wat_win)   = 1.0_wp       
           ENDDO
           DO  l = 0, 3
@@ -2848,9 +2849,9 @@
      
                 IF ( vegetation_type_f%var(j,i) /= vegetation_type_f%fill )    &        
-                   surf_lsm_v(l)%frac(ind_veg_wall,m)  = 1.0_wp
+                   surf_lsm_v(l)%frac(m,ind_veg_wall)  = 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 
+                   surf_lsm_v(l)%frac(m,ind_pav_green) = 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     
+                   surf_lsm_v(l)%frac(m,ind_wat_win)   = 1.0_wp     
              ENDDO
           ENDDO
@@ -3218,6 +3219,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_wall,m) = albedo_type
-             surf_lsm_h%emissivity(ind_veg_wall,m)  = emissivity
+             surf_lsm_h%albedo_type(m,ind_veg_wall) = albedo_type
+             surf_lsm_h%emissivity(m,ind_veg_wall)  = emissivity
              
              surf_lsm_h%vegetation_type(m)      = vegetation_type
@@ -3247,6 +3248,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_wall,m) = albedo_type
-                surf_lsm_v(l)%emissivity(ind_veg_wall,m)  = emissivity
+                surf_lsm_v(l)%albedo_type(m,ind_veg_wall) = albedo_type
+                surf_lsm_v(l)%emissivity(m,ind_veg_wall)  = emissivity
                 
                 surf_lsm_v(l)%vegetation_type(m)      = vegetation_type
@@ -3285,6 +3286,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_wall,m) = INT( vegetation_pars(ind_v_at,st) )
-                surf_lsm_h%emissivity(ind_veg_wall,m)  = vegetation_pars(ind_v_emis,st)
+                surf_lsm_h%albedo_type(m,ind_veg_wall) = INT( vegetation_pars(ind_v_at,st) )
+                surf_lsm_h%emissivity(m,ind_veg_wall)  = vegetation_pars(ind_v_emis,st)
                 
                 surf_lsm_h%vegetation_type(m)      = st
@@ -3314,6 +3315,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_wall,m) = INT( vegetation_pars(ind_v_at,st) )
-                   surf_lsm_v(l)%emissivity(ind_veg_wall,m)  = vegetation_pars(ind_v_emis,st)
+                   surf_lsm_v(l)%albedo_type(m,ind_veg_wall) = INT( vegetation_pars(ind_v_at,st) )
+                   surf_lsm_v(l)%emissivity(m,ind_veg_wall)  = vegetation_pars(ind_v_emis,st)
                    
                    surf_lsm_v(l)%vegetation_type(m)      = st
@@ -3393,9 +3394,9 @@
                 IF ( vegetation_pars_f%pars_xy(ind_v_at,j,i) /=                &
                      vegetation_pars_f%fill )                                  &
-                   surf_lsm_h%albedo_type(ind_veg_wall,m) =                    &
+                   surf_lsm_h%albedo_type(m,ind_veg_wall) =                    &
                                    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_wall,m)  =                    &
+                   surf_lsm_h%emissivity(m,ind_veg_wall)  =                    &
                                    vegetation_pars_f%pars_xy(ind_v_emis,j,i)
              ENDIF
@@ -3469,9 +3470,9 @@
                    IF ( vegetation_pars_f%pars_xy(ind_v_at,j,i) /=             &
                         vegetation_pars_f%fill )                               &
-                      surf_lsm_v(l)%albedo_type(ind_veg_wall,m) =              &
+                      surf_lsm_v(l)%albedo_type(m,ind_veg_wall) =              &
                                    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_wall,m)  =              &
+                      surf_lsm_v(l)%emissivity(m,ind_veg_wall)  =              &
                                    vegetation_pars_f%pars_xy(ind_v_emis,j,i)
                 ENDIF
@@ -3523,6 +3524,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_win,m) = albedo_type
-             surf_lsm_h%emissivity(ind_wat_win,m)  = emissivity
+             surf_lsm_h%albedo_type(m,ind_wat_win) = albedo_type
+             surf_lsm_h%emissivity(m,ind_wat_win)  = emissivity
              
              surf_lsm_h%water_type(m)      = water_type
@@ -3544,6 +3545,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_win,m) = albedo_type
-                surf_lsm_v(l)%emissivity(ind_wat_win,m)  = emissivity
+                surf_lsm_v(l)%albedo_type(m,ind_wat_win) = albedo_type
+                surf_lsm_v(l)%emissivity(m,ind_wat_win)  = emissivity
                 
                 surf_lsm_v(l)%water_type(m)      = water_type
@@ -3577,6 +3578,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_win,m) = INT( water_pars(ind_w_at,st) )
-                surf_lsm_h%emissivity(ind_wat_win,m)  = water_pars(ind_w_emis,st)
+                surf_lsm_h%albedo_type(m,ind_wat_win) = INT( water_pars(ind_w_at,st) )
+                surf_lsm_h%emissivity(m,ind_wat_win)  = water_pars(ind_w_emis,st)
                 
                 surf_lsm_h%water_type(m)      = st
@@ -3605,7 +3606,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_win,m) =                  &
+                   surf_lsm_v(l)%albedo_type(m,ind_wat_win) =                  &
                                                   INT( water_pars(ind_w_at,st) )
-                   surf_lsm_v(l)%emissivity(ind_wat_win,m)  =                  &
+                   surf_lsm_v(l)%emissivity(m,ind_wat_win)  =                  &
                                                   water_pars(ind_w_emis,st)
                                                   
@@ -3664,10 +3665,10 @@
                 IF ( water_pars_f%pars_xy(ind_w_at,j,i) /=                     &
                      water_pars_f%fill )                                       &
-                   surf_lsm_h%albedo_type(ind_wat_win,m) =                     &
+                   surf_lsm_h%albedo_type(m,ind_wat_win) =                     &
                                        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_win,m) =                      &
+                   surf_lsm_h%emissivity(m,ind_wat_win) =                      &
                                           water_pars_f%pars_xy(ind_w_emis,j,i)  
              ENDIF
@@ -3724,10 +3725,10 @@
                    IF ( water_pars_f%pars_xy(ind_w_at,j,i) /=                  &
                         water_pars_f%fill )                                    &
-                      surf_lsm_v(l)%albedo_type(ind_wat_win,m) =               &
+                      surf_lsm_v(l)%albedo_type(m,ind_wat_win) =               &
                                       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_win,m)  =               &
+                      surf_lsm_v(l)%emissivity(m,ind_wat_win)  =               &
                                       water_pars_f%pars_xy(ind_w_emis,j,i)  
                 ENDIF
@@ -3810,6 +3811,6 @@
                                                         * 0.25_wp                                   
 
-             surf_lsm_h%albedo_type(ind_pav_green,m) = albedo_type
-             surf_lsm_h%emissivity(ind_pav_green,m)  = emissivity      
+             surf_lsm_h%albedo_type(m,ind_pav_green) = albedo_type
+             surf_lsm_h%emissivity(m,ind_pav_green)  = emissivity      
              
              surf_lsm_h%pavement_type(m)      = pavement_type
@@ -3848,6 +3849,6 @@
                                                         * 0.25_wp                                      
 
-                surf_lsm_v(l)%albedo_type(ind_pav_green,m) = albedo_type
-                surf_lsm_v(l)%emissivity(ind_pav_green,m)  = emissivity
+                surf_lsm_v(l)%albedo_type(m,ind_pav_green) = albedo_type
+                surf_lsm_v(l)%emissivity(m,ind_pav_green)  = emissivity
                 
                 surf_lsm_v(l)%pavement_type(m)      = pavement_type
@@ -3908,6 +3909,6 @@
                                                         * dz_soil(nzb_soil)    &
                                                         * 0.25_wp                               
-                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)  
+                surf_lsm_h%albedo_type(m,ind_pav_green) = INT( pavement_pars(ind_p_at,st) )
+                surf_lsm_h%emissivity(m,ind_pav_green)  = pavement_pars(ind_p_emis,st)  
                 
                 surf_lsm_h%pavement_type(m)      = st
@@ -3961,7 +3962,7 @@
                                                         * dz_soil(nzb_soil)    &
                                                         * 0.25_wp                                    
-                   surf_lsm_v(l)%albedo_type(ind_pav_green,m) =                &
+                   surf_lsm_v(l)%albedo_type(m,ind_pav_green) =                &
                                               INT( pavement_pars(ind_p_at,st) )
-                   surf_lsm_v(l)%emissivity(ind_pav_green,m)  =                &
+                   surf_lsm_v(l)%emissivity(m,ind_pav_green)  =                &
                                               pavement_pars(ind_p_emis,st)  
                                               
@@ -4030,9 +4031,9 @@
                 IF ( pavement_pars_f%pars_xy(ind_p_at,j,i) /=                  &
                      pavement_pars_f%fill )                                    &
-                   surf_lsm_h%albedo_type(ind_pav_green,m) =                   &
+                   surf_lsm_h%albedo_type(m,ind_pav_green) =                   &
                                    INT( pavement_pars_f%pars_xy(ind_p_at,j,i) )
                 IF ( pavement_pars_f%pars_xy(ind_p_emis,j,i) /=                &
                      pavement_pars_f%fill )                                    &
-                   surf_lsm_h%emissivity(ind_pav_green,m)  =                   &
+                   surf_lsm_h%emissivity(m,ind_pav_green)  =                   &
                                    pavement_pars_f%pars_xy(ind_p_emis,j,i)
              ENDIF 
@@ -4090,10 +4091,10 @@
                    IF ( pavement_pars_f%pars_xy(ind_p_at,j,i) /=               &
                         pavement_pars_f%fill )                                 &
-                      surf_lsm_v(l)%albedo_type(ind_pav_green,m) =             &
+                      surf_lsm_v(l)%albedo_type(m,ind_pav_green) =             &
                                    INT( pavement_pars_f%pars_xy(ind_p_at,j,i) )
 
                    IF ( pavement_pars_f%pars_xy(ind_p_emis,j,i) /=             &
                         pavement_pars_f%fill )                                 &
-                      surf_lsm_v(l)%emissivity(ind_pav_green,m)  =             &
+                      surf_lsm_v(l)%emissivity(m,ind_pav_green)  =             &
                                    pavement_pars_f%pars_xy(ind_p_emis,j,i)  
                 ENDIF 
Index: palm/trunk/SOURCE/radiation_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/radiation_model_mod.f90	(revision 4440)
+++ palm/trunk/SOURCE/radiation_model_mod.f90	(revision 4441)
@@ -23,5 +23,7 @@
 ! Current revisions:
 ! ------------------
-! 
+! - Change order of dimension in surface arrays %frac, %emissivity and %albedo 
+!   to allow for better vectorization in the radiation interactions.
+! - Minor formatting issues
 ! 
 ! Former revisions:
@@ -1831,9 +1833,9 @@
 !--       via namelist paramter, unless not already allocated.
           IF ( .NOT. ALLOCATED(surf_lsm_h%albedo) )  THEN
-             ALLOCATE( surf_lsm_h%albedo(0:2,1:surf_lsm_h%ns)     )
+             ALLOCATE( surf_lsm_h%albedo(1:surf_lsm_h%ns,0:2)     )
              surf_lsm_h%albedo    = albedo
           ENDIF
           IF ( .NOT. ALLOCATED(surf_usm_h%albedo) )  THEN
-             ALLOCATE( surf_usm_h%albedo(0:2,1:surf_usm_h%ns)     )
+             ALLOCATE( surf_usm_h%albedo(1:surf_usm_h%ns,0:2)     )
              surf_usm_h%albedo    = albedo
           ENDIF
@@ -1841,9 +1843,9 @@
           DO  l = 0, 3
              IF ( .NOT. ALLOCATED( surf_lsm_v(l)%albedo ) )  THEN
-                ALLOCATE( surf_lsm_v(l)%albedo(0:2,1:surf_lsm_v(l)%ns) )
+                ALLOCATE( surf_lsm_v(l)%albedo(1:surf_lsm_v(l)%ns,0:2) )
                 surf_lsm_v(l)%albedo = albedo
              ENDIF
              IF ( .NOT. ALLOCATED( surf_usm_v(l)%albedo ) )  THEN
-                ALLOCATE( surf_usm_v(l)%albedo(0:2,1:surf_usm_v(l)%ns) )
+                ALLOCATE( surf_usm_v(l)%albedo(1:surf_usm_v(l)%ns,0:2) )
                 surf_usm_v(l)%albedo = albedo
              ENDIF
@@ -1855,48 +1857,48 @@
 !--       albedo won't be overwritten. 
           DO  m = 1, surf_lsm_h%ns
-             IF ( surf_lsm_h%albedo_type(ind_veg_wall,m) /= 0 )                &
-                surf_lsm_h%albedo(ind_veg_wall,m) =                            &
-                           albedo_pars(0,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(0,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(0,surf_lsm_h%albedo_type(ind_wat_win,m))
+             IF ( surf_lsm_h%albedo_type(m,ind_veg_wall) /= 0 )                &
+                surf_lsm_h%albedo(m,ind_veg_wall) =                            &
+                           albedo_pars(0,surf_lsm_h%albedo_type(m,ind_veg_wall))
+             IF ( surf_lsm_h%albedo_type(m,ind_pav_green) /= 0 )               &
+                surf_lsm_h%albedo(m,ind_pav_green) =                           &
+                           albedo_pars(0,surf_lsm_h%albedo_type(m,ind_pav_green))
+             IF ( surf_lsm_h%albedo_type(m,ind_wat_win) /= 0 )                 &
+                surf_lsm_h%albedo(m,ind_wat_win) =                             &
+                           albedo_pars(0,surf_lsm_h%albedo_type(m,ind_wat_win))
           ENDDO
           DO  m = 1, surf_usm_h%ns
-             IF ( surf_usm_h%albedo_type(ind_veg_wall,m) /= 0 )                &
-                surf_usm_h%albedo(ind_veg_wall,m) =                            &
-                           albedo_pars(0,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(0,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(0,surf_usm_h%albedo_type(ind_wat_win,m))
+             IF ( surf_usm_h%albedo_type(m,ind_veg_wall) /= 0 )                &
+                surf_usm_h%albedo(m,ind_veg_wall) =                            &
+                           albedo_pars(0,surf_usm_h%albedo_type(m,ind_veg_wall))
+             IF ( surf_usm_h%albedo_type(m,ind_pav_green) /= 0 )               &
+                surf_usm_h%albedo(m,ind_pav_green) =                           &
+                           albedo_pars(0,surf_usm_h%albedo_type(m,ind_pav_green))
+             IF ( surf_usm_h%albedo_type(m,ind_wat_win) /= 0 )                 &
+                surf_usm_h%albedo(m,ind_wat_win) =                             &
+                           albedo_pars(0,surf_usm_h%albedo_type(m,ind_wat_win))
           ENDDO
 
           DO  l = 0, 3
              DO  m = 1, surf_lsm_v(l)%ns
-                IF ( surf_lsm_v(l)%albedo_type(ind_veg_wall,m) /= 0 )          &
-                   surf_lsm_v(l)%albedo(ind_veg_wall,m) =                      &
-                        albedo_pars(0,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(0,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(0,surf_lsm_v(l)%albedo_type(ind_wat_win,m))
+                IF ( surf_lsm_v(l)%albedo_type(m,ind_veg_wall) /= 0 )          &
+                   surf_lsm_v(l)%albedo(m,ind_veg_wall) =                      &
+                        albedo_pars(0,surf_lsm_v(l)%albedo_type(m,ind_veg_wall))
+                IF ( surf_lsm_v(l)%albedo_type(m,ind_pav_green) /= 0 )         &
+                   surf_lsm_v(l)%albedo(m,ind_pav_green) =                     &
+                        albedo_pars(0,surf_lsm_v(l)%albedo_type(m,ind_pav_green))
+                IF ( surf_lsm_v(l)%albedo_type(m,ind_wat_win) /= 0 )           &
+                   surf_lsm_v(l)%albedo(m,ind_wat_win) =                       &
+                        albedo_pars(0,surf_lsm_v(l)%albedo_type(m,ind_wat_win))
              ENDDO
              DO  m = 1, surf_usm_v(l)%ns
-                IF ( surf_usm_v(l)%albedo_type(ind_veg_wall,m) /= 0 )          &
-                   surf_usm_v(l)%albedo(ind_veg_wall,m) =                      &
-                        albedo_pars(0,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(0,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(0,surf_usm_v(l)%albedo_type(ind_wat_win,m))
+                IF ( surf_usm_v(l)%albedo_type(m,ind_veg_wall) /= 0 )          &
+                   surf_usm_v(l)%albedo(m,ind_veg_wall) =                      &
+                        albedo_pars(0,surf_usm_v(l)%albedo_type(m,ind_veg_wall))
+                IF ( surf_usm_v(l)%albedo_type(m,ind_pav_green) /= 0 )         &
+                   surf_usm_v(l)%albedo(m,ind_pav_green) =                     &
+                        albedo_pars(0,surf_usm_v(l)%albedo_type(m,ind_pav_green))
+                IF ( surf_usm_v(l)%albedo_type(m,ind_wat_win) /= 0 )           &
+                   surf_usm_v(l)%albedo(m,ind_wat_win) =                       &
+                        albedo_pars(0,surf_usm_v(l)%albedo_type(m,ind_wat_win))
              ENDDO
           ENDDO
@@ -1913,7 +1915,7 @@
                 j = surf_lsm_h%j(m)
                 IF ( albedo_pars_f%pars_xy(0,j,i) /= albedo_pars_f%fill )  THEN
-                   surf_lsm_h%albedo(ind_veg_wall,m)  = albedo_pars_f%pars_xy(0,j,i)
-                   surf_lsm_h%albedo(ind_pav_green,m) = albedo_pars_f%pars_xy(0,j,i)
-                   surf_lsm_h%albedo(ind_wat_win,m)   = albedo_pars_f%pars_xy(0,j,i)
+                   surf_lsm_h%albedo(m,ind_veg_wall)  = albedo_pars_f%pars_xy(0,j,i)
+                   surf_lsm_h%albedo(m,ind_pav_green) = albedo_pars_f%pars_xy(0,j,i)
+                   surf_lsm_h%albedo(m,ind_wat_win)   = albedo_pars_f%pars_xy(0,j,i)
                 ENDIF
              ENDDO
@@ -1922,7 +1924,7 @@
                 j = surf_usm_h%j(m)
                 IF ( albedo_pars_f%pars_xy(0,j,i) /= albedo_pars_f%fill )  THEN
-                   surf_usm_h%albedo(ind_veg_wall,m)  = albedo_pars_f%pars_xy(0,j,i)
-                   surf_usm_h%albedo(ind_pav_green,m) = albedo_pars_f%pars_xy(0,j,i)
-                   surf_usm_h%albedo(ind_wat_win,m)   = albedo_pars_f%pars_xy(0,j,i)
+                   surf_usm_h%albedo(m,ind_veg_wall)  = albedo_pars_f%pars_xy(0,j,i)
+                   surf_usm_h%albedo(m,ind_pav_green) = albedo_pars_f%pars_xy(0,j,i)
+                   surf_usm_h%albedo(m,ind_wat_win)   = albedo_pars_f%pars_xy(0,j,i)
                 ENDIF
              ENDDO 
@@ -1937,7 +1939,7 @@
                    j = surf_lsm_v(l)%j(m) + joff
                    IF ( albedo_pars_f%pars_xy(0,j,i) /= albedo_pars_f%fill )  THEN
-                      surf_lsm_v(l)%albedo(ind_veg_wall,m) = albedo_pars_f%pars_xy(0,j,i)
-                      surf_lsm_v(l)%albedo(ind_pav_green,m) = albedo_pars_f%pars_xy(0,j,i)
-                      surf_lsm_v(l)%albedo(ind_wat_win,m) = albedo_pars_f%pars_xy(0,j,i)
+                      surf_lsm_v(l)%albedo(m,ind_veg_wall) = albedo_pars_f%pars_xy(0,j,i)
+                      surf_lsm_v(l)%albedo(m,ind_pav_green) = albedo_pars_f%pars_xy(0,j,i)
+                      surf_lsm_v(l)%albedo(m,ind_wat_win) = albedo_pars_f%pars_xy(0,j,i)
                    ENDIF
                 ENDDO
@@ -1949,7 +1951,7 @@
                    j = surf_usm_v(l)%j(m) + joff
                    IF ( albedo_pars_f%pars_xy(0,j,i) /= albedo_pars_f%fill )  THEN
-                      surf_usm_v(l)%albedo(ind_veg_wall,m) = albedo_pars_f%pars_xy(0,j,i)
-                      surf_usm_v(l)%albedo(ind_pav_green,m) = albedo_pars_f%pars_xy(0,j,i)
-                      surf_usm_v(l)%albedo(ind_wat_win,m) = albedo_pars_f%pars_xy(0,j,i)
+                      surf_usm_v(l)%albedo(m,ind_veg_wall) = albedo_pars_f%pars_xy(0,j,i)
+                      surf_usm_v(l)%albedo(m,ind_pav_green) = albedo_pars_f%pars_xy(0,j,i)
+                      surf_usm_v(l)%albedo(m,ind_wat_win) = albedo_pars_f%pars_xy(0,j,i)
                    ENDIF
                 ENDDO
@@ -1975,21 +1977,21 @@
                       IF ( building_surface_pars_f%pars(ind_s_alb_b_wall,is) /=      &
                            building_surface_pars_f%fill )  THEN
-                         surf_usm_h%albedo(ind_veg_wall,m) =                         &
+                         surf_usm_h%albedo(m,ind_veg_wall) =                         &
                                   building_surface_pars_f%pars(ind_s_alb_b_wall,is)
-                         surf_usm_h%albedo_type(ind_veg_wall,m) = 0
+                         surf_usm_h%albedo_type(m,ind_veg_wall) = 0
                       ENDIF
 
                       IF ( building_surface_pars_f%pars(ind_s_alb_b_win,is) /=       &
                            building_surface_pars_f%fill )  THEN
-                         surf_usm_h%albedo(ind_wat_win,m) =                          &
+                         surf_usm_h%albedo(m,ind_wat_win) =                          &
                                   building_surface_pars_f%pars(ind_s_alb_b_win,is)
-                         surf_usm_h%albedo_type(ind_wat_win,m) = 0
+                         surf_usm_h%albedo_type(m,ind_wat_win) = 0
                       ENDIF
 
                       IF ( building_surface_pars_f%pars(ind_s_alb_b_green,is) /=     &
                            building_surface_pars_f%fill )  THEN
-                         surf_usm_h%albedo(ind_pav_green,m) =                        &
+                         surf_usm_h%albedo(m,ind_pav_green) =                        &
                                   building_surface_pars_f%pars(ind_s_alb_b_green,is)
-                         surf_usm_h%albedo_type(ind_pav_green,m) = 0
+                         surf_usm_h%albedo_type(m,ind_pav_green) = 0
                       ENDIF
 
@@ -2014,21 +2016,21 @@
                          IF ( building_surface_pars_f%pars(ind_s_alb_b_wall,is) /=      &
                               building_surface_pars_f%fill )  THEN
-                            surf_usm_v(l)%albedo(ind_veg_wall,m) =                      &
+                            surf_usm_v(l)%albedo(m,ind_veg_wall) =                      &
                                      building_surface_pars_f%pars(ind_s_alb_b_wall,is)
-                            surf_usm_v(l)%albedo_type(ind_veg_wall,m) = 0
+                            surf_usm_v(l)%albedo_type(m,ind_veg_wall) = 0
                          ENDIF
 
                          IF ( building_surface_pars_f%pars(ind_s_alb_b_win,is) /=       &
                               building_surface_pars_f%fill )  THEN
-                            surf_usm_v(l)%albedo(ind_wat_win,m) =                       &
+                            surf_usm_v(l)%albedo(m,ind_wat_win) =                       &
                                      building_surface_pars_f%pars(ind_s_alb_b_win,is)
-                            surf_usm_v(l)%albedo_type(ind_wat_win,m) = 0
+                            surf_usm_v(l)%albedo_type(m,ind_wat_win) = 0
                          ENDIF
 
                          IF ( building_surface_pars_f%pars(ind_s_alb_b_green,is) /=     &
                               building_surface_pars_f%fill )  THEN
-                            surf_usm_v(l)%albedo(ind_pav_green,m) =                     &
+                            surf_usm_v(l)%albedo(m,ind_pav_green) =                     &
                                      building_surface_pars_f%pars(ind_s_alb_b_green,is)
-                            surf_usm_v(l)%albedo_type(ind_pav_green,m) = 0
+                            surf_usm_v(l)%albedo_type(m,ind_pav_green) = 0
                          ENDIF
 
@@ -2047,21 +2049,21 @@
 !--       for wall/green/window (USM) or vegetation/pavement/water surfaces
 !--       (LSM). 
-          ALLOCATE ( surf_lsm_h%aldif(0:2,1:surf_lsm_h%ns)       )
-          ALLOCATE ( surf_lsm_h%aldir(0:2,1:surf_lsm_h%ns)       )
-          ALLOCATE ( surf_lsm_h%asdif(0:2,1:surf_lsm_h%ns)       )
-          ALLOCATE ( surf_lsm_h%asdir(0:2,1:surf_lsm_h%ns)       )
-          ALLOCATE ( surf_lsm_h%rrtm_aldif(0:2,1:surf_lsm_h%ns)  )
-          ALLOCATE ( surf_lsm_h%rrtm_aldir(0:2,1:surf_lsm_h%ns)  )
-          ALLOCATE ( surf_lsm_h%rrtm_asdif(0:2,1:surf_lsm_h%ns)  )
-          ALLOCATE ( surf_lsm_h%rrtm_asdir(0:2,1:surf_lsm_h%ns)  )
-
-          ALLOCATE ( surf_usm_h%aldif(0:2,1:surf_usm_h%ns)       )
-          ALLOCATE ( surf_usm_h%aldir(0:2,1:surf_usm_h%ns)       )
-          ALLOCATE ( surf_usm_h%asdif(0:2,1:surf_usm_h%ns)       )
-          ALLOCATE ( surf_usm_h%asdir(0:2,1:surf_usm_h%ns)       )
-          ALLOCATE ( surf_usm_h%rrtm_aldif(0:2,1:surf_usm_h%ns)  )
-          ALLOCATE ( surf_usm_h%rrtm_aldir(0:2,1:surf_usm_h%ns)  )
-          ALLOCATE ( surf_usm_h%rrtm_asdif(0:2,1:surf_usm_h%ns)  )
-          ALLOCATE ( surf_usm_h%rrtm_asdir(0:2,1:surf_usm_h%ns)  )
+          ALLOCATE ( surf_lsm_h%aldif(1:surf_lsm_h%ns,0:2)       )
+          ALLOCATE ( surf_lsm_h%aldir(1:surf_lsm_h%ns,0:2)       )
+          ALLOCATE ( surf_lsm_h%asdif(1:surf_lsm_h%ns,0:2)       )
+          ALLOCATE ( surf_lsm_h%asdir(1:surf_lsm_h%ns,0:2)       )
+          ALLOCATE ( surf_lsm_h%rrtm_aldif(1:surf_lsm_h%ns,0:2)  )
+          ALLOCATE ( surf_lsm_h%rrtm_aldir(1:surf_lsm_h%ns,0:2)  )
+          ALLOCATE ( surf_lsm_h%rrtm_asdif(1:surf_lsm_h%ns,0:2)  )
+          ALLOCATE ( surf_lsm_h%rrtm_asdir(1:surf_lsm_h%ns,0:2)  )
+
+          ALLOCATE ( surf_usm_h%aldif(1:surf_usm_h%ns,0:2)       )
+          ALLOCATE ( surf_usm_h%aldir(1:surf_usm_h%ns,0:2)       )
+          ALLOCATE ( surf_usm_h%asdif(1:surf_usm_h%ns,0:2)       )
+          ALLOCATE ( surf_usm_h%asdir(1:surf_usm_h%ns,0:2)       )
+          ALLOCATE ( surf_usm_h%rrtm_aldif(1:surf_usm_h%ns,0:2)  )
+          ALLOCATE ( surf_usm_h%rrtm_aldir(1:surf_usm_h%ns,0:2)  )
+          ALLOCATE ( surf_usm_h%rrtm_asdif(1:surf_usm_h%ns,0:2)  )
+          ALLOCATE ( surf_usm_h%rrtm_asdir(1:surf_usm_h%ns,0:2)  )
 
 !
@@ -2069,7 +2071,7 @@
 !--       implementations)
           IF ( .NOT. ALLOCATED(surf_lsm_h%albedo) )                            &
-             ALLOCATE( surf_lsm_h%albedo(0:2,1:surf_lsm_h%ns)     )
+             ALLOCATE( surf_lsm_h%albedo(1:surf_lsm_h%ns,0:2)     )
           IF ( .NOT. ALLOCATED(surf_usm_h%albedo) )                            &
-             ALLOCATE( surf_usm_h%albedo(0:2,1:surf_usm_h%ns)     )
+             ALLOCATE( surf_usm_h%albedo(1:surf_usm_h%ns,0:2)     )
 
 !
@@ -2077,30 +2079,30 @@
           DO  l = 0, 3
 
-             ALLOCATE ( surf_lsm_v(l)%aldif(0:2,1:surf_lsm_v(l)%ns)      )
-             ALLOCATE ( surf_lsm_v(l)%aldir(0:2,1:surf_lsm_v(l)%ns)      )
-             ALLOCATE ( surf_lsm_v(l)%asdif(0:2,1:surf_lsm_v(l)%ns)      )
-             ALLOCATE ( surf_lsm_v(l)%asdir(0:2,1:surf_lsm_v(l)%ns)      )
-
-             ALLOCATE ( surf_lsm_v(l)%rrtm_aldif(0:2,1:surf_lsm_v(l)%ns) )
-             ALLOCATE ( surf_lsm_v(l)%rrtm_aldir(0:2,1:surf_lsm_v(l)%ns) )
-             ALLOCATE ( surf_lsm_v(l)%rrtm_asdif(0:2,1:surf_lsm_v(l)%ns) )
-             ALLOCATE ( surf_lsm_v(l)%rrtm_asdir(0:2,1:surf_lsm_v(l)%ns) )
-
-             ALLOCATE ( surf_usm_v(l)%aldif(0:2,1:surf_usm_v(l)%ns)      )
-             ALLOCATE ( surf_usm_v(l)%aldir(0:2,1:surf_usm_v(l)%ns)      )
-             ALLOCATE ( surf_usm_v(l)%asdif(0:2,1:surf_usm_v(l)%ns)      )
-             ALLOCATE ( surf_usm_v(l)%asdir(0:2,1:surf_usm_v(l)%ns)      )
-
-             ALLOCATE ( surf_usm_v(l)%rrtm_aldif(0:2,1:surf_usm_v(l)%ns) )
-             ALLOCATE ( surf_usm_v(l)%rrtm_aldir(0:2,1:surf_usm_v(l)%ns) )
-             ALLOCATE ( surf_usm_v(l)%rrtm_asdif(0:2,1:surf_usm_v(l)%ns) )
-             ALLOCATE ( surf_usm_v(l)%rrtm_asdir(0:2,1:surf_usm_v(l)%ns) )
+             ALLOCATE ( surf_lsm_v(l)%aldif(1:surf_lsm_v(l)%ns,0:2)      )
+             ALLOCATE ( surf_lsm_v(l)%aldir(1:surf_lsm_v(l)%ns,0:2)      )
+             ALLOCATE ( surf_lsm_v(l)%asdif(1:surf_lsm_v(l)%ns,0:2)      )
+             ALLOCATE ( surf_lsm_v(l)%asdir(1:surf_lsm_v(l)%ns,0:2)      )
+
+             ALLOCATE ( surf_lsm_v(l)%rrtm_aldif(1:surf_lsm_v(l)%ns,0:2) )
+             ALLOCATE ( surf_lsm_v(l)%rrtm_aldir(1:surf_lsm_v(l)%ns,0:2) )
+             ALLOCATE ( surf_lsm_v(l)%rrtm_asdif(1:surf_lsm_v(l)%ns,0:2) )
+             ALLOCATE ( surf_lsm_v(l)%rrtm_asdir(1:surf_lsm_v(l)%ns,0:2) )
+
+             ALLOCATE ( surf_usm_v(l)%aldif(1:surf_usm_v(l)%ns,0:2)      )
+             ALLOCATE ( surf_usm_v(l)%aldir(1:surf_usm_v(l)%ns,0:2)      )
+             ALLOCATE ( surf_usm_v(l)%asdif(1:surf_usm_v(l)%ns,0:2)      )
+             ALLOCATE ( surf_usm_v(l)%asdir(1:surf_usm_v(l)%ns,0:2)      )
+
+             ALLOCATE ( surf_usm_v(l)%rrtm_aldif(1:surf_usm_v(l)%ns,0:2) )
+             ALLOCATE ( surf_usm_v(l)%rrtm_aldir(1:surf_usm_v(l)%ns,0:2) )
+             ALLOCATE ( surf_usm_v(l)%rrtm_asdif(1:surf_usm_v(l)%ns,0:2) )
+             ALLOCATE ( surf_usm_v(l)%rrtm_asdir(1:surf_usm_v(l)%ns,0:2) )
 !
 !--          Allocate broadband albedo (temporary for the current radiation
 !--          implementations)
              IF ( .NOT. ALLOCATED( surf_lsm_v(l)%albedo ) )                    &
-                ALLOCATE( surf_lsm_v(l)%albedo(0:2,1:surf_lsm_v(l)%ns) )
+                ALLOCATE( surf_lsm_v(l)%albedo(1:surf_lsm_v(l)%ns,0:2) )
              IF ( .NOT. ALLOCATED( surf_usm_v(l)%albedo ) )                    &
-                ALLOCATE( surf_usm_v(l)%albedo(0:2,1:surf_usm_v(l)%ns) )
+                ALLOCATE( surf_usm_v(l)%albedo(1:surf_usm_v(l)%ns,0:2) )
 
           ENDDO
@@ -2165,15 +2167,15 @@
 !--          Spectral albedos for vegetation/pavement/water surfaces
              DO  ind_type = 0, 2
-                IF ( surf_lsm_h%albedo_type(ind_type,m) /= 0 )  THEN
-                   surf_lsm_h%aldif(ind_type,m) =                              &
-                               albedo_pars(1,surf_lsm_h%albedo_type(ind_type,m))
-                   surf_lsm_h%asdif(ind_type,m) =                              &
-                               albedo_pars(2,surf_lsm_h%albedo_type(ind_type,m))
-                   surf_lsm_h%aldir(ind_type,m) =                              &
-                               albedo_pars(1,surf_lsm_h%albedo_type(ind_type,m))
-                   surf_lsm_h%asdir(ind_type,m) =                              &
-                               albedo_pars(2,surf_lsm_h%albedo_type(ind_type,m))
-                   surf_lsm_h%albedo(ind_type,m) =                             &
-                               albedo_pars(0,surf_lsm_h%albedo_type(ind_type,m))
+                IF ( surf_lsm_h%albedo_type(m,ind_type) /= 0 )  THEN
+                   surf_lsm_h%aldif(m,ind_type) =                              &
+                               albedo_pars(1,surf_lsm_h%albedo_type(m,ind_type))
+                   surf_lsm_h%asdif(m,ind_type) =                              &
+                               albedo_pars(2,surf_lsm_h%albedo_type(m,ind_type))
+                   surf_lsm_h%aldir(m,ind_type) =                              &
+                               albedo_pars(1,surf_lsm_h%albedo_type(m,ind_type))
+                   surf_lsm_h%asdir(m,ind_type) =                              &
+                               albedo_pars(2,surf_lsm_h%albedo_type(m,ind_type))
+                   surf_lsm_h%albedo(m,ind_type) =                             &
+                               albedo_pars(0,surf_lsm_h%albedo_type(m,ind_type))
                 ENDIF
              ENDDO
@@ -2188,15 +2190,15 @@
 !--             Spectral albedos for wall/green/window surfaces
                 DO  ind_type = 0, 2
-                   IF ( surf_usm_h%albedo_type(ind_type,m) /= 0 )  THEN
-                      surf_usm_h%aldif(ind_type,m) =                           &
-                               albedo_pars(1,surf_usm_h%albedo_type(ind_type,m))
-                      surf_usm_h%asdif(ind_type,m) =                           &
-                               albedo_pars(2,surf_usm_h%albedo_type(ind_type,m))
-                      surf_usm_h%aldir(ind_type,m) =                           &
-                               albedo_pars(1,surf_usm_h%albedo_type(ind_type,m))
-                      surf_usm_h%asdir(ind_type,m) =                           &
-                               albedo_pars(2,surf_usm_h%albedo_type(ind_type,m))
-                      surf_usm_h%albedo(ind_type,m) =                          &
-                               albedo_pars(0,surf_usm_h%albedo_type(ind_type,m))
+                   IF ( surf_usm_h%albedo_type(m,ind_type) /= 0 )  THEN
+                      surf_usm_h%aldif(m,ind_type) =                           &
+                               albedo_pars(1,surf_usm_h%albedo_type(m,ind_type))
+                      surf_usm_h%asdif(m,ind_type) =                           &
+                               albedo_pars(2,surf_usm_h%albedo_type(m,ind_type))
+                      surf_usm_h%aldir(m,ind_type) =                           &
+                               albedo_pars(1,surf_usm_h%albedo_type(m,ind_type))
+                      surf_usm_h%asdir(m,ind_type) =                           &
+                               albedo_pars(2,surf_usm_h%albedo_type(m,ind_type))
+                      surf_usm_h%albedo(m,ind_type) =                          &
+                               albedo_pars(0,surf_usm_h%albedo_type(m,ind_type))
                    ENDIF
                 ENDDO
@@ -2211,15 +2213,15 @@
 !--             Spectral albedos for vegetation/pavement/water surfaces
                 DO  ind_type = 0, 2
-                   IF ( surf_lsm_v(l)%albedo_type(ind_type,m) /= 0 )  THEN
-                      surf_lsm_v(l)%aldif(ind_type,m) =                        &
-                            albedo_pars(1,surf_lsm_v(l)%albedo_type(ind_type,m))
-                      surf_lsm_v(l)%asdif(ind_type,m) =                        &
-                            albedo_pars(2,surf_lsm_v(l)%albedo_type(ind_type,m))
-                      surf_lsm_v(l)%aldir(ind_type,m) =                        &
-                            albedo_pars(1,surf_lsm_v(l)%albedo_type(ind_type,m))
-                      surf_lsm_v(l)%asdir(ind_type,m) =                        &
-                            albedo_pars(2,surf_lsm_v(l)%albedo_type(ind_type,m))
-                      surf_lsm_v(l)%albedo(ind_type,m) =                       &
-                            albedo_pars(0,surf_lsm_v(l)%albedo_type(ind_type,m))
+                   IF ( surf_lsm_v(l)%albedo_type(m,ind_type) /= 0 )  THEN
+                      surf_lsm_v(l)%aldif(m,ind_type) =                        &
+                            albedo_pars(1,surf_lsm_v(l)%albedo_type(m,ind_type))
+                      surf_lsm_v(l)%asdif(m,ind_type) =                        &
+                            albedo_pars(2,surf_lsm_v(l)%albedo_type(m,ind_type))
+                      surf_lsm_v(l)%aldir(m,ind_type) =                        &
+                            albedo_pars(1,surf_lsm_v(l)%albedo_type(m,ind_type))
+                      surf_lsm_v(l)%asdir(m,ind_type) =                        &
+                            albedo_pars(2,surf_lsm_v(l)%albedo_type(m,ind_type))
+                      surf_lsm_v(l)%albedo(m,ind_type) =                       &
+                            albedo_pars(0,surf_lsm_v(l)%albedo_type(m,ind_type))
                    ENDIF
                 ENDDO
@@ -2233,15 +2235,15 @@
 !--                Spectral albedos for wall/green/window surfaces
                    DO  ind_type = 0, 2
-                      IF ( surf_usm_v(l)%albedo_type(ind_type,m) /= 0 )  THEN
-                         surf_usm_v(l)%aldif(ind_type,m) =                     &
-                            albedo_pars(1,surf_usm_v(l)%albedo_type(ind_type,m))
-                         surf_usm_v(l)%asdif(ind_type,m) =                     &
-                            albedo_pars(2,surf_usm_v(l)%albedo_type(ind_type,m))
-                         surf_usm_v(l)%aldir(ind_type,m) =                     &
-                            albedo_pars(1,surf_usm_v(l)%albedo_type(ind_type,m))
-                         surf_usm_v(l)%asdir(ind_type,m) =                     &
-                            albedo_pars(2,surf_usm_v(l)%albedo_type(ind_type,m))
-                         surf_usm_v(l)%albedo(ind_type,m) =                    &
-                            albedo_pars(0,surf_usm_v(l)%albedo_type(ind_type,m))
+                      IF ( surf_usm_v(l)%albedo_type(m,ind_type) /= 0 )  THEN
+                         surf_usm_v(l)%aldif(m,ind_type) =                     &
+                            albedo_pars(1,surf_usm_v(l)%albedo_type(m,ind_type))
+                         surf_usm_v(l)%asdif(m,ind_type) =                     &
+                            albedo_pars(2,surf_usm_v(l)%albedo_type(m,ind_type))
+                         surf_usm_v(l)%aldir(m,ind_type) =                     &
+                            albedo_pars(1,surf_usm_v(l)%albedo_type(m,ind_type))
+                         surf_usm_v(l)%asdir(m,ind_type) =                     &
+                            albedo_pars(2,surf_usm_v(l)%albedo_type(m,ind_type))
+                         surf_usm_v(l)%albedo(m,ind_type) =                    &
+                            albedo_pars(0,surf_usm_v(l)%albedo_type(m,ind_type))
                       ENDIF
                    ENDDO
@@ -2263,17 +2265,17 @@
                 DO  ind_type = 0, 2
                    IF ( albedo_pars_f%pars_xy(0,j,i) /= albedo_pars_f%fill )   &
-                      surf_lsm_h%albedo(ind_type,m) =                          &
+                      surf_lsm_h%albedo(m,ind_type) =                          &
                                              albedo_pars_f%pars_xy(0,j,i)      
                    IF ( albedo_pars_f%pars_xy(1,j,i) /= albedo_pars_f%fill )   &
-                      surf_lsm_h%aldir(ind_type,m) =                           &
+                      surf_lsm_h%aldir(m,ind_type) =                           &
                                              albedo_pars_f%pars_xy(1,j,i)      
                    IF ( albedo_pars_f%pars_xy(1,j,i) /= albedo_pars_f%fill )   &
-                      surf_lsm_h%aldif(ind_type,m) =                           &
+                      surf_lsm_h%aldif(m,ind_type) =                           &
                                              albedo_pars_f%pars_xy(1,j,i)      
                    IF ( albedo_pars_f%pars_xy(2,j,i) /= albedo_pars_f%fill )   &
-                      surf_lsm_h%asdir(ind_type,m) =                           &
+                      surf_lsm_h%asdir(m,ind_type) =                           &
                                              albedo_pars_f%pars_xy(2,j,i)      
                    IF ( albedo_pars_f%pars_xy(2,j,i) /= albedo_pars_f%fill )   &
-                      surf_lsm_h%asdif(ind_type,m) =                           &
+                      surf_lsm_h%asdif(m,ind_type) =                           &
                                              albedo_pars_f%pars_xy(2,j,i)
                 ENDDO
@@ -2290,5 +2292,5 @@
                    DO  ind_type = 0, 2
                       IF ( albedo_pars_f%pars_xy(0,j,i) /= albedo_pars_f%fill )&
-                         surf_usm_h%albedo(ind_type,m) =                       &
+                         surf_usm_h%albedo(m,ind_type) =                       &
                                              albedo_pars_f%pars_xy(0,j,i)
                    ENDDO
@@ -2296,13 +2298,13 @@
 !--                Spectral albedos especially for building wall surfaces
                    IF ( albedo_pars_f%pars_xy(1,j,i) /= albedo_pars_f%fill )  THEN
-                      surf_usm_h%aldir(ind_veg_wall,m) =                       &
+                      surf_usm_h%aldir(m,ind_veg_wall) =                       &
                                                 albedo_pars_f%pars_xy(1,j,i)
-                      surf_usm_h%aldif(ind_veg_wall,m) =                       &
+                      surf_usm_h%aldif(m,ind_veg_wall) =                       &
                                                 albedo_pars_f%pars_xy(1,j,i)
                    ENDIF
                    IF ( albedo_pars_f%pars_xy(2,j,i) /= albedo_pars_f%fill )  THEN
-                      surf_usm_h%asdir(ind_veg_wall,m) =                       &
+                      surf_usm_h%asdir(m,ind_veg_wall) =                       &
                                                 albedo_pars_f%pars_xy(2,j,i)
-                      surf_usm_h%asdif(ind_veg_wall,m) =                       &
+                      surf_usm_h%asdif(m,ind_veg_wall) =                       &
                                                 albedo_pars_f%pars_xy(2,j,i)
                    ENDIF
@@ -2310,13 +2312,13 @@
 !--                Spectral albedos especially for building green surfaces
                    IF ( albedo_pars_f%pars_xy(3,j,i) /= albedo_pars_f%fill )  THEN
-                      surf_usm_h%aldir(ind_pav_green,m) =                      &
+                      surf_usm_h%aldir(m,ind_pav_green) =                      &
                                                 albedo_pars_f%pars_xy(3,j,i)
-                      surf_usm_h%aldif(ind_pav_green,m) =                      &
+                      surf_usm_h%aldif(m,ind_pav_green) =                      &
                                                 albedo_pars_f%pars_xy(3,j,i)
                    ENDIF
                    IF ( albedo_pars_f%pars_xy(4,j,i) /= albedo_pars_f%fill )  THEN
-                      surf_usm_h%asdir(ind_pav_green,m) =                      &
+                      surf_usm_h%asdir(m,ind_pav_green) =                      &
                                                 albedo_pars_f%pars_xy(4,j,i)
-                      surf_usm_h%asdif(ind_pav_green,m) =                      &
+                      surf_usm_h%asdif(m,ind_pav_green) =                      &
                                                 albedo_pars_f%pars_xy(4,j,i)
                    ENDIF
@@ -2324,13 +2326,13 @@
 !--                Spectral albedos especially for building window surfaces
                    IF ( albedo_pars_f%pars_xy(5,j,i) /= albedo_pars_f%fill )  THEN
-                      surf_usm_h%aldir(ind_wat_win,m) =                        &
+                      surf_usm_h%aldir(m,ind_wat_win) =                        &
                                                 albedo_pars_f%pars_xy(5,j,i)
-                      surf_usm_h%aldif(ind_wat_win,m) =                        &
+                      surf_usm_h%aldif(m,ind_wat_win) =                        &
                                                 albedo_pars_f%pars_xy(5,j,i)
                    ENDIF
                    IF ( albedo_pars_f%pars_xy(6,j,i) /= albedo_pars_f%fill )  THEN
-                      surf_usm_h%asdir(ind_wat_win,m) =                        &
+                      surf_usm_h%asdir(m,ind_wat_win) =                        &
                                                 albedo_pars_f%pars_xy(6,j,i)
-                      surf_usm_h%asdif(ind_wat_win,m) =                        &
+                      surf_usm_h%asdif(m,ind_wat_win) =                        &
                                                 albedo_pars_f%pars_xy(6,j,i)
                    ENDIF
@@ -2352,21 +2354,21 @@
                       IF ( albedo_pars_f%pars_xy(0,j+joff,i+ioff) /=           &
                            albedo_pars_f%fill )                                &
-                         surf_lsm_v(l)%albedo(ind_type,m) =                    &
+                         surf_lsm_v(l)%albedo(m,ind_type) =                    &
                                        albedo_pars_f%pars_xy(0,j+joff,i+ioff)
                       IF ( albedo_pars_f%pars_xy(1,j+joff,i+ioff) /=           &
                            albedo_pars_f%fill )                                &
-                         surf_lsm_v(l)%aldir(ind_type,m) =                     &
+                         surf_lsm_v(l)%aldir(m,ind_type) =                     &
                                        albedo_pars_f%pars_xy(1,j+joff,i+ioff)
                       IF ( albedo_pars_f%pars_xy(1,j+joff,i+ioff) /=           &
                            albedo_pars_f%fill )                                &
-                         surf_lsm_v(l)%aldif(ind_type,m) =                     &
+                         surf_lsm_v(l)%aldif(m,ind_type) =                     &
                                        albedo_pars_f%pars_xy(1,j+joff,i+ioff)
                       IF ( albedo_pars_f%pars_xy(2,j+joff,i+ioff) /=           &
                            albedo_pars_f%fill )                                &
-                         surf_lsm_v(l)%asdir(ind_type,m) =                     &
+                         surf_lsm_v(l)%asdir(m,ind_type) =                     &
                                        albedo_pars_f%pars_xy(2,j+joff,i+ioff)
                       IF ( albedo_pars_f%pars_xy(2,j+joff,i+ioff) /=           &
                            albedo_pars_f%fill )                                &
-                         surf_lsm_v(l)%asdif(ind_type,m) =                     &
+                         surf_lsm_v(l)%asdif(m,ind_type) =                     &
                                        albedo_pars_f%pars_xy(2,j+joff,i+ioff)
                    ENDDO
@@ -2387,5 +2389,5 @@
                          IF ( albedo_pars_f%pars_xy(0,j+joff,i+ioff) /=        &
                               albedo_pars_f%fill )                             &
-                            surf_usm_v(l)%albedo(ind_type,m) =                 &
+                            surf_usm_v(l)%albedo(m,ind_type) =                 &
                                           albedo_pars_f%pars_xy(0,j+joff,i+ioff)
                       ENDDO
@@ -2394,14 +2396,14 @@
                       IF ( albedo_pars_f%pars_xy(1,j+joff,i+ioff) /=           &
                            albedo_pars_f%fill )  THEN
-                         surf_usm_v(l)%aldir(ind_veg_wall,m) =                 &
+                         surf_usm_v(l)%aldir(m,ind_veg_wall) =                 &
                                          albedo_pars_f%pars_xy(1,j+joff,i+ioff)
-                         surf_usm_v(l)%aldif(ind_veg_wall,m) =                 &
+                         surf_usm_v(l)%aldif(m,ind_veg_wall) =                 &
                                          albedo_pars_f%pars_xy(1,j+joff,i+ioff)
                       ENDIF
                       IF ( albedo_pars_f%pars_xy(2,j+joff,i+ioff) /=           &
                            albedo_pars_f%fill )  THEN
-                         surf_usm_v(l)%asdir(ind_veg_wall,m) =                 &
+                         surf_usm_v(l)%asdir(m,ind_veg_wall) =                 &
                                          albedo_pars_f%pars_xy(2,j+joff,i+ioff)
-                         surf_usm_v(l)%asdif(ind_veg_wall,m) =                 &
+                         surf_usm_v(l)%asdif(m,ind_veg_wall) =                 &
                                          albedo_pars_f%pars_xy(2,j+joff,i+ioff)
                       ENDIF
@@ -2410,14 +2412,14 @@
                       IF ( albedo_pars_f%pars_xy(3,j+joff,i+ioff) /=           &
                            albedo_pars_f%fill )  THEN
-                         surf_usm_v(l)%aldir(ind_pav_green,m) =                &
+                         surf_usm_v(l)%aldir(m,ind_pav_green) =                &
                                          albedo_pars_f%pars_xy(3,j+joff,i+ioff)
-                         surf_usm_v(l)%aldif(ind_pav_green,m) =                &
+                         surf_usm_v(l)%aldif(m,ind_pav_green) =                &
                                          albedo_pars_f%pars_xy(3,j+joff,i+ioff)
                       ENDIF
                       IF ( albedo_pars_f%pars_xy(4,j+joff,i+ioff) /=           &
                            albedo_pars_f%fill )  THEN
-                         surf_usm_v(l)%asdir(ind_pav_green,m) =                &
+                         surf_usm_v(l)%asdir(m,ind_pav_green) =                &
                                          albedo_pars_f%pars_xy(4,j+joff,i+ioff)
-                         surf_usm_v(l)%asdif(ind_pav_green,m) =                &
+                         surf_usm_v(l)%asdif(m,ind_pav_green) =                &
                                          albedo_pars_f%pars_xy(4,j+joff,i+ioff)
                       ENDIF
@@ -2426,14 +2428,14 @@
                       IF ( albedo_pars_f%pars_xy(5,j+joff,i+ioff) /=           &
                            albedo_pars_f%fill )  THEN
-                         surf_usm_v(l)%aldir(ind_wat_win,m) =                  &
+                         surf_usm_v(l)%aldir(m,ind_wat_win) =                  &
                                          albedo_pars_f%pars_xy(5,j+joff,i+ioff)
-                         surf_usm_v(l)%aldif(ind_wat_win,m) =                  &
+                         surf_usm_v(l)%aldif(m,ind_wat_win) =                  &
                                          albedo_pars_f%pars_xy(5,j+joff,i+ioff)
                       ENDIF
                       IF ( albedo_pars_f%pars_xy(6,j+joff,i+ioff) /=           &
                            albedo_pars_f%fill )  THEN
-                         surf_usm_v(l)%asdir(ind_wat_win,m) =                  &
+                         surf_usm_v(l)%asdir(m,ind_wat_win) =                  &
                                          albedo_pars_f%pars_xy(6,j+joff,i+ioff)
-                         surf_usm_v(l)%asdif(ind_wat_win,m) =                  &
+                         surf_usm_v(l)%asdif(m,ind_wat_win) =                  &
                                          albedo_pars_f%pars_xy(6,j+joff,i+ioff)
                       ENDIF
@@ -2461,75 +2463,75 @@
                       IF ( building_surface_pars_f%pars(ind_s_alb_b_wall,is) /=      &
                            building_surface_pars_f%fill )  THEN
-                         surf_usm_h%albedo(ind_veg_wall,m) =                         &
+                         surf_usm_h%albedo(m,ind_veg_wall) =                         &
                                   building_surface_pars_f%pars(ind_s_alb_b_wall,is)
-                         surf_usm_h%albedo_type(ind_veg_wall,m) = 0
+                         surf_usm_h%albedo_type(m,ind_veg_wall) = 0
                       ENDIF
 
                       IF ( building_surface_pars_f%pars(ind_s_alb_l_wall,is) /=      &
                            building_surface_pars_f%fill )  THEN
-                         surf_usm_h%aldir(ind_veg_wall,m) =                          &
+                         surf_usm_h%aldir(m,ind_veg_wall) =                          &
                                   building_surface_pars_f%pars(ind_s_alb_l_wall,is)
-                         surf_usm_h%aldif(ind_veg_wall,m) =                          &
+                         surf_usm_h%aldif(m,ind_veg_wall) =                          &
                                   building_surface_pars_f%pars(ind_s_alb_l_wall,is)
-                         surf_usm_h%albedo_type(ind_veg_wall,m) = 0
+                         surf_usm_h%albedo_type(m,ind_veg_wall) = 0
                       ENDIF
 
                       IF ( building_surface_pars_f%pars(ind_s_alb_s_wall,is) /=      &
                            building_surface_pars_f%fill )  THEN
-                         surf_usm_h%asdir(ind_veg_wall,m) =                          &
+                         surf_usm_h%asdir(m,ind_veg_wall) =                          &
                                   building_surface_pars_f%pars(ind_s_alb_s_wall,is)
-                         surf_usm_h%asdif(ind_veg_wall,m) =                          &
+                         surf_usm_h%asdif(m,ind_veg_wall) =                          &
                                   building_surface_pars_f%pars(ind_s_alb_s_wall,is)
-                         surf_usm_h%albedo_type(ind_veg_wall,m) = 0
+                         surf_usm_h%albedo_type(m,ind_veg_wall) = 0
                       ENDIF
 
                       IF ( building_surface_pars_f%pars(ind_s_alb_b_win,is) /=       &
                            building_surface_pars_f%fill )  THEN
-                         surf_usm_h%albedo(ind_wat_win,m) =                          &
+                         surf_usm_h%albedo(m,ind_wat_win) =                          &
                                   building_surface_pars_f%pars(ind_s_alb_b_win,is)
-                         surf_usm_h%albedo_type(ind_wat_win,m) = 0
+                         surf_usm_h%albedo_type(m,ind_wat_win) = 0
                       ENDIF
 
                       IF ( building_surface_pars_f%pars(ind_s_alb_l_win,is) /=       &
                            building_surface_pars_f%fill )  THEN
-                         surf_usm_h%aldir(ind_wat_win,m) =                           &
+                         surf_usm_h%aldir(m,ind_wat_win) =                           &
                                   building_surface_pars_f%pars(ind_s_alb_l_win,is)
-                         surf_usm_h%aldif(ind_wat_win,m) =                           &
+                         surf_usm_h%aldif(m,ind_wat_win) =                           &
                                   building_surface_pars_f%pars(ind_s_alb_l_win,is)
-                         surf_usm_h%albedo_type(ind_wat_win,m) = 0
+                         surf_usm_h%albedo_type(m,ind_wat_win) = 0
                       ENDIF
 
                       IF ( building_surface_pars_f%pars(ind_s_alb_s_win,is) /=       &
                            building_surface_pars_f%fill )  THEN
-                         surf_usm_h%asdir(ind_wat_win,m) =                           &
+                         surf_usm_h%asdir(m,ind_wat_win) =                           &
                                   building_surface_pars_f%pars(ind_s_alb_s_win,is)
-                         surf_usm_h%asdif(ind_wat_win,m) =                           &
+                         surf_usm_h%asdif(m,ind_wat_win) =                           &
                                   building_surface_pars_f%pars(ind_s_alb_s_win,is)
-                         surf_usm_h%albedo_type(ind_wat_win,m) = 0
+                         surf_usm_h%albedo_type(m,ind_wat_win) = 0
                       ENDIF
 
                       IF ( building_surface_pars_f%pars(ind_s_alb_b_green,is) /=     &
                            building_surface_pars_f%fill )  THEN
-                         surf_usm_h%albedo(ind_pav_green,m) =                        &
+                         surf_usm_h%albedo(m,ind_pav_green) =                        &
                                   building_surface_pars_f%pars(ind_s_alb_b_green,is)
-                         surf_usm_h%albedo_type(ind_pav_green,m) = 0
+                         surf_usm_h%albedo_type(m,ind_pav_green) = 0
                       ENDIF
 
                       IF ( building_surface_pars_f%pars(ind_s_alb_l_green,is) /=     &
                            building_surface_pars_f%fill )  THEN
-                         surf_usm_h%aldir(ind_pav_green,m) =                         &
+                         surf_usm_h%aldir(m,ind_pav_green) =                         &
                                   building_surface_pars_f%pars(ind_s_alb_l_green,is)
-                         surf_usm_h%aldif(ind_pav_green,m) =                         &
+                         surf_usm_h%aldif(m,ind_pav_green) =                         &
                                   building_surface_pars_f%pars(ind_s_alb_l_green,is)
-                         surf_usm_h%albedo_type(ind_pav_green,m) = 0
+                         surf_usm_h%albedo_type(m,ind_pav_green) = 0
                       ENDIF
 
                       IF ( building_surface_pars_f%pars(ind_s_alb_s_green,is) /=     &
                            building_surface_pars_f%fill )  THEN
-                         surf_usm_h%asdir(ind_pav_green,m) =                         &
+                         surf_usm_h%asdir(m,ind_pav_green) =                         &
                                   building_surface_pars_f%pars(ind_s_alb_s_green,is)
-                         surf_usm_h%asdif(ind_pav_green,m) =                         &
+                         surf_usm_h%asdif(m,ind_pav_green) =                         &
                                   building_surface_pars_f%pars(ind_s_alb_s_green,is)
-                         surf_usm_h%albedo_type(ind_pav_green,m) = 0
+                         surf_usm_h%albedo_type(m,ind_pav_green) = 0
                       ENDIF
 
@@ -2554,75 +2556,75 @@
                          IF ( building_surface_pars_f%pars(ind_s_alb_b_wall,is) /=      &
                               building_surface_pars_f%fill )  THEN
-                            surf_usm_v(l)%albedo(ind_veg_wall,m) =                      &
+                            surf_usm_v(l)%albedo(m,ind_veg_wall) =                      &
                                      building_surface_pars_f%pars(ind_s_alb_b_wall,is)
-                            surf_usm_v(l)%albedo_type(ind_veg_wall,m) = 0
+                            surf_usm_v(l)%albedo_type(m,ind_veg_wall) = 0
                          ENDIF
 
                          IF ( building_surface_pars_f%pars(ind_s_alb_l_wall,is) /=      &
                               building_surface_pars_f%fill )  THEN
-                            surf_usm_v(l)%aldir(ind_veg_wall,m) =                       &
+                            surf_usm_v(l)%aldir(m,ind_veg_wall) =                       &
                                      building_surface_pars_f%pars(ind_s_alb_l_wall,is)
-                            surf_usm_v(l)%aldif(ind_veg_wall,m) =                       &
+                            surf_usm_v(l)%aldif(m,ind_veg_wall) =                       &
                                      building_surface_pars_f%pars(ind_s_alb_l_wall,is)
-                            surf_usm_v(l)%albedo_type(ind_veg_wall,m) = 0
+                            surf_usm_v(l)%albedo_type(m,ind_veg_wall) = 0
                          ENDIF
 
                          IF ( building_surface_pars_f%pars(ind_s_alb_s_wall,is) /=      &
                               building_surface_pars_f%fill )  THEN
-                            surf_usm_v(l)%asdir(ind_veg_wall,m) =                       &
+                            surf_usm_v(l)%asdir(m,ind_veg_wall) =                       &
                                      building_surface_pars_f%pars(ind_s_alb_s_wall,is)
-                            surf_usm_v(l)%asdif(ind_veg_wall,m) =                       &
+                            surf_usm_v(l)%asdif(m,ind_veg_wall) =                       &
                                      building_surface_pars_f%pars(ind_s_alb_s_wall,is)
-                            surf_usm_v(l)%albedo_type(ind_veg_wall,m) = 0
+                            surf_usm_v(l)%albedo_type(m,ind_veg_wall) = 0
                          ENDIF
 
                          IF ( building_surface_pars_f%pars(ind_s_alb_b_win,is) /=       &
                               building_surface_pars_f%fill )  THEN
-                            surf_usm_v(l)%albedo(ind_wat_win,m) =                       &
+                            surf_usm_v(l)%albedo(m,ind_wat_win) =                       &
                                      building_surface_pars_f%pars(ind_s_alb_b_win,is)
-                            surf_usm_v(l)%albedo_type(ind_wat_win,m) = 0
+                            surf_usm_v(l)%albedo_type(m,ind_wat_win) = 0
                          ENDIF
 
                          IF ( building_surface_pars_f%pars(ind_s_alb_l_win,is) /=       &
                               building_surface_pars_f%fill )  THEN
-                            surf_usm_v(l)%aldir(ind_wat_win,m) =                        &
+                            surf_usm_v(l)%aldir(m,ind_wat_win) =                        &
                                      building_surface_pars_f%pars(ind_s_alb_l_win,is)
-                            surf_usm_v(l)%aldif(ind_wat_win,m) =                        &
+                            surf_usm_v(l)%aldif(m,ind_wat_win) =                        &
                                      building_surface_pars_f%pars(ind_s_alb_l_win,is)
-                            surf_usm_v(l)%albedo_type(ind_wat_win,m) = 0
+                            surf_usm_v(l)%albedo_type(m,ind_wat_win) = 0
                          ENDIF
 
                          IF ( building_surface_pars_f%pars(ind_s_alb_s_win,is) /=       &
                               building_surface_pars_f%fill )  THEN
-                            surf_usm_v(l)%asdir(ind_wat_win,m) =                        &
+                            surf_usm_v(l)%asdir(m,ind_wat_win) =                        &
                                      building_surface_pars_f%pars(ind_s_alb_s_win,is)
-                            surf_usm_v(l)%asdif(ind_wat_win,m) =                        &
+                            surf_usm_v(l)%asdif(m,ind_wat_win) =                        &
                                      building_surface_pars_f%pars(ind_s_alb_s_win,is)
-                            surf_usm_v(l)%albedo_type(ind_wat_win,m) = 0
+                            surf_usm_v(l)%albedo_type(m,ind_wat_win) = 0
                          ENDIF
 
                          IF ( building_surface_pars_f%pars(ind_s_alb_b_green,is) /=     &
                               building_surface_pars_f%fill )  THEN
-                            surf_usm_v(l)%albedo(ind_pav_green,m) =                     &
+                            surf_usm_v(l)%albedo(m,ind_pav_green) =                     &
                                      building_surface_pars_f%pars(ind_s_alb_b_green,is)
-                            surf_usm_v(l)%albedo_type(ind_pav_green,m) = 0
+                            surf_usm_v(l)%albedo_type(m,ind_pav_green) = 0
                          ENDIF
 
                          IF ( building_surface_pars_f%pars(ind_s_alb_l_green,is) /=     &
                               building_surface_pars_f%fill )  THEN
-                            surf_usm_v(l)%aldir(ind_pav_green,m) =                      &
+                            surf_usm_v(l)%aldir(m,ind_pav_green) =                      &
                                      building_surface_pars_f%pars(ind_s_alb_l_green,is)
-                            surf_usm_v(l)%aldif(ind_pav_green,m) =                      &
+                            surf_usm_v(l)%aldif(m,ind_pav_green) =                      &
                                      building_surface_pars_f%pars(ind_s_alb_l_green,is)
-                            surf_usm_v(l)%albedo_type(ind_pav_green,m) = 0
+                            surf_usm_v(l)%albedo_type(m,ind_pav_green) = 0
                          ENDIF
 
                          IF ( building_surface_pars_f%pars(ind_s_alb_s_green,is) /=     &
                               building_surface_pars_f%fill )  THEN
-                            surf_usm_v(l)%asdir(ind_pav_green,m) =                      &
+                            surf_usm_v(l)%asdir(m,ind_pav_green) =                      &
                                      building_surface_pars_f%pars(ind_s_alb_s_green,is)
-                            surf_usm_v(l)%asdif(ind_pav_green,m) =                      &
+                            surf_usm_v(l)%asdif(m,ind_pav_green) =                      &
                                      building_surface_pars_f%pars(ind_s_alb_s_green,is)
-                            surf_usm_v(l)%albedo_type(ind_pav_green,m) = 0
+                            surf_usm_v(l)%albedo_type(m,ind_pav_green) = 0
                          ENDIF
 
@@ -3272,18 +3274,18 @@
                    DO  m = 1, surf%ns
                       k = surf%k(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_out(m) = ( surf%frac(m,ind_veg_wall)  *      &
+                                             surf%albedo(m,ind_veg_wall)       &
+                                           + surf%frac(m,ind_pav_green) *      &
+                                             surf%albedo(m,ind_pav_green)      &
+                                           + surf%frac(m,ind_wat_win)   *      &
+                                             surf%albedo(m,ind_wat_win) )      &
                                            * surf%rad_sw_in(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)    &
+                      surf%rad_lw_out(m) = ( surf%frac(m,ind_veg_wall)  *      &
+                                             surf%emissivity(m,ind_veg_wall)   &
+                                           + surf%frac(m,ind_pav_green) *      &
+                                             surf%emissivity(m,ind_pav_green)  &
+                                           + surf%frac(m,ind_wat_win)   *      &
+                                             surf%emissivity(m,ind_wat_win)    &
                                            )                                   &
                                            * sigma_sb                          &
@@ -3291,10 +3293,10 @@
                    
                       surf%rad_lw_out_change_0(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)      &
+                                         ( surf%frac(m,ind_veg_wall)  *        &
+                                           surf%emissivity(m,ind_veg_wall)     &
+                                         + surf%frac(m,ind_pav_green) *        &
+                                           surf%emissivity(im,ind_pav_green)    &
+                                         + surf%frac(m,ind_wat_win)   *        &
+                                           surf%emissivity(m,ind_wat_win)      &
                                          ) * 4.0_wp * sigma_sb                 &
                                          * ( surf%pt_surface(m) * exner(k) )**3
@@ -3340,18 +3342,18 @@
 !
 !--                Weighted average according to surface fraction. 
-                   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_out(m) = ( surf%frac(m,ind_veg_wall)  *         &
+                                          surf%albedo(m,ind_veg_wall)          &
+                                        + surf%frac(m,ind_pav_green) *         &
+                                          surf%albedo(m,ind_pav_green)         &
+                                        + surf%frac(m,ind_wat_win)   *         &
+                                          surf%albedo(m,ind_wat_win) )         &
                                         * surf%rad_sw_in(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)       &
+                   surf%rad_lw_out(m) = ( surf%frac(m,ind_veg_wall)  *         &
+                                          surf%emissivity(m,ind_veg_wall)      &
+                                        + surf%frac(m,ind_pav_green) *         &
+                                          surf%emissivity(m,ind_pav_green)     &
+                                        + surf%frac(m,ind_wat_win)   *         &
+                                          surf%emissivity(m,ind_wat_win)       &
                                         )                                      &
                                         * sigma_sb                             &
@@ -3359,10 +3361,10 @@
 
                    surf%rad_lw_out_change_0(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)         &
+                                      ( surf%frac(m,ind_veg_wall)  *           &
+                                        surf%emissivity(m,ind_veg_wall)        &
+                                      + surf%frac(m,ind_pav_green) *           &
+                                        surf%emissivity(m,ind_pav_green)       &
+                                      + surf%frac(m,ind_wat_win)   *           &
+                                        surf%emissivity(m,ind_wat_win)         &
                                       ) * 4.0_wp * sigma_sb                    &
                                       * ( surf%pt_surface(m) * exner(k) )**3
@@ -3550,18 +3552,18 @@
 !--                calculated fluxes below are not actually used as they are 
 !--                overwritten in radiation_interaction.
-                   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_out(m) = ( surf%frac(m,ind_veg_wall)  *         &
+                                          surf%albedo(m,ind_veg_wall)          &
+                                        + surf%frac(m,ind_pav_green) *         &
+                                          surf%albedo(m,ind_pav_green)         &
+                                        + surf%frac(m,ind_wat_win)   *         &
+                                          surf%albedo(m,ind_wat_win) )         &
                                         * surf%rad_sw_in(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)       &
+                   surf%rad_lw_out(m) = ( surf%frac(m,ind_veg_wall)  *         &
+                                          surf%emissivity(m,ind_veg_wall)      &
+                                        + surf%frac(m,ind_pav_green) *         &
+                                          surf%emissivity(m,ind_pav_green)     &
+                                        + surf%frac(m,ind_wat_win)   *         &
+                                          surf%emissivity(m,ind_wat_win)       &
                                         )                                      &
                                         * sigma_sb                             &
@@ -3569,10 +3571,10 @@
 
                    surf%rad_lw_out_change_0(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)         &
+                                      ( surf%frac(m,ind_veg_wall)  *           &
+                                        surf%emissivity(m,ind_veg_wall)        &
+                                      + surf%frac(m,ind_pav_green) *           &
+                                        surf%emissivity(m,ind_pav_green)       &
+                                      + surf%frac(m,ind_wat_win)   *           &
+                                        surf%emissivity(m,ind_wat_win)         &
                                       ) * 4.0_wp * sigma_sb                    &
                                       * ( surf%pt_surface(m) * exner(nzb) )** 3
@@ -3749,10 +3751,10 @@
 !
 !--                Weighted average according to surface fraction. 
-                   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)       &
+                   surf%rad_lw_out(m) = ( surf%frac(m,ind_veg_wall)  *         &
+                                          surf%emissivity(m,ind_veg_wall)      &
+                                        + surf%frac(m,ind_pav_green) *         &
+                                          surf%emissivity(m,ind_pav_green)     &
+                                        + surf%frac(m,ind_wat_win)   *         &
+                                          surf%emissivity(m,ind_wat_win)       &
                                         )                                      &
                                       * sigma_sb                               &
@@ -3762,18 +3764,18 @@
                                        + surf%rad_lw_out(m) )                  &
                                        / ( 1.0_wp -                            &
-                                          ( 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%frac(m,ind_veg_wall)  *       &
+                                            surf%albedo(m,ind_veg_wall)        &
+                                         +  surf%frac(m,ind_pav_green) *       &
+                                            surf%albedo(m,ind_pav_green)       &
+                                         +  surf%frac(m,ind_wat_win)   *       &
+                                            surf%albedo(m,ind_wat_win) )       &
                                          )
 
-                   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_out(m) = ( surf%frac(m,ind_veg_wall)  *         &
+                                          surf%albedo(m,ind_veg_wall)          &
+                                        + surf%frac(m,ind_pav_green) *         &
+                                          surf%albedo(m,ind_pav_green)         &
+                                        + surf%frac(m,ind_wat_win)   *         &
+                                          surf%albedo(m,ind_wat_win) )         &
                                       * surf%rad_sw_in(m)
 
@@ -4531,19 +4533,19 @@
 !--             surfaces. 
                 DO  m = surf_lsm_h%start_index(j,i), surf_lsm_h%end_index(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_emis = surf_lsm_h%frac(m,ind_veg_wall)  *              &
+                               surf_lsm_h%emissivity(m,ind_veg_wall)  +        &
+                               surf_lsm_h%frac(m,ind_pav_green) *              &
+                               surf_lsm_h%emissivity(m,ind_pav_green) +        & 
+                               surf_lsm_h%frac(m,ind_wat_win)   *              &
+                               surf_lsm_h%emissivity(m,ind_wat_win)
                    rrtm_tsfc = surf_lsm_h%pt_surface(m) * exner(nzb)
                 ENDDO             
                 DO  m = surf_usm_h%start_index(j,i), surf_usm_h%end_index(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_emis = surf_usm_h%frac(m,ind_veg_wall)  *              &
+                               surf_usm_h%emissivity(m,ind_veg_wall)  +        &
+                               surf_usm_h%frac(m,ind_pav_green) *              &
+                               surf_usm_h%emissivity(m,ind_pav_green) +        & 
+                               surf_usm_h%frac(m,ind_wat_win)   *              &
+                               surf_usm_h%emissivity(m,ind_wat_win)
                    rrtm_tsfc = surf_usm_h%pt_surface(m) * exner(nzb)
                 ENDDO
@@ -4672,22 +4674,22 @@
                    DO  m = surf_lsm_h%start_index(j,i),                        &
                            surf_lsm_h%end_index(j,i)
-                      rrtm_asdir(1)  = SUM( surf_lsm_h%frac(:,m) *             &
+                      rrtm_asdir(1)  = SUM( surf_lsm_h%frac(m,:) *             &
                                             surf_lsm_h%rrtm_asdir(:,m) )
-                      rrtm_asdif(1)  = SUM( surf_lsm_h%frac(:,m) *             &
+                      rrtm_asdif(1)  = SUM( surf_lsm_h%frac(m,:) *             &
                                             surf_lsm_h%rrtm_asdif(:,m) )
-                      rrtm_aldir(1)  = SUM( surf_lsm_h%frac(:,m) *             &
+                      rrtm_aldir(1)  = SUM( surf_lsm_h%frac(m,:) *             &
                                             surf_lsm_h%rrtm_aldir(:,m) )
-                      rrtm_aldif(1)  = SUM( surf_lsm_h%frac(:,m) *             &
+                      rrtm_aldif(1)  = SUM( surf_lsm_h%frac(m,:) *             &
                                             surf_lsm_h%rrtm_aldif(:,m) )
                    ENDDO             
                    DO  m = surf_usm_h%start_index(j,i),                        &
                            surf_usm_h%end_index(j,i)
-                      rrtm_asdir(1)  = SUM( surf_usm_h%frac(:,m) *             &
+                      rrtm_asdir(1)  = SUM( surf_usm_h%frac(m,:) *             &
                                             surf_usm_h%rrtm_asdir(:,m) )
-                      rrtm_asdif(1)  = SUM( surf_usm_h%frac(:,m) *             &
+                      rrtm_asdif(1)  = SUM( surf_usm_h%frac(m,:) *             &
                                             surf_usm_h%rrtm_asdif(:,m) )
-                      rrtm_aldir(1)  = SUM( surf_usm_h%frac(:,m) *             &
+                      rrtm_aldir(1)  = SUM( surf_usm_h%frac(m,:) *             &
                                             surf_usm_h%rrtm_aldir(:,m) )
-                      rrtm_aldif(1)  = SUM( surf_usm_h%frac(:,m) *             &
+                      rrtm_aldif(1)  = SUM( surf_usm_h%frac(m,:) *             &
                                             surf_usm_h%rrtm_aldif(:,m) )
                    ENDDO
@@ -4989,73 +4991,73 @@
 !
 !--              Ocean
-                 IF ( surf%albedo_type(ind_type,m) == 1 )  THEN
-                    surf%rrtm_aldir(ind_type,m) = 0.026_wp /                    &
+                 IF ( surf%albedo_type(m,ind_type) == 1 )  THEN
+                    surf%rrtm_aldir(m,ind_type) = 0.026_wp /                    &
                                                 ( cos_zenith**1.7_wp + 0.065_wp )&
                                      + 0.15_wp * ( cos_zenith - 0.1_wp )         &
                                                * ( cos_zenith - 0.5_wp )         &
                                                * ( cos_zenith - 1.0_wp )
-                    surf%rrtm_asdir(ind_type,m) = surf%rrtm_aldir(ind_type,m)
+                    surf%rrtm_asdir(m,ind_type) = surf%rrtm_aldir(m,ind_type)
 !
 !--              Snow
-                 ELSEIF ( surf%albedo_type(ind_type,m) == 16 )  THEN
+                 ELSEIF ( surf%albedo_type(m,ind_type) == 16 )  THEN
                     IF ( cos_zenith < 0.5_wp )  THEN
-                       surf%rrtm_aldir(ind_type,m) =                           &
-                                 0.5_wp * ( 1.0_wp - surf%aldif(ind_type,m) )  &
+                       surf%rrtm_aldir(m,ind_type) =                           &
+                                 0.5_wp * ( 1.0_wp - surf%aldif(im,ind_type) )  &
                                         * ( ( 3.0_wp / ( 1.0_wp + 4.0_wp       &
                                         * cos_zenith ) ) - 1.0_wp )
-                       surf%rrtm_asdir(ind_type,m) =                           &
-                                 0.5_wp * ( 1.0_wp - surf%asdif(ind_type,m) )  &
+                       surf%rrtm_asdir(m,ind_type) =                           &
+                                 0.5_wp * ( 1.0_wp - surf%asdif(m,ind_type) )  &
                                         * ( ( 3.0_wp / ( 1.0_wp + 4.0_wp       &
                                         * cos_zenith ) ) - 1.0_wp )
 
-                       surf%rrtm_aldir(ind_type,m) =                           &
-                                       MIN(0.98_wp, surf%rrtm_aldir(ind_type,m))
-                       surf%rrtm_asdir(ind_type,m) =                           &
-                                       MIN(0.98_wp, surf%rrtm_asdir(ind_type,m))
+                       surf%rrtm_aldir(m,ind_type) =                           &
+                                       MIN(0.98_wp, surf%rrtm_aldir(m,ind_type))
+                       surf%rrtm_asdir(m,ind_type) =                           &
+                                       MIN(0.98_wp, surf%rrtm_asdir(m,ind_type))
                     ELSE
-                       surf%rrtm_aldir(ind_type,m) = surf%aldif(ind_type,m)
-                       surf%rrtm_asdir(ind_type,m) = surf%asdif(ind_type,m)
+                       surf%rrtm_aldir(m,ind_type) = surf%aldif(m,ind_type)
+                       surf%rrtm_asdir(m,ind_type) = surf%asdif(m,ind_type)
                     ENDIF
 !
 !--              Sea ice
-                 ELSEIF ( surf%albedo_type(ind_type,m) == 15 )  THEN
-                    surf%rrtm_aldir(ind_type,m) = surf%aldif(ind_type,m)
-                    surf%rrtm_asdir(ind_type,m) = surf%asdif(ind_type,m)
+                 ELSEIF ( surf%albedo_type(m,ind_type) == 15 )  THEN
+                    surf%rrtm_aldir(m,ind_type) = surf%aldif(m,ind_type)
+                    surf%rrtm_asdir(m,ind_type) = surf%asdif(m,ind_type)
 
 !
 !--              Asphalt
-                 ELSEIF ( surf%albedo_type(ind_type,m) == 17 )  THEN
-                    surf%rrtm_aldir(ind_type,m) = surf%aldif(ind_type,m)
-                    surf%rrtm_asdir(ind_type,m) = surf%asdif(ind_type,m)
+                 ELSEIF ( surf%albedo_type(m,ind_type) == 17 )  THEN
+                    surf%rrtm_aldir(m,ind_type) = surf%aldif(m,ind_type)
+                    surf%rrtm_asdir(m,ind_type) = surf%asdif(m,ind_type)
 
 
 !
 !--              Bare soil
-                 ELSEIF ( surf%albedo_type(ind_type,m) == 18 )  THEN
-                    surf%rrtm_aldir(ind_type,m) = surf%aldif(ind_type,m)
-                    surf%rrtm_asdir(ind_type,m) = surf%asdif(ind_type,m)
+                 ELSEIF ( surf%albedo_type(m,ind_type) == 18 )  THEN
+                    surf%rrtm_aldir(m,ind_type) = surf%aldif(m,ind_type)
+                    surf%rrtm_asdir(m,ind_type) = surf%asdif(m,ind_type)
 
 !
 !--              Land surfaces
                  ELSE
-                    SELECT CASE ( surf%albedo_type(ind_type,m) )
+                    SELECT CASE ( surf%albedo_type(m,ind_type) )
 
 !
 !--                    Surface types with strong zenith dependence
                        CASE ( 1, 2, 3, 4, 11, 12, 13 )
-                          surf%rrtm_aldir(ind_type,m) =                        &
-                                surf%aldif(ind_type,m) * 1.4_wp /              &
+                          surf%rrtm_aldir(m,ind_type) =                        &
+                                surf%aldif(m,ind_type) * 1.4_wp /              &
                                            ( 1.0_wp + 0.8_wp * cos_zenith )
-                          surf%rrtm_asdir(ind_type,m) =                        &
-                                surf%asdif(ind_type,m) * 1.4_wp /              &
+                          surf%rrtm_asdir(m,ind_type) =                        &
+                                surf%asdif(m,ind_type) * 1.4_wp /              &
                                            ( 1.0_wp + 0.8_wp * cos_zenith )
 !
 !--                    Surface types with weak zenith dependence
                        CASE ( 5, 6, 7, 8, 9, 10, 14 )
-                          surf%rrtm_aldir(ind_type,m) =                        &
-                                surf%aldif(ind_type,m) * 1.1_wp /              &
+                          surf%rrtm_aldir(m,ind_type) =                        &
+                                surf%aldif(m,ind_type) * 1.1_wp /              &
                                            ( 1.0_wp + 0.2_wp * cos_zenith )
-                          surf%rrtm_asdir(ind_type,m) =                        &
-                                surf%asdif(ind_type,m) * 1.1_wp /              &
+                          surf%rrtm_asdir(m,ind_type) =                        &
+                                surf%asdif(m,ind_type) * 1.1_wp /              &
                                            ( 1.0_wp + 0.2_wp * cos_zenith )
 
@@ -5066,6 +5068,6 @@
 !
 !--              Diffusive albedo is taken from Table 2
-                 surf%rrtm_aldif(ind_type,m) = surf%aldif(ind_type,m)
-                 surf%rrtm_asdif(ind_type,m) = surf%asdif(ind_type,m)
+                 surf%rrtm_aldif(m,ind_type) = surf%aldif(m,ind_type)
+                 surf%rrtm_asdif(m,ind_type) = surf%asdif(m,ind_type)
               ENDDO
            ENDDO
@@ -5883,26 +5885,28 @@
      DO  i = nxl, nxr
         DO  j = nys, nyn
-!--           urban
+!
+!--        urban
            DO  m = surf_usm_h%start_index(j,i), surf_usm_h%end_index(j,i)
-              surfoutll(mm) = SUM ( surf_usm_h%frac(:,m) *                  &
-                                    surf_usm_h%emissivity(:,m) )            &
+              surfoutll(mm) = SUM ( surf_usm_h%frac(m,:) *                  &
+                                    surf_usm_h%emissivity(m,:) )            &
                                   * sigma_sb                                &
                                   * surf_usm_h%pt_surface(m)**4
-              albedo_surf(mm) = SUM ( surf_usm_h%frac(:,m) *                &
-                                      surf_usm_h%albedo(:,m) )
-              emiss_surf(mm)  = SUM ( surf_usm_h%frac(:,m) *                &
-                                      surf_usm_h%emissivity(:,m) )
+              albedo_surf(mm) = SUM ( surf_usm_h%frac(m,:) *                &
+                                      surf_usm_h%albedo(m,:) )
+              emiss_surf(mm)  = SUM ( surf_usm_h%frac(m,:) *                &
+                                      surf_usm_h%emissivity(m,:) )
               mm = mm + 1
            ENDDO
-!--           land
+!
+!--        land
            DO  m = surf_lsm_h%start_index(j,i), surf_lsm_h%end_index(j,i)
-              surfoutll(mm) = SUM ( surf_lsm_h%frac(:,m) *                  &
-                                    surf_lsm_h%emissivity(:,m) )            &
+              surfoutll(mm) = SUM ( surf_lsm_h%frac(m,:) *                  &
+                                    surf_lsm_h%emissivity(m,:) )            &
                                   * sigma_sb                                &
                                   * surf_lsm_h%pt_surface(m)**4
-              albedo_surf(mm) = SUM ( surf_lsm_h%frac(:,m) *                &
-                                      surf_lsm_h%albedo(:,m) )
-              emiss_surf(mm)  = SUM ( surf_lsm_h%frac(:,m) *                &
-                                      surf_lsm_h%emissivity(:,m) )
+              albedo_surf(mm) = SUM ( surf_lsm_h%frac(m,:) *                &
+                                      surf_lsm_h%albedo(m,:) )
+              emiss_surf(mm)  = SUM ( surf_lsm_h%frac(m,:) *                &
+                                      surf_lsm_h%emissivity(m,:) )
               mm = mm + 1
            ENDDO
@@ -5910,33 +5914,35 @@
      ENDDO
 !
-!--     Vertical walls
+!--  Vertical walls
      DO  i = nxl, nxr
         DO  j = nys, nyn
            DO  ll = 0, 3
               l = reorder(ll)
-!--              urban
+!
+!--           urban
               DO  m = surf_usm_v(l)%start_index(j,i),                       &
                       surf_usm_v(l)%end_index(j,i)
-                 surfoutll(mm) = SUM ( surf_usm_v(l)%frac(:,m) *            &
-                                       surf_usm_v(l)%emissivity(:,m) )      &
+                 surfoutll(mm) = SUM ( surf_usm_v(l)%frac(m,:) *            &
+                                       surf_usm_v(l)%emissivity(m,:) )      &
                                   * sigma_sb                                &
                                   * surf_usm_v(l)%pt_surface(m)**4
-                 albedo_surf(mm) = SUM ( surf_usm_v(l)%frac(:,m) *          &
-                                         surf_usm_v(l)%albedo(:,m) )
-                 emiss_surf(mm)  = SUM ( surf_usm_v(l)%frac(:,m) *          &
-                                         surf_usm_v(l)%emissivity(:,m) )
+                 albedo_surf(mm) = SUM ( surf_usm_v(l)%frac(m,:) *          &
+                                         surf_usm_v(l)%albedo(m,:) )
+                 emiss_surf(mm)  = SUM ( surf_usm_v(l)%frac(m,:) *          &
+                                         surf_usm_v(l)%emissivity(m,:) )
                  mm = mm + 1
               ENDDO
-!--              land
+!
+!--           land
               DO  m = surf_lsm_v(l)%start_index(j,i),                       &
                       surf_lsm_v(l)%end_index(j,i)
-                 surfoutll(mm) = SUM ( surf_lsm_v(l)%frac(:,m) *            &
-                                       surf_lsm_v(l)%emissivity(:,m) )      &
+                 surfoutll(mm) = SUM ( surf_lsm_v(l)%frac(m,:) *            &
+                                       surf_lsm_v(l)%emissivity(m,:) )      &
                                   * sigma_sb                                &
                                   * surf_lsm_v(l)%pt_surface(m)**4
-                 albedo_surf(mm) = SUM ( surf_lsm_v(l)%frac(:,m) *          &
-                                         surf_lsm_v(l)%albedo(:,m) )
-                 emiss_surf(mm)  = SUM ( surf_lsm_v(l)%frac(:,m) *          &
-                                         surf_lsm_v(l)%emissivity(:,m) )
+                 albedo_surf(mm) = SUM ( surf_lsm_v(l)%frac(m,:) *          &
+                                         surf_lsm_v(l)%albedo(m,:) )
+                 emiss_surf(mm)  = SUM ( surf_lsm_v(l)%frac(m,:) *          &
+                                         surf_lsm_v(l)%emissivity(m,:) )
                  mm = mm + 1
               ENDDO
@@ -5945,5 +5951,5 @@
      ENDDO
 
-     IF ( trace_fluxes_above >= 0._wp )  THEN
+     IF ( trace_fluxes_above >= 0.0_wp )  THEN
         CALL radiation_print_debug_surf( 'surfoutll before initial pass', surfoutll )
         CALL radiation_print_debug_horz( 'rad_lw_in_diff before initial pass', rad_lw_in_diff )
@@ -6008,5 +6014,5 @@
         j = FLOOR(ACOS(cos_zenith) / pi * raytrace_discrete_elevs)
         i = MODULO(NINT(ATAN2(sun_dir_lon, sun_dir_lat)               &
-                        / (2._wp*pi) * raytrace_discrete_azims-.5_wp, iwp), &
+                        / (2.0_wp*pi) * raytrace_discrete_azims-0.5_wp, iwp), &
                    raytrace_discrete_azims)
         isd = dsidir_rev(j, i)
@@ -6024,5 +6030,5 @@
            i = mrtbl(ix, imrt)
            mrtinsw(imrt) = mrtinsw(imrt) + mrtdsit(imrt, isd) * rad_sw_in_dir(j,i) &
-                                     / cos_zenith / 4._wp ! normal to sphere
+                                     / cos_zenith / 4.0_wp ! normal to sphere
         ENDDO
      ENDIF
@@ -6039,7 +6045,7 @@
      IF ( npcbl > 0 )  THEN
 
-         pcbinswdir(:) = 0._wp
-         pcbinswdif(:) = 0._wp
-         pcbinlw(:) = 0._wp
+         pcbinswdir(:) = 0.0_wp
+         pcbinswdif(:) = 0.0_wp
+         pcbinlw(:) = 0.0_wp
 
          DO icsf = 1, ncsfl
@@ -6065,5 +6071,5 @@
                 IF ( cos_zenith > 0 )  THEN
 !--                Estimate directed box absorption
-                   pc_abs_frac = 1._wp - exp(pc_abs_eff * lad_s(k,j,i))
+                   pc_abs_frac = 1.0_wp - exp(pc_abs_eff * lad_s(k,j,i))
 !
 !--                isd has already been established, see 1)
@@ -6091,5 +6097,5 @@
      ENDIF
 
-     IF ( trace_fluxes_above >= 0._wp )  THEN
+     IF ( trace_fluxes_above >= 0.0_wp )  THEN
         CALL radiation_print_debug_surf( 'surfinl after initial pass', surfinl )
         CALL radiation_print_debug_surf( 'surfinlwdif after initial pass', surfinlwdif )
@@ -6118,5 +6124,5 @@
      ENDIF
 
-     IF ( trace_fluxes_above >= 0._wp )  THEN
+     IF ( trace_fluxes_above >= 0.0_wp )  THEN
         CALL radiation_print_debug_surf( 'surfinl after PC emiss', surfinl )
      ENDIF
@@ -6135,5 +6141,5 @@
         nrefsteps = 0
         surfoutsl = albedo_surf * surfins
-        surfoutll = (1._wp - emiss_surf) * surfinl
+        surfoutll = (1.0_wp - emiss_surf) * surfinl
         surfoutsw = surfoutsw + surfoutsl
         surfoutlw = surfoutlw + surfoutll
@@ -6148,7 +6154,7 @@
 !
 !--      for non-transparent surfaces, longwave albedo is 1 - emissivity
-         surfoutll = (1._wp - emiss_surf) * surfinl
-
-         IF ( trace_fluxes_above >= 0._wp )  THEN
+         surfoutll = (1.0_wp - emiss_surf) * surfinl
+
+         IF ( trace_fluxes_above >= 0.0_wp )  THEN
             CALL radiation_print_debug_surf( 'surfoutll before reflective pass', surfoutll, refstep )
             CALL radiation_print_debug_surf( 'surfoutsl before reflective pass', surfoutsl, refstep )
@@ -6178,6 +6184,6 @@
 !
 !--      Reset for the input from next reflective pass
-         surfins = 0._wp
-         surfinl = 0._wp
+         surfins = 0.0_wp
+         surfinl = 0.00_wp
 !
 !--      Reflected radiation
@@ -6222,5 +6228,5 @@
          ENDDO
 
-         IF ( trace_fluxes_above >= 0._wp )  THEN
+         IF ( trace_fluxes_above >= 0.0_wp )  THEN
             CALL radiation_print_debug_surf( 'surfinl after reflected pass', surfinl, refstep )
             CALL radiation_print_debug_surf( 'surfins after reflected pass', surfins, refstep )
@@ -6268,7 +6274,7 @@
      IF ( nmrtbl > 0 )  THEN
         IF ( mrt_include_sw )  THEN
-           mrt(:) = ((mrtinsw(:) + mrtinlw(:)) / sigma_sb) ** .25_wp
+           mrt(:) = ((mrtinsw(:) + mrtinlw(:)) / sigma_sb) ** 0.25_wp
         ELSE
-           mrt(:) = (mrtinlw(:) / sigma_sb) ** .25_wp
+           mrt(:) = (mrtinlw(:) / sigma_sb) ** 0.25_wp
         ENDIF
      ENDIF
Index: palm/trunk/SOURCE/salsa_mod.f90
===================================================================
--- palm/trunk/SOURCE/salsa_mod.f90	(revision 4440)
+++ palm/trunk/SOURCE/salsa_mod.f90	(revision 4441)
@@ -21,5 +21,6 @@
 ! Current revisions:
 ! -----------------
-! 
+! Change order of dimension in surface array %frac to allow for better 
+! vectorization.
 ! 
 ! Former revisions:
@@ -2712,5 +2713,5 @@
 !
 !--       Vegetation (LSM):
-          IF ( surf%frac(ind_veg_wall,m) > 0 )  THEN
+          IF ( surf%frac(m,ind_veg_wall) > 0 )  THEN
              veg_type_palm = surf%vegetation_type(m)
              SELECT CASE ( veg_type_palm )
@@ -2758,5 +2759,5 @@
 !
 !--       Pavement (LSM):
-          IF ( surf%frac(ind_pav_green,m) > 0 )  THEN
+          IF ( surf%frac(m,ind_pav_green) > 0 )  THEN
              pav_type_palm = surf%pavement_type(m)
              IF ( pav_type_palm == 0 )  THEN  ! error
@@ -2769,5 +2770,5 @@
 !
 !--       Water (LSM):
-          IF ( surf%frac(ind_wat_win,m) > 0 )  THEN
+          IF ( surf%frac(m,ind_wat_win) > 0 )  THEN
              wat_type_palm = surf%water_type(m)
              IF ( wat_type_palm == 0 )  THEN  ! error
@@ -2784,15 +2785,15 @@
 !
 !--       Wall surfaces (USM):
-          IF ( surf%frac(ind_veg_wall,m) > 0 )  THEN
+          IF ( surf%frac(m,ind_veg_wall) > 0 )  THEN
              match_veg_wall(m) = 15  ! urban in Z01
           ENDIF
 !
 !--       Green walls and roofs (USM):
-          IF ( surf%frac(ind_pav_green,m) > 0 )  THEN
+          IF ( surf%frac(m,ind_pav_green) > 0 )  THEN
              match_pav_green(m) =  6 ! (short) grass in Z01
           ENDIF
 !
 !--       Windows (USM):
-          IF ( surf%frac(ind_wat_win,m) > 0 )  THEN
+          IF ( surf%frac(m,ind_wat_win) > 0 )  THEN
              match_wat_win(m) = 15  ! urban in Z01
           ENDIF
@@ -4386,5 +4387,5 @@
                 END SELECT
              ENDDO
-             depo_sum = depo_sum + surf%frac(ind_pav_green,m) * depo
+             depo_sum = depo_sum + surf%frac(m,ind_pav_green) * depo
           ENDIF
 
@@ -4417,5 +4418,5 @@
                 END SELECT
              ENDDO
-             depo_sum = depo_sum + surf%frac(ind_veg_wall,m) * depo
+             depo_sum = depo_sum + surf%frac(m,ind_veg_wall) * depo
           ENDIF
 
@@ -4448,5 +4449,5 @@
                 END SELECT
              ENDDO
-             depo_sum = depo_sum + surf%frac(ind_wat_win,m) * depo
+             depo_sum = depo_sum + surf%frac(m,ind_wat_win) * depo
           ENDIF
 
Index: palm/trunk/SOURCE/sum_up_3d_data.f90
===================================================================
--- palm/trunk/SOURCE/sum_up_3d_data.f90	(revision 4440)
+++ palm/trunk/SOURCE/sum_up_3d_data.f90	(revision 4441)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! ------------------
-! 
+! Change order of dimension in surface array %frac to allow for better 
+! vectorization.
 ! 
 ! Former revisions:
@@ -371,9 +372,9 @@
                          m = surf_usm_h%end_index(j,i)
                          ghf_av(j,i) = ghf_av(j,i) +                           &
-                                         surf_usm_h%frac(ind_veg_wall,m)  *    &
+                                         surf_usm_h%frac(m,ind_veg_wall)  *    &
                                          surf_usm_h%wghf_eb(m)        +        &
-                                         surf_usm_h%frac(ind_pav_green,m) *    &
+                                         surf_usm_h%frac(m,ind_pav_green) *    &
                                          surf_usm_h%wghf_eb_green(m)  +        &
-                                         surf_usm_h%frac(ind_wat_win,m)   *    &
+                                         surf_usm_h%frac(m,ind_wat_win)   *    &
                                          surf_usm_h%wghf_eb_window(m)
                       ENDIF
@@ -644,9 +645,9 @@
                          m = surf_usm_h%end_index(j,i)
                          r_a_av(j,i) = r_a_av(j,i) +                           &
-                                         surf_usm_h%frac(ind_veg_wall,m)  *    &
+                                         surf_usm_h%frac(m,ind_veg_wall)  *    &
                                          surf_usm_h%r_a(m)       +             & 
-                                         surf_usm_h%frac(ind_pav_green,m) *    &
+                                         surf_usm_h%frac(m,ind_pav_green) *    &
                                          surf_usm_h%r_a_green(m) +             & 
-                                         surf_usm_h%frac(ind_wat_win,m)   *    &
+                                         surf_usm_h%frac(m,ind_wat_win)   *    &
                                          surf_usm_h%r_a_window(m)
                       ENDIF
Index: palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90
===================================================================
--- palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90	(revision 4440)
+++ palm/trunk/SOURCE/synthetic_turbulence_generator_mod.f90	(revision 4441)
@@ -20,5 +20,6 @@
 ! Current revisions:
 ! -----------------
-! 
+! Set back turbulent length scale to 8 x grid spacing in the parametrized mode
+! (was accidantly changed).
 ! 
 ! Former revisions:
@@ -811,5 +812,5 @@
 !--    Define length scale for the imposed turbulence, which is defined as
 !--    8 times the minimum grid spacing
-       length_scale = 30.0_wp * MIN( dx, dy, MINVAL( dzw ) ) !8.0_wp * MIN( dx, dy, MINVAL( dzw ) )
+       length_scale = 8.0_wp * MIN( dx, dy, MINVAL( dzw ) )
 !
 !--    Define constant to gradually decrease length scales and Reynolds stress
Index: palm/trunk/SOURCE/urban_surface_mod.f90
===================================================================
--- palm/trunk/SOURCE/urban_surface_mod.f90	(revision 4440)
+++ palm/trunk/SOURCE/urban_surface_mod.f90	(revision 4441)
@@ -23,5 +23,6 @@
 ! Current revisions:
 ! ------------------
-! 
+! Change order of dimension in surface arrays %frac, %emissivity and %albedo 
+! to allow for better vectorization in the radiation interactions.
 ! 
 ! Former revisions:
@@ -800,10 +801,10 @@
 !--     Allocate albedo_type and albedo. Each surface element
 !--     has 3 values, 0: wall fraction, 1: green fraction, 2: window fraction.
-        ALLOCATE ( surf_usm_h%albedo_type(0:2,1:surf_usm_h%ns) )
-        ALLOCATE ( surf_usm_h%albedo(0:2,1:surf_usm_h%ns)      )
+        ALLOCATE ( surf_usm_h%albedo_type(1:surf_usm_h%ns,0:2) )
+        ALLOCATE ( surf_usm_h%albedo(1:surf_usm_h%ns,0:2)      )
         surf_usm_h%albedo_type = albedo_type
         DO  l = 0, 3
-           ALLOCATE ( surf_usm_v(l)%albedo_type(0:2,1:surf_usm_v(l)%ns) )
-           ALLOCATE ( surf_usm_v(l)%albedo(0:2,1:surf_usm_v(l)%ns)      )
+           ALLOCATE ( surf_usm_v(l)%albedo_type(1:surf_usm_v(l)%ns,0:2) )
+           ALLOCATE ( surf_usm_v(l)%albedo(1:surf_usm_v(l)%ns,0:2)      )
            surf_usm_v(l)%albedo_type = albedo_type
         ENDDO       
@@ -837,8 +838,8 @@
 !--      Allocate arrays for relative surface fraction. 
 !--      0 - wall fraction, 1 - green fraction, 2 - window fraction
-         ALLOCATE ( surf_usm_h%frac(0:2,1:surf_usm_h%ns) )
+         ALLOCATE ( surf_usm_h%frac(1:surf_usm_h%ns,0:2) )
          surf_usm_h%frac = 0.0_wp
          DO  l = 0, 3
-            ALLOCATE ( surf_usm_v(l)%frac(0:2,1:surf_usm_v(l)%ns) )
+            ALLOCATE ( surf_usm_v(l)%frac(1:surf_usm_v(l)%ns,0:2) )
             surf_usm_v(l)%frac = 0.0_wp
          ENDDO
@@ -855,5 +856,5 @@
         ALLOCATE ( surf_usm_h%transmissivity(1:surf_usm_h%ns)     )
         ALLOCATE ( surf_usm_h%lai(1:surf_usm_h%ns)                )
-        ALLOCATE ( surf_usm_h%emissivity(0:2,1:surf_usm_h%ns)     )
+        ALLOCATE ( surf_usm_h%emissivity(1:surf_usm_h%ns,0:2)     )
         ALLOCATE ( surf_usm_h%r_a(1:surf_usm_h%ns)                )
         ALLOCATE ( surf_usm_h%r_a_green(1:surf_usm_h%ns)          )
@@ -873,5 +874,5 @@
            ALLOCATE ( surf_usm_v(l)%transmissivity(1:surf_usm_v(l)%ns)     )
            ALLOCATE ( surf_usm_v(l)%lai(1:surf_usm_v(l)%ns)                )
-           ALLOCATE ( surf_usm_v(l)%emissivity(0:2,1:surf_usm_v(l)%ns)     )
+           ALLOCATE ( surf_usm_v(l)%emissivity(1:surf_usm_v(l)%ns,0:2)     )
            ALLOCATE ( surf_usm_v(l)%r_a(1:surf_usm_v(l)%ns)                )
            ALLOCATE ( surf_usm_v(l)%r_a_green(1:surf_usm_v(l)%ns)          )
@@ -3616,7 +3617,7 @@
 !
 !--        Initialize relatvie wall- (0), green- (1) and window (2) fractions
-           surf_usm_h%frac(ind_veg_wall,m)  = building_pars(ind_wall_frac_r,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_r,building_type)  
+           surf_usm_h%frac(m,ind_veg_wall)  = building_pars(ind_wall_frac_r,building_type)   
+           surf_usm_h%frac(m,ind_pav_green) = building_pars(ind_green_frac_r,building_type)  
+           surf_usm_h%frac(m,ind_wat_win)   = building_pars(ind_win_frac_r,building_type)  
            surf_usm_h%lai(m)                = building_pars(ind_lai_r,building_type)  
 
@@ -3650,7 +3651,7 @@
 !
 !--        emissivity of wall-, green- and window fraction 
-           surf_usm_h%emissivity(ind_veg_wall,m)  = building_pars(ind_emis_wall_r,building_type)
-           surf_usm_h%emissivity(ind_pav_green,m) = building_pars(ind_emis_green_r,building_type)
-           surf_usm_h%emissivity(ind_wat_win,m)   = building_pars(ind_emis_win_r,building_type)
+           surf_usm_h%emissivity(m,ind_veg_wall)  = building_pars(ind_emis_wall_r,building_type)
+           surf_usm_h%emissivity(m,ind_pav_green) = building_pars(ind_emis_green_r,building_type)
+           surf_usm_h%emissivity(m,ind_wat_win)   = building_pars(ind_emis_win_r,building_type)
 
            surf_usm_h%transmissivity(m)      = building_pars(ind_trans_r,building_type)
@@ -3661,7 +3662,7 @@
 !
 !--        albedo type for wall fraction, green fraction, window fraction
-           surf_usm_h%albedo_type(ind_veg_wall,m)  = INT( building_pars(ind_alb_wall_r,building_type)  )
-           surf_usm_h%albedo_type(ind_pav_green,m) = INT( building_pars(ind_alb_green_r,building_type) )
-           surf_usm_h%albedo_type(ind_wat_win,m)   = INT( building_pars(ind_alb_win_r,building_type)   )
+           surf_usm_h%albedo_type(m,ind_veg_wall)  = INT( building_pars(ind_alb_wall_r,building_type)  )
+           surf_usm_h%albedo_type(m,ind_pav_green) = INT( building_pars(ind_alb_green_r,building_type) )
+           surf_usm_h%albedo_type(m,ind_wat_win)   = INT( building_pars(ind_alb_win_r,building_type)   )
 
            surf_usm_h%zw(nzb_wall,m)         = building_pars(ind_thick_1_wall_r,building_type)
@@ -3774,7 +3775,7 @@
 !
 !--           Initialize relatvie wall- (0), green- (1) and window (2) fractions
-              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)%frac(m,ind_veg_wall)   = building_pars(ind_wall_frac,building_type)   
+              surf_usm_v(l)%frac(m,ind_pav_green)  = building_pars(ind_green_frac_w,building_type) 
+              surf_usm_v(l)%frac(m,ind_wat_win)    = building_pars(ind_win_frac,building_type)  
               surf_usm_v(l)%lai(m)                 = building_pars(ind_lai_w,building_type)  
 
@@ -3813,7 +3814,7 @@
 !
 !--           emissivity of wall-, green- and window fraction 
-              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)%emissivity(m,ind_veg_wall)  = building_pars(ind_emis_wall,building_type)
+              surf_usm_v(l)%emissivity(m,ind_pav_green) = building_pars(ind_emis_green,building_type)
+              surf_usm_v(l)%emissivity(m,ind_wat_win)   = building_pars(ind_emis_win,building_type)
 
               surf_usm_v(l)%transmissivity(m)      = building_pars(ind_trans,building_type)
@@ -3823,7 +3824,7 @@
               surf_usm_v(l)%z0q(m)                 = building_pars(ind_z0qh,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)%albedo_type(m,ind_veg_wall)  = INT( building_pars(ind_alb_wall,building_type) )
+              surf_usm_v(l)%albedo_type(m,ind_pav_green) = INT( building_pars(ind_alb_green,building_type) )
+              surf_usm_v(l)%albedo_type(m,ind_wat_win)   = INT( building_pars(ind_alb_win,building_type) )
 
               surf_usm_v(l)%zw(nzb_wall,m)         = building_pars(ind_thick_1,building_type)
@@ -3880,7 +3881,7 @@
 !
 !--              Initialize relatvie wall- (0), green- (1) and window (2) fractions
-                 surf_usm_h%frac(ind_veg_wall,m)  = building_pars(ind_wall_frac_r,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_r,st)  
+                 surf_usm_h%frac(m,ind_veg_wall)  = building_pars(ind_wall_frac_r,st)   
+                 surf_usm_h%frac(m,ind_pav_green) = building_pars(ind_green_frac_r,st)  
+                 surf_usm_h%frac(m,ind_wat_win)   = building_pars(ind_win_frac_r,st)  
                  surf_usm_h%lai(m)                = building_pars(ind_lai_r,st)  
 
@@ -3916,7 +3917,7 @@
 !
 !--              emissivity of wall-, green- and window fraction 
-                 surf_usm_h%emissivity(ind_veg_wall,m)  = building_pars(ind_emis_wall_r,st)
-                 surf_usm_h%emissivity(ind_pav_green,m) = building_pars(ind_emis_green_r,st)
-                 surf_usm_h%emissivity(ind_wat_win,m)   = building_pars(ind_emis_win_r,st)
+                 surf_usm_h%emissivity(m,ind_veg_wall)  = building_pars(ind_emis_wall_r,st)
+                 surf_usm_h%emissivity(m,ind_pav_green) = building_pars(ind_emis_green_r,st)
+                 surf_usm_h%emissivity(m,ind_wat_win)   = building_pars(ind_emis_win_r,st)
 
                  surf_usm_h%transmissivity(m)      = building_pars(ind_trans_r,st)
@@ -3927,7 +3928,7 @@
 !
 !--              albedo type for wall fraction, green fraction, window fraction
-                 surf_usm_h%albedo_type(ind_veg_wall,m)  = INT( building_pars(ind_alb_wall_r,st) )
-                 surf_usm_h%albedo_type(ind_pav_green,m) = INT( building_pars(ind_alb_green_r,st) )
-                 surf_usm_h%albedo_type(ind_wat_win,m)   = INT( building_pars(ind_alb_win_r,st) )
+                 surf_usm_h%albedo_type(m,ind_veg_wall)  = INT( building_pars(ind_alb_wall_r,st) )
+                 surf_usm_h%albedo_type(m,ind_pav_green) = INT( building_pars(ind_alb_green_r,st) )
+                 surf_usm_h%albedo_type(m,ind_wat_win)   = INT( building_pars(ind_alb_win_r,st) )
 
                  surf_usm_h%zw(nzb_wall,m)         = building_pars(ind_thick_1_wall_r,st)
@@ -4047,7 +4048,7 @@
 !
 !--                 Initialize relatvie wall- (0), green- (1) and window (2) fractions
-                    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)%frac(m,ind_veg_wall)  = building_pars(ind_wall_frac,st)   
+                    surf_usm_v(l)%frac(m,ind_pav_green) = building_pars(ind_green_frac_w,st)  
+                    surf_usm_v(l)%frac(m,ind_wat_win)   = building_pars(ind_win_frac,st)   
                     surf_usm_v(l)%lai(m)                = building_pars(ind_lai_w,st)  
 
@@ -4086,7 +4087,7 @@
 !
 !--                 emissivity of wall-, green- and window fraction 
-                    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)%emissivity(m,ind_veg_wall)  = building_pars(ind_emis_wall,st)
+                    surf_usm_v(l)%emissivity(m,ind_pav_green) = building_pars(ind_emis_green,st)
+                    surf_usm_v(l)%emissivity(m,ind_wat_win)   = building_pars(ind_emis_win,st)
 
                     surf_usm_v(l)%transmissivity(m)      = building_pars(ind_trans,st)
@@ -4096,7 +4097,7 @@
                     surf_usm_v(l)%z0q(m)                 = building_pars(ind_z0qh,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)%albedo_type(m,ind_veg_wall)  = INT( building_pars(ind_alb_wall,st) )
+                    surf_usm_v(l)%albedo_type(m,ind_pav_green) = INT( building_pars(ind_alb_green,st) )
+                    surf_usm_v(l)%albedo_type(m,ind_wat_win)   = INT( building_pars(ind_alb_win,st) )
 
                     surf_usm_v(l)%zw(nzb_wall,m)         = building_pars(ind_thick_1,st)
@@ -4193,15 +4194,15 @@
               IF ( building_pars_f%pars_xy(ind_wall_frac,j,i) /=               &
                    building_pars_f%fill )                                      &
-                 surf_usm_h%frac(ind_veg_wall,m)  =                            &
+                 surf_usm_h%frac(m,ind_veg_wall)  =                            &
                                     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(ind_pav_green,m) =                            &
+                 surf_usm_h%frac(m,ind_pav_green) =                            &
                                     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(ind_wat_win,m)   =                            &
+                 surf_usm_h%frac(m,ind_wat_win)   =                            &
                                     building_pars_f%pars_xy(ind_win_frac,j,i)
  
@@ -4325,15 +4326,15 @@
               IF ( building_pars_f%pars_xy(ind_emis_wall,j,i) /=               &   
                    building_pars_f%fill )                                      &
-                 surf_usm_h%emissivity(ind_veg_wall,m)  =                      &
+                 surf_usm_h%emissivity(m,ind_veg_wall)  =                      &
                                     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(ind_pav_green,m) =                      &
+                 surf_usm_h%emissivity(m,ind_pav_green) =                      &
                                      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(ind_wat_win,m)   =                      &
+                 surf_usm_h%emissivity(m,ind_wat_win)   =                      &
                                      building_pars_f%pars_xy(ind_emis_win,j,i)
                  
@@ -4356,14 +4357,14 @@
               IF ( building_pars_f%pars_xy(ind_alb_wall_agfl,j,i) /=           &          
                    building_pars_f%fill )                                      & 
-                 surf_usm_h%albedo_type(ind_veg_wall,m)  =                     &
+                 surf_usm_h%albedo_type(m,ind_veg_wall)  =                     &
                                  building_pars_f%pars_xy(ind_alb_wall_agfl,j,i)
                  
               IF ( building_pars_f%pars_xy(ind_alb_green_agfl,j,i) /=          &           
                    building_pars_f%fill )                                      &
-                 surf_usm_h%albedo_type(ind_pav_green,m) =                     &
+                 surf_usm_h%albedo_type(m,ind_pav_green) =                     &
                                 building_pars_f%pars_xy(ind_alb_green_agfl,j,i)
               IF ( building_pars_f%pars_xy(ind_alb_win_agfl,j,i) /=            &          
                    building_pars_f%fill )                                      &
-                 surf_usm_h%albedo_type(ind_wat_win,m)   =                     &
+                 surf_usm_h%albedo_type(m,ind_wat_win)   =                     &
                                    building_pars_f%pars_xy(ind_alb_win_agfl,j,i)
 
@@ -4481,15 +4482,15 @@
                     IF ( building_pars_f%pars_xy(ind_wall_frac,j,i) /=         &
                          building_pars_f%fill )                                &
-                       surf_usm_v(l)%frac(ind_veg_wall,m)  =                   &
+                       surf_usm_v(l)%frac(m,ind_veg_wall)  =                   &
                                           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(ind_pav_green,m) =                   &
+                       surf_usm_v(l)%frac(m,ind_pav_green) =                   &
                                   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(ind_wat_win,m)   =                   &
+                       surf_usm_v(l)%frac(m,ind_wat_win)   =                   &
                                        building_pars_f%pars_xy(ind_win_frac,j,i)
                     
@@ -4614,15 +4615,15 @@
                     IF ( building_pars_f%pars_xy(ind_emis_wall,j,i) /=         &   
                          building_pars_f%fill )                                &
-                       surf_usm_v(l)%emissivity(ind_veg_wall,m)  =             &
+                       surf_usm_v(l)%emissivity(m,ind_veg_wall)  =             &
                                       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(ind_pav_green,m) =             &
+                       surf_usm_v(l)%emissivity(m,ind_pav_green) =             &
                                       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(ind_wat_win,m)   =             &
+                       surf_usm_v(l)%emissivity(m,ind_wat_win)   =             &
                                       building_pars_f%pars_xy(ind_emis_win,j,i)
                        
@@ -4647,14 +4648,14 @@
                     IF ( building_pars_f%pars_xy(ind_alb_wall_agfl,j,i) /=     &          
                          building_pars_f%fill )                                & 
-                       surf_usm_v(l)%albedo_type(ind_veg_wall,m)  =            &
+                       surf_usm_v(l)%albedo_type(m,ind_veg_wall)  =            &
                                  building_pars_f%pars_xy(ind_alb_wall_agfl,j,i)
                        
                     IF ( building_pars_f%pars_xy(ind_alb_green_agfl,j,i) /=    &           
                          building_pars_f%fill )                                &
-                       surf_usm_v(l)%albedo_type(ind_pav_green,m) =            &
+                       surf_usm_v(l)%albedo_type(m,ind_pav_green) =            &
                                  building_pars_f%pars_xy(ind_alb_green_agfl,j,i)
                     IF ( building_pars_f%pars_xy(ind_alb_win_agfl,j,i) /=      &          
                          building_pars_f%fill )                                &
-                       surf_usm_v(l)%albedo_type(ind_wat_win,m)   =            &
+                       surf_usm_v(l)%albedo_type(m,ind_wat_win)   =            &
                                    building_pars_f%pars_xy(ind_alb_win_agfl,j,i)
                     
@@ -4730,15 +4731,15 @@
                     IF ( building_surface_pars_f%pars(ind_s_wall_frac,is) /=                     &
                          building_surface_pars_f%fill )                                          &
-                       surf_usm_h%frac(ind_veg_wall,m) =                                         &
+                       surf_usm_h%frac(m,ind_veg_wall) =                                         &
                                 building_surface_pars_f%pars(ind_s_wall_frac,is)
 
                     IF ( building_surface_pars_f%pars(ind_s_green_frac_w,is) /=                  &
                          building_surface_pars_f%fill )                                          &
-                       surf_usm_h%frac(ind_pav_green,m) =                                        &
+                       surf_usm_h%frac(m,ind_pav_green) =                                        &
                                 building_surface_pars_f%pars(ind_s_green_frac_w,is)
 
                     IF ( building_surface_pars_f%pars(ind_s_green_frac_r,is) /=                  &
                          building_surface_pars_f%fill )                                          &
-                       surf_usm_h%frac(ind_pav_green,m) =                                        &
+                       surf_usm_h%frac(m,ind_pav_green) =                                        &
                                 building_surface_pars_f%pars(ind_s_green_frac_r,is)
                                 !TODO clarify: why should _w and _r be on the same surface?
@@ -4746,5 +4747,5 @@
                     IF ( building_surface_pars_f%pars(ind_s_win_frac,is) /=                      &
                          building_surface_pars_f%fill )                                          &
-                       surf_usm_h%frac(ind_wat_win,m) =                                          &
+                       surf_usm_h%frac(m,ind_wat_win) =                                          &
                                 building_surface_pars_f%pars(ind_s_win_frac,is)
 
@@ -4826,15 +4827,15 @@
                     IF ( building_surface_pars_f%pars(ind_s_emis_wall,is) /=                     &
                          building_surface_pars_f%fill )                                          &
-                       surf_usm_h%emissivity(ind_veg_wall,m) =                                   &
+                       surf_usm_h%emissivity(m,ind_veg_wall) =                                   &
                                 building_surface_pars_f%pars(ind_s_emis_wall,is)
 
                     IF ( building_surface_pars_f%pars(ind_s_emis_green,is) /=                    &
                          building_surface_pars_f%fill )                                          &
-                       surf_usm_h%emissivity(ind_pav_green,m) =                                  &
+                       surf_usm_h%emissivity(m,ind_pav_green) =                                  &
                                 building_surface_pars_f%pars(ind_s_emis_green,is)
 
                     IF ( building_surface_pars_f%pars(ind_s_emis_win,is) /=                      &
                          building_surface_pars_f%fill )                                          &
-                       surf_usm_h%emissivity(ind_wat_win,m) =                                    &
+                       surf_usm_h%emissivity(m,ind_wat_win) =                                    &
                                 building_surface_pars_f%pars(ind_s_emis_win,is)
 
@@ -4877,15 +4878,15 @@
                        IF ( building_surface_pars_f%pars(ind_s_wall_frac,is) /=                &
                             building_surface_pars_f%fill )                                     &
-                          surf_usm_v(l)%frac(ind_veg_wall,m) =                                 &
+                          surf_usm_v(l)%frac(m,ind_veg_wall) =                                 &
                                    building_surface_pars_f%pars(ind_s_wall_frac,is)
 
                        IF ( building_surface_pars_f%pars(ind_s_green_frac_w,is) /=             &
                             building_surface_pars_f%fill )                                     &
-                          surf_usm_v(l)%frac(ind_pav_green,m) =                                &
+                          surf_usm_v(l)%frac(m,ind_pav_green) =                                &
                                    building_surface_pars_f%pars(ind_s_green_frac_w,is)
 
                        IF ( building_surface_pars_f%pars(ind_s_green_frac_r,is) /=             &
                             building_surface_pars_f%fill )                                     &
-                          surf_usm_v(l)%frac(ind_pav_green,m) =                                &
+                          surf_usm_v(l)%frac(m,ind_pav_green) =                                &
                                    building_surface_pars_f%pars(ind_s_green_frac_r,is)
                                    !TODO clarify: why should _w and _r be on the same surface?
@@ -4893,5 +4894,5 @@
                        IF ( building_surface_pars_f%pars(ind_s_win_frac,is) /=                 &
                             building_surface_pars_f%fill )                                     &
-                          surf_usm_v(l)%frac(ind_wat_win,m) =                                  &
+                          surf_usm_v(l)%frac(m,ind_wat_win) =                                  &
                                    building_surface_pars_f%pars(ind_s_win_frac,is)
 
@@ -4973,15 +4974,15 @@
                        IF ( building_surface_pars_f%pars(ind_s_emis_wall,is) /=      &
                             building_surface_pars_f%fill )                           &
-                          surf_usm_v(l)%emissivity(ind_veg_wall,m) =                 &
+                          surf_usm_v(l)%emissivity(m,ind_veg_wall) =                 &
                                    building_surface_pars_f%pars(ind_s_emis_wall,is)
 
                        IF ( building_surface_pars_f%pars(ind_s_emis_green,is) /=     &
                             building_surface_pars_f%fill )                           &
-                          surf_usm_v(l)%emissivity(ind_pav_green,m) =                &
+                          surf_usm_v(l)%emissivity(m,ind_pav_green) =                &
                                    building_surface_pars_f%pars(ind_s_emis_green,is)
 
                        IF ( building_surface_pars_f%pars(ind_s_emis_win,is) /=       &
                             building_surface_pars_f%fill )                           &
-                          surf_usm_v(l)%emissivity(ind_wat_win,m) =                  &
+                          surf_usm_v(l)%emissivity(m,ind_wat_win) =                  &
                                    building_surface_pars_f%pars(ind_s_emis_win,is)
 
@@ -5015,5 +5016,5 @@
         relative_fractions_corrected = .FALSE.
         DO  m = 1, surf_usm_h%ns
-           sum_frac = SUM( surf_usm_h%frac(:,m) )
+           sum_frac = SUM( surf_usm_h%frac(m,:) )
            IF ( sum_frac /= 1.0_wp )  THEN
               relative_fractions_corrected = .TRUE.
@@ -5023,12 +5024,12 @@
 !--           driver creation. 
               IF ( sum_frac /= 0.0_wp )  THEN
-                 surf_usm_h%frac(:,m) = surf_usm_h%frac(:,m) / sum_frac
+                 surf_usm_h%frac(m,:) = surf_usm_h%frac(m,:) / sum_frac
 !
 !--           In case all relative fractions are erroneously set to zero,
 !--           set wall fraction to 1.
               ELSE
-                 surf_usm_h%frac(ind_veg_wall,m)  = 1.0_wp
-                 surf_usm_h%frac(ind_wat_win,m)   = 0.0_wp
-                 surf_usm_h%frac(ind_pav_green,m) = 0.0_wp
+                 surf_usm_h%frac(m,ind_veg_wall)  = 1.0_wp
+                 surf_usm_h%frac(m,ind_wat_win)   = 0.0_wp
+                 surf_usm_h%frac(m,ind_pav_green) = 0.0_wp
               ENDIF
            ENDIF
@@ -5051,5 +5052,5 @@
         DO  l = 0, 3
            DO  m = 1, surf_usm_v(l)%ns
-              sum_frac = SUM( surf_usm_v(l)%frac(:,m) )
+              sum_frac = SUM( surf_usm_v(l)%frac(m,:) )
               IF ( sum_frac /= 1.0_wp )  THEN
                  relative_fractions_corrected = .TRUE.
@@ -5057,12 +5058,12 @@
 !--              Normalize relative fractions to 1.
                  IF ( sum_frac /= 0.0_wp )  THEN
-                    surf_usm_v(l)%frac(:,m) = surf_usm_v(l)%frac(:,m) / sum_frac
+                    surf_usm_v(l)%frac(m,:) = surf_usm_v(l)%frac(m,:) / sum_frac
 !
 !--              In case all relative fractions are erroneously set to zero,
 !--              set wall fraction to 1.
                  ELSE
-                    surf_usm_v(l)%frac(ind_veg_wall,m)  = 1.0_wp
-                    surf_usm_v(l)%frac(ind_wat_win,m)   = 0.0_wp
-                    surf_usm_v(l)%frac(ind_pav_green,m) = 0.0_wp
+                    surf_usm_v(l)%frac(m,ind_veg_wall)  = 1.0_wp
+                    surf_usm_v(l)%frac(m,ind_wat_win)   = 0.0_wp
+                    surf_usm_v(l)%frac(m,ind_pav_green) = 0.0_wp
                  ENDIF
               ENDIF
@@ -5367,11 +5368,11 @@
                                          - t_wall_h(nzb_wall,m) ) *                &
                                          surf_usm_h%ddz_wall(nzb_wall+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%frac(m,ind_veg_wall)           &
+                                         / (surf_usm_h%frac(m,ind_veg_wall)        &
+                                           + surf_usm_h%frac(m,ind_pav_green) )    &
                                          * surf_usm_h%wghf_eb(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%frac(m,ind_pav_green)          &
+                                          / (surf_usm_h%frac(m,ind_veg_wall)       &
+                                            + surf_usm_h%frac(m,ind_pav_green) )   &
                                          * ( surf_usm_h%lambda_h_green(nzt_wall,m)* wall_mod(nzt_wall) &
                                            * surf_usm_h%ddz_green(nzt_wall,m)      &
@@ -5550,11 +5551,11 @@
                                         - t_wall_v(l)%t(nzb_wall,m) ) *              &
                                         surf_usm_v(l)%ddz_wall(nzb_wall+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)%frac(m,ind_veg_wall)           &
+                                        / (surf_usm_v(l)%frac(m,ind_veg_wall)        &
+                                          + surf_usm_v(l)%frac(m,ind_pav_green) )    &
                                         * surf_usm_v(l)%wghf_eb(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)%frac(m,ind_pav_green)          &
+                                        / (surf_usm_v(l)%frac(m,ind_veg_wall)        &
+                                          + surf_usm_v(l)%frac(m,ind_pav_green) )    &
                                         * ( surf_usm_v(l)%lambda_h_green(nzt_wall,m)* wall_mod(nzt_wall) &
                                           * surf_usm_v(l)%ddz_green(nzt_wall,m)      &
@@ -5768,5 +5769,5 @@
         !$OMP DO SCHEDULE (STATIC)
         DO  m = 1, surf_usm_h%ns
-           IF (surf_usm_h%frac(ind_pav_green,m) > 0.0_wp) THEN
+           IF (surf_usm_h%frac(m,ind_pav_green) > 0.0_wp) THEN
 !
 !--           Obtain indices
@@ -6020,5 +6021,5 @@
            DO  m = 1, surf_usm_v(l)%ns
 
-              IF (surf_usm_v(l)%frac(ind_pav_green,m) > 0.0_wp) THEN
+              IF (surf_usm_v(l)%frac(m,ind_pav_green) > 0.0_wp) THEN
 !
 !-- no substrate layer for green walls / only groundbase green walls (ivy i.e.) -> green layers get same
@@ -7271,5 +7272,5 @@
               ENDIF
 
-              surf_usm_h%albedo(:,m)    = -1.0_wp
+              surf_usm_h%albedo(m,:)    = -1.0_wp
               surf_usm_h%thickness_wall(m) = -1.0_wp
               surf_usm_h%thickness_green(m) = -1.0_wp
@@ -7288,5 +7289,5 @@
               ENDIF
               surf_usm_h%surface_types(m) = usm_par(5,jw,iw)
-              surf_usm_h%albedo(:,m)   = usm_val(1,jw,iw)
+              surf_usm_h%albedo(m,:)   = usm_val(1,jw,iw)
               surf_usm_h%transmissivity(m)    = 0.0_wp
            ENDIF
@@ -7328,10 +7329,10 @@
 !
 !--        Albedo
-           IF ( surf_usm_h%albedo(ind_veg_wall,m) < 0.0_wp )  THEN
-              surf_usm_h%albedo(:,m) = surface_params(ialbedo,ip)
+           IF ( surf_usm_h%albedo(m,ind_veg_wall) < 0.0_wp )  THEN
+              surf_usm_h%albedo(m,:) = surface_params(ialbedo,ip)
            ENDIF
 !
 !--        Albedo type is 0 (custom), others are replaced later
-           surf_usm_h%albedo_type(:,m) = 0
+           surf_usm_h%albedo_type(m,:) = 0
 !
 !--        Transmissivity
@@ -7341,5 +7342,5 @@
 !
 !--        emissivity of the wall
-           surf_usm_h%emissivity(:,m) = surface_params(iemiss,ip)
+           surf_usm_h%emissivity(m,:) = surface_params(iemiss,ip)
 !            
 !--        heat conductivity Î»S between air and wall ( W mâ2 Kâ1 )
@@ -7425,5 +7426,5 @@
                      surf_usm_v(l)%surface_types(m) = roof_category   !< default category for wall surface in roof zone
                  END IF
-                 surf_usm_v(l)%albedo(:,m)         = -1.0_wp
+                 surf_usm_v(l)%albedo(m,:)         = -1.0_wp
                  surf_usm_v(l)%thickness_wall(m)   = -1.0_wp
                  surf_usm_v(l)%thickness_window(m) = -1.0_wp
@@ -7436,5 +7437,5 @@
                      surf_usm_v(l)%surface_types(m)  = pedestrian_category   !< default category for wall surface in
                                                                              !<pedestrian zone
-                     surf_usm_v(l)%albedo(:,m)         = -1.0_wp
+                     surf_usm_v(l)%albedo(m,:)         = -1.0_wp
                      surf_usm_v(l)%thickness_wall(m)   = -1.0_wp
                      surf_usm_v(l)%thickness_window(m) = -1.0_wp
@@ -7443,5 +7444,5 @@
                  ELSE
                      surf_usm_v(l)%surface_types(m)    = usm_par(ii+1,jw,iw)
-                     surf_usm_v(l)%albedo(:,m)         = usm_val(ij,jw,iw)
+                     surf_usm_v(l)%albedo(m,:)         = usm_val(ij,jw,iw)
                      surf_usm_v(l)%thickness_wall(m)   = usm_val(ij+1,jw,iw)
                      surf_usm_v(l)%thickness_window(m) = usm_val(ij+1,jw,iw)
@@ -7454,5 +7455,5 @@
                  IF ( usm_par(ii+3,jw,iw) == 0 )  THEN
                      surf_usm_v(l)%surface_types(m)    = wall_category         !< default category for wall surface
-                     surf_usm_v(l)%albedo(:,m)         = -1.0_wp
+                     surf_usm_v(l)%albedo(m,:)         = -1.0_wp
                      surf_usm_v(l)%thickness_wall(m)   = -1.0_wp
                      surf_usm_v(l)%thickness_window(m) = -1.0_wp
@@ -7461,5 +7462,5 @@
                  ELSE
                      surf_usm_v(l)%surface_types(m)    = usm_par(ii+3,jw,iw)
-                     surf_usm_v(l)%albedo(:,m)         = usm_val(ij+2,jw,iw)
+                     surf_usm_v(l)%albedo(m,:)         = usm_val(ij+2,jw,iw)
                      surf_usm_v(l)%thickness_wall(m)   = usm_val(ij+3,jw,iw)
                      surf_usm_v(l)%thickness_window(m) = usm_val(ij+3,jw,iw)
@@ -7472,5 +7473,5 @@
                  IF ( usm_par(ii+5,jw,iw) == 0 )  THEN
                      surf_usm_v(l)%surface_types(m)    = roof_category         !< default category for roof surface
-                     surf_usm_v(l)%albedo(:,m)         = -1.0_wp
+                     surf_usm_v(l)%albedo(m,:)         = -1.0_wp
                      surf_usm_v(l)%thickness_wall(m)   = -1.0_wp
                      surf_usm_v(l)%thickness_window(m) = -1.0_wp
@@ -7479,5 +7480,5 @@
                  ELSE
                      surf_usm_v(l)%surface_types(m)    = usm_par(ii+5,jw,iw)
-                     surf_usm_v(l)%albedo(:,m)         = usm_val(ij+4,jw,iw)
+                     surf_usm_v(l)%albedo(m,:)         = usm_val(ij+4,jw,iw)
                      surf_usm_v(l)%thickness_wall(m)   = usm_val(ij+5,jw,iw)
                      surf_usm_v(l)%thickness_window(m) = usm_val(ij+5,jw,iw)
@@ -7501,5 +7502,5 @@
                      surf_usm_v(l)%surface_types(m) = roof_category   !< default category for wall surface in roof zone
                  END IF
-                 surf_usm_v(l)%albedo(:,m)         = -1.0_wp
+                 surf_usm_v(l)%albedo(m,:)         = -1.0_wp
                  surf_usm_v(l)%thickness_wall(m)   = -1.0_wp
                  surf_usm_v(l)%thickness_window(m) = -1.0_wp
@@ -7541,9 +7542,9 @@
 !
 !--           Albedo
-              IF ( surf_usm_v(l)%albedo(ind_veg_wall,m) < 0.0_wp )  THEN
-                 surf_usm_v(l)%albedo(:,m) = surface_params(ialbedo,ip)
+              IF ( surf_usm_v(l)%albedo(m,ind_veg_wall) < 0.0_wp )  THEN
+                 surf_usm_v(l)%albedo(m,:) = surface_params(ialbedo,ip)
               ENDIF
 !--           Albedo type is 0 (custom), others are replaced later
-              surf_usm_v(l)%albedo_type(:,m) = 0
+              surf_usm_v(l)%albedo_type(m,:) = 0
 !--           Transmissivity of the windows
               IF ( surf_usm_v(l)%transmissivity(m) < 0.0_wp )  THEN
@@ -7833,10 +7834,10 @@
 !--       Note, this is a temporary fix and need to be removed later.  
            IF ( during_spinup )  THEN
-              frac_win   = surf_usm_h%frac(ind_wat_win,m)
-              frac_wall  = surf_usm_h%frac(ind_veg_wall,m)
-              frac_green = surf_usm_h%frac(ind_pav_green,m)
-              surf_usm_h%frac(ind_wat_win,m)   = 0.0_wp
-              surf_usm_h%frac(ind_veg_wall,m)  = 1.0_wp
-              surf_usm_h%frac(ind_pav_green,m) = 0.0_wp
+              frac_win   = surf_usm_h%frac(m,ind_wat_win)
+              frac_wall  = surf_usm_h%frac(m,ind_veg_wall)
+              frac_green = surf_usm_h%frac(m,ind_pav_green)
+              surf_usm_h%frac(m,ind_wat_win)   = 0.0_wp
+              surf_usm_h%frac(m,ind_veg_wall)  = 1.0_wp
+              surf_usm_h%frac(m,ind_pav_green) = 0.0_wp
            ENDIF
 !
@@ -7869,5 +7870,5 @@
            rho_cp  = c_p * hyp(k) / ( r_d * surf_usm_h%pt1(m) * exner(k) )
 
-           IF ( surf_usm_h%frac(ind_pav_green,m) > 0.0_wp )  THEN
+           IF ( surf_usm_h%frac(m,ind_pav_green) > 0.0_wp )  THEN
 !
 !--           Calculate frequently used parameters
@@ -7921,5 +7922,5 @@
         
 
-           IF ( surf_usm_h%frac(ind_pav_green,m) > 0.0_wp ) THEN
+           IF ( surf_usm_h%frac(m,ind_pav_green) > 0.0_wp ) THEN
 !--           Adapted from LSM:
 !--           Second step: calculate canopy resistance r_canopy
@@ -8021,18 +8022,18 @@
 !--     is used
            coef_1 = surf_usm_h%rad_net_l(m) +                                  & 
-                 ( 3.0_wp + 1.0_wp ) * surf_usm_h%emissivity(ind_veg_wall,m) * &
+                 ( 3.0_wp + 1.0_wp ) * surf_usm_h%emissivity(m,ind_veg_wall) * &
                                        sigma_sb * t_surf_wall_h(m) ** 4 +      &  
                                        f_shf * surf_usm_h%pt1(m) +             &
                                        lambda_surface * t_wall_h(nzb_wall,m)
-           IF ( ( .NOT. during_spinup ) .AND. (surf_usm_h%frac(ind_wat_win,m) > 0.0_wp ) ) THEN
+           IF ( ( .NOT. during_spinup ) .AND. (surf_usm_h%frac(m,ind_wat_win) > 0.0_wp ) ) THEN
               coef_window_1 = surf_usm_h%rad_net_l(m) +                           & 
-                      ( 3.0_wp + 1.0_wp ) * surf_usm_h%emissivity(ind_wat_win,m)  &
+                      ( 3.0_wp + 1.0_wp ) * surf_usm_h%emissivity(m,ind_wat_win)  &
                                           * 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)
            ENDIF                 
-           IF ( ( humidity ) .AND. ( surf_usm_h%frac(ind_pav_green,m) > 0.0_wp ) )  THEN
+           IF ( ( humidity ) .AND. ( surf_usm_h%frac(m,ind_pav_green) > 0.0_wp ) )  THEN
                     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 * &
+                   ( 3.0_wp + 1.0_wp ) * surf_usm_h%emissivity(m,ind_pav_green) * sigma_sb * &
                                        t_surf_green_h(m) ** 4 +                  &  
                                           f_shf_green * surf_usm_h%pt1(m) + f_qsws * ( qv1 - q_s    &
@@ -8041,5 +8042,5 @@
            ELSE
            coef_green_1 = surf_usm_h%rad_net_l(m) +                            & 
-                 ( 3.0_wp + 1.0_wp ) * surf_usm_h%emissivity(ind_pav_green,m) *&
+                 ( 3.0_wp + 1.0_wp ) * surf_usm_h%emissivity(m,ind_pav_green) *&
                                        sigma_sb * t_surf_green_h(m) ** 4 +     &  
                                        f_shf_green * surf_usm_h%pt1(m) +       &
@@ -8048,18 +8049,18 @@
 !
 !--        denominator of the prognostic equation
-           coef_2 = 4.0_wp * surf_usm_h%emissivity(ind_veg_wall,m) *           &
+           coef_2 = 4.0_wp * surf_usm_h%emissivity(m,ind_veg_wall) *           &
                              sigma_sb * t_surf_wall_h(m) ** 3                  &
                            + lambda_surface + f_shf / exner(k)
-           IF ( ( .NOT. during_spinup ) .AND. ( surf_usm_h%frac(ind_wat_win,m) > 0.0_wp ) ) THEN
-              coef_window_2 = 4.0_wp * surf_usm_h%emissivity(ind_wat_win,m) *     &
+           IF ( ( .NOT. during_spinup ) .AND. ( surf_usm_h%frac(m,ind_wat_win) > 0.0_wp ) ) THEN
+              coef_window_2 = 4.0_wp * surf_usm_h%emissivity(m,ind_wat_win) *     &
                                 sigma_sb * t_surf_window_h(m) ** 3                &
                               + lambda_surface_window + f_shf_window / exner(k)
            ENDIF
-           IF ( ( humidity ) .AND. ( surf_usm_h%frac(ind_pav_green,m) > 0.0_wp ) )  THEN
-              coef_green_2 = 4.0_wp * surf_usm_h%emissivity(ind_pav_green,m) * sigma_sb *    &
+           IF ( ( humidity ) .AND. ( surf_usm_h%frac(m,ind_pav_green) > 0.0_wp ) )  THEN
+              coef_green_2 = 4.0_wp * surf_usm_h%emissivity(m,ind_pav_green) * sigma_sb *    &
                                 t_surf_green_h(m) ** 3 + f_qsws * dq_s_dt                    &
                               + lambda_surface_green + f_shf_green / exner(k)
            ELSE
-           coef_green_2 = 4.0_wp * surf_usm_h%emissivity(ind_pav_green,m) * sigma_sb *    &
+           coef_green_2 = 4.0_wp * surf_usm_h%emissivity(m,ind_pav_green) * sigma_sb *    &
                              t_surf_green_h(m) ** 3                                       &
                            + lambda_surface_green + f_shf_green / exner(k)
@@ -8071,5 +8072,5 @@
                              surf_usm_h%c_surface(m) * t_surf_wall_h(m) ) /        & 
                            ( surf_usm_h%c_surface(m) + coef_2 * dt_3d * tsc(2) ) 
-           IF (( .NOT. during_spinup ) .AND. (surf_usm_h%frac(ind_wat_win,m) > 0.0_wp)) THEN
+           IF (( .NOT. during_spinup ) .AND. (surf_usm_h%frac(m,ind_wat_win) > 0.0_wp)) THEN
               t_surf_window_h_p(m) = ( coef_window_1 * dt_3d * tsc(2) +                        &
                                 surf_usm_h%c_surface_window(m) * t_surf_window_h(m) ) /        & 
@@ -8093,7 +8094,7 @@
 !--        store also vpt_surface, which is, due to the lack of moisture on roofs simply
 !--        assumed to be the surface temperature.
-           surf_usm_h%pt_surface(m) = ( surf_usm_h%frac(ind_veg_wall,m) * t_surf_wall_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) )      &
+           surf_usm_h%pt_surface(m) = ( surf_usm_h%frac(m,ind_veg_wall) * t_surf_wall_h_p(m)   &
+                               + surf_usm_h%frac(m,ind_wat_win) * t_surf_window_h_p(m)         &
+                               + surf_usm_h%frac(m,ind_pav_green) * t_surf_green_h_p(m) )      &
                                / exner(k)
                                
@@ -8138,12 +8139,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(ind_veg_wall,m) *                   &
-                                     sigma_sb * surf_usm_h%emissivity(ind_veg_wall,m) *  &
+                                     surf_usm_h%frac(m,ind_veg_wall) *                   &
+                                     sigma_sb * surf_usm_h%emissivity(m,ind_veg_wall) *  &
                                      ( t_surf_wall_h_p(m)**4 - t_surf_wall_h(m)**4 )     &
-                                    + surf_usm_h%frac(ind_wat_win,m) *                   &
-                                     sigma_sb * surf_usm_h%emissivity(ind_wat_win,m) *   &
+                                    + surf_usm_h%frac(m,ind_wat_win) *                   &
+                                     sigma_sb * surf_usm_h%emissivity(m,ind_wat_win) *   &
                                      ( t_surf_window_h_p(m)**4 - t_surf_window_h(m)**4 ) &
-                                    + surf_usm_h%frac(ind_pav_green,m) *                 &
-                                     sigma_sb * surf_usm_h%emissivity(ind_pav_green,m) * &
+                                    + surf_usm_h%frac(m,ind_pav_green) *                 &
+                                     sigma_sb * surf_usm_h%emissivity(m,ind_pav_green) * &
                                      ( t_surf_green_h_p(m)**4 - t_surf_green_h(m)**4 )
 
@@ -8158,9 +8159,9 @@
 !--        ground/wall/roof surface heat flux
            surf_usm_h%wshf_eb(m)   = - f_shf  * ( surf_usm_h%pt1(m) - t_surf_wall_h_p(m) / exner(k) ) *          &
-                                       surf_usm_h%frac(ind_veg_wall,m)         &
+                                       surf_usm_h%frac(m,ind_veg_wall)         &
                                      - f_shf_window  * ( surf_usm_h%pt1(m) - t_surf_window_h_p(m) / exner(k) ) * &
-                                       surf_usm_h%frac(ind_wat_win,m)          &
+                                       surf_usm_h%frac(m,ind_wat_win)          &
                                      - f_shf_green  * ( surf_usm_h%pt1(m) - t_surf_green_h_p(m) / exner(k) ) *   &
-                                       surf_usm_h%frac(ind_pav_green,m)
+                                       surf_usm_h%frac(m,ind_pav_green)
 !           
 !--        store kinematic surface heat fluxes for utilization in other processes
@@ -8175,5 +8176,5 @@
       
 
-           IF (surf_usm_h%frac(ind_pav_green,m) > 0.0_wp) THEN
+           IF (surf_usm_h%frac(m,ind_pav_green) > 0.0_wp) THEN
               
            
@@ -8221,5 +8222,5 @@
                     IF ( m_liq_usm_h%var_usm_1d(m) /= m_liq_max )  THEN
                        surf_usm_h%qsws_liq(m) = surf_usm_h%qsws_liq(m)                &
-                                        + surf_usm_h%frac(ind_pav_green,m) * prr(k+k_off,j+j_off,i+i_off)&
+                                        + surf_usm_h%frac(m,ind_pav_green) * prr(k+k_off,j+j_off,i+i_off)&
                                         * hyrho(k+k_off)                              &
                                         * 0.001_wp * rho_l * l_v
@@ -8286,7 +8287,7 @@
 !--        values are restored.
            IF ( during_spinup )  THEN
-              surf_usm_h%frac(ind_wat_win,m)   = frac_win
-              surf_usm_h%frac(ind_veg_wall,m)  = frac_wall
-              surf_usm_h%frac(ind_pav_green,m) = frac_green
+              surf_usm_h%frac(m,ind_wat_win)   = frac_win
+              surf_usm_h%frac(m,ind_veg_wall)  = frac_wall
+              surf_usm_h%frac(m,ind_pav_green) = frac_green
            ENDIF
  
@@ -8302,10 +8303,10 @@
 !--           Note, this is a temporary fix and need to be removed later. 
               IF ( during_spinup )  THEN
-                 frac_win   = surf_usm_v(l)%frac(ind_wat_win,m)
-                 frac_wall  = surf_usm_v(l)%frac(ind_veg_wall,m)
-                 frac_green = surf_usm_v(l)%frac(ind_pav_green,m)
-                 surf_usm_v(l)%frac(ind_wat_win,m)   = 0.0_wp
-                 surf_usm_v(l)%frac(ind_veg_wall,m)  = 1.0_wp
-                 surf_usm_v(l)%frac(ind_pav_green,m) = 0.0_wp
+                 frac_win   = surf_usm_v(l)%frac(m,ind_wat_win)
+                 frac_wall  = surf_usm_v(l)%frac(m,ind_veg_wall)
+                 frac_green = surf_usm_v(l)%frac(m,ind_pav_green)
+                 surf_usm_v(l)%frac(m,ind_wat_win)   = 0.0_wp
+                 surf_usm_v(l)%frac(m,ind_veg_wall)  = 1.0_wp
+                 surf_usm_v(l)%frac(m,ind_pav_green) = 0.0_wp
               ENDIF
 !
@@ -8331,10 +8332,10 @@
               ENDIF
 !
-!--          calculate rho * c_p coefficient at wall layer
+!--           calculate rho * c_p coefficient at wall layer
               rho_cp  = c_p * hyp(k) / ( r_d * surf_usm_v(l)%pt1(m) * exner(k) )
               
-              IF (surf_usm_v(l)%frac(1,m) > 0.0_wp )  THEN
-!
-!--            Calculate frequently used parameters
+              IF (surf_usm_v(l)%frac(m,ind_pav_green) > 0.0_wp )  THEN
+!
+!--              Calculate frequently used parameters
                  rho_lv    = rho_cp / c_p * l_v
                  drho_l_lv = 1.0_wp / (rho_l * l_v)
@@ -8382,5 +8383,5 @@
  
 
-              IF ( surf_usm_v(l)%frac(ind_pav_green,m) > 0.0_wp ) THEN
+              IF ( surf_usm_v(l)%frac(m,ind_pav_green) > 0.0_wp ) THEN
 !
 !--             Adapted from LSM:
@@ -8460,20 +8461,20 @@
               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(ind_veg_wall,m) *  &
+              ( 3.0_wp + 1.0_wp ) * surf_usm_v(l)%emissivity(m,ind_veg_wall) *  &
                                       sigma_sb *  t_surf_wall_v(l)%t(m) ** 4 +  &  
                                       f_shf * surf_usm_v(l)%pt1(m) +            &
                                       lambda_surface * t_wall_v(l)%t(nzb_wall,m)
-              IF ( ( .NOT. during_spinup ) .AND. ( surf_usm_v(l)%frac(ind_wat_win,m) > 0.0_wp ) ) THEN
+              IF ( ( .NOT. during_spinup ) .AND. ( surf_usm_v(l)%frac(m,ind_wat_win) > 0.0_wp ) ) THEN
                  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) * &
+                ( 3.0_wp + 1.0_wp ) * surf_usm_v(l)%emissivity(m,ind_wat_win) * &
                                       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)
               ENDIF
-              IF ( ( humidity ) .AND. ( surf_usm_v(l)%frac(ind_pav_green,m) > 0.0_wp ) )  THEN
+              IF ( ( humidity ) .AND. ( surf_usm_v(l)%frac(m,ind_pav_green) > 0.0_wp ) )  THEN
                  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(ind_pav_green,m) * sigma_sb *  &
+                 ( 3.0_wp + 1.0_wp ) * surf_usm_v(l)%emissivity(m,ind_pav_green) * sigma_sb *  &
                                       t_surf_green_v(l)%t(m) ** 4 +               &  
                                       f_shf * surf_usm_v(l)%pt1(m) +     f_qsws * ( qv1 - q_s  &
@@ -8483,5 +8484,5 @@
                 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(ind_pav_green,m) * sigma_sb *  &
+                ( 3.0_wp + 1.0_wp ) * surf_usm_v(l)%emissivity(m,ind_pav_green) * sigma_sb *  &
                                       t_surf_green_v(l)%t(m) ** 4 +               &  
                                       f_shf * surf_usm_v(l)%pt1(m) +              &
@@ -8491,18 +8492,18 @@
 !
 !--           denominator of the prognostic equation
-              coef_2 = 4.0_wp * surf_usm_v(l)%emissivity(ind_veg_wall,m) * sigma_sb *   &
+              coef_2 = 4.0_wp * surf_usm_v(l)%emissivity(m,ind_veg_wall) * sigma_sb *   &
                                  t_surf_wall_v(l)%t(m) ** 3                             &
                                + lambda_surface + f_shf / exner(k)  
-              IF ( ( .NOT. during_spinup ) .AND. ( surf_usm_v(l)%frac(ind_wat_win,m) > 0.0_wp ) ) THEN             
-                 coef_window_2 = 4.0_wp * surf_usm_v(l)%emissivity(ind_wat_win,m) * sigma_sb *       &
+              IF ( ( .NOT. during_spinup ) .AND. ( surf_usm_v(l)%frac(m,ind_wat_win) > 0.0_wp ) ) THEN             
+                 coef_window_2 = 4.0_wp * surf_usm_v(l)%emissivity(m,ind_wat_win) * sigma_sb *       &
                                    t_surf_window_v(l)%t(m) ** 3                         &
                                  + lambda_surface_window + f_shf / exner(k)
               ENDIF
-              IF ( ( humidity ) .AND. ( surf_usm_v(l)%frac(ind_pav_green,m) > 0.0_wp ) )  THEN
-                  coef_green_2 = 4.0_wp * surf_usm_v(l)%emissivity(ind_pav_green,m) * sigma_sb *     &
+              IF ( ( humidity ) .AND. ( surf_usm_v(l)%frac(m,ind_pav_green) > 0.0_wp ) )  THEN
+                  coef_green_2 = 4.0_wp * surf_usm_v(l)%emissivity(m,ind_pav_green) * sigma_sb *     &
                                    t_surf_green_v(l)%t(m) ** 3  + f_qsws * dq_s_dt      &
                                  + lambda_surface_green + f_shf / exner(k)
               ELSE
-                 coef_green_2 = 4.0_wp * surf_usm_v(l)%emissivity(ind_pav_green,m) * sigma_sb *      &
+                 coef_green_2 = 4.0_wp * surf_usm_v(l)%emissivity(m,ind_pav_green) * sigma_sb *      &
                                    t_surf_green_v(l)%t(m) ** 3                          &
                                  + lambda_surface_green + f_shf / exner(k)
@@ -8514,5 +8515,5 @@
                              surf_usm_v(l)%c_surface(m) * t_surf_wall_v(l)%t(m) ) / & 
                              ( surf_usm_v(l)%c_surface(m) + coef_2 * dt_3d * tsc(2) ) 
-              IF ( ( .NOT. during_spinup ) .AND. ( surf_usm_v(l)%frac(ind_wat_win,m) > 0.0_wp ) ) THEN
+              IF ( ( .NOT. during_spinup ) .AND. ( surf_usm_v(l)%frac(m,ind_wat_win) > 0.0_wp ) ) THEN
                  t_surf_window_v_p(l)%t(m) = ( coef_window_1 * dt_3d * tsc(2) +                 &
                                 surf_usm_v(l)%c_surface_window(m) * t_surf_window_v(l)%t(m) ) / & 
@@ -8534,7 +8535,7 @@
 !--           store also vpt_surface, which is, due to the lack of moisture on roofs simply
 !--           assumed to be the surface temperature.     
-              surf_usm_v(l)%pt_surface(m) =  ( surf_usm_v(l)%frac(ind_veg_wall,m) * t_surf_wall_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) )     &
+              surf_usm_v(l)%pt_surface(m) =  ( surf_usm_v(l)%frac(m,ind_veg_wall) * t_surf_wall_v_p(l)%t(m)  &
+                                      + surf_usm_v(l)%frac(m,ind_wat_win) * t_surf_window_v_p(l)%t(m)        &
+                                      + surf_usm_v(l)%frac(m,ind_pav_green) * t_surf_green_v_p(l)%t(m) )     &
                                       / exner(k)
                                        
@@ -8582,15 +8583,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(ind_veg_wall,m) *                      &
+              surf_usm_v(l)%rad_net_l(m) = surf_usm_v(l)%frac(m,ind_veg_wall) *                      &
                                            ( surf_usm_v(l)%rad_net_l(m) +                            &
                                            3.0_wp * sigma_sb *                                       &
                                            t_surf_wall_v(l)%t(m)**4 - 4.0_wp * sigma_sb *            &
                                            t_surf_wall_v(l)%t(m)**3 * t_surf_wall_v_p(l)%t(m) )      &
-                                         + surf_usm_v(l)%frac(ind_wat_win,m) *                       &
+                                         + surf_usm_v(l)%frac(m,ind_wat_win) *                       &
                                            ( 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(ind_pav_green,m) *                     &
+                                         + surf_usm_v(l)%frac(m,ind_pav_green) *                     &
                                            ( surf_usm_v(l)%rad_net_l(m) +                            &
                                            3.0_wp * sigma_sb *                                       &
@@ -8609,9 +8610,9 @@
               surf_usm_v(l)%wshf_eb(m)   =                                     &
                  - f_shf  * ( surf_usm_v(l)%pt1(m) -                           &
-                 t_surf_wall_v_p(l)%t(m) / exner(k) ) * surf_usm_v(l)%frac(ind_veg_wall,m)       &
+                 t_surf_wall_v_p(l)%t(m) / exner(k) ) * surf_usm_v(l)%frac(m,ind_veg_wall)       &
                  - f_shf_window  * ( surf_usm_v(l)%pt1(m) -                    &
-                 t_surf_window_v_p(l)%t(m) / exner(k) ) * surf_usm_v(l)%frac(ind_wat_win,m)&
+                 t_surf_window_v_p(l)%t(m) / exner(k) ) * surf_usm_v(l)%frac(m,ind_wat_win)&
                  - f_shf_green  * ( surf_usm_v(l)%pt1(m) -                     &
-                 t_surf_green_v_p(l)%t(m) / exner(k) ) * surf_usm_v(l)%frac(ind_pav_green,m)
+                 t_surf_green_v_p(l)%t(m) / exner(k) ) * surf_usm_v(l)%frac(m,ind_pav_green)
 
 !           
@@ -8627,5 +8628,5 @@
               ENDIF              
 
-              IF ( surf_usm_v(l)%frac(ind_pav_green,m) > 0.0_wp ) THEN
+              IF ( surf_usm_v(l)%frac(m,ind_pav_green) > 0.0_wp ) THEN
  
 
@@ -8683,7 +8684,7 @@
 !--           values are restored.
               IF ( during_spinup )  THEN
-                 surf_usm_v(l)%frac(ind_wat_win,m)   = frac_win
-                 surf_usm_v(l)%frac(ind_veg_wall,m)  = frac_wall
-                 surf_usm_v(l)%frac(ind_pav_green,m) = frac_green
+                 surf_usm_v(l)%frac(m,ind_wat_win)   = frac_win
+                 surf_usm_v(l)%frac(m,ind_veg_wall)  = frac_wall
+                 surf_usm_v(l)%frac(m,ind_pav_green) = frac_green
               ENDIF
 
