Index: palm/trunk/SOURCE/urban_surface_mod.f90
===================================================================
--- palm/trunk/SOURCE/urban_surface_mod.f90	(revision 2735)
+++ palm/trunk/SOURCE/urban_surface_mod.f90	(revision 2737)
@@ -17,5 +17,5 @@
 ! Copyright 2015-2018 Czech Technical University in Prague
 ! Copyright 1997-2018 Leibniz Universitaet Hannover
-!--------------------------------------------------------------------------------!
+!------------------------------------------------------------------------------!
 !
 ! Current revisions:
@@ -26,4 +26,7 @@
 ! -----------------
 ! $Id$
+! Removed unused variables t_surf_whole...
+! 
+! 2735 2018-01-11 12:01:27Z suehring
 ! resistances are saved in surface attributes
 ! 
@@ -529,6 +532,4 @@
     REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_green_h     !< green surface temperature (K) at horizontal walls
     REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_green_h_p   !< progn. green surface temperature (K) at horizontal walls
-    REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_whole_h     !< whole surface temperature (K) at horizontal walls
-    REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_whole_h_p   !< progn. whole surface temperature (K) at horizontal walls
     REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_10cm_h      !< near surface temperature (10cm) (K) at horizontal walls
     REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_10cm_h_p    !< progn. near surface temperature (10cm) (K) at horizontal walls
@@ -539,6 +540,4 @@
     TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  ::  t_surf_green_v
     TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  ::  t_surf_green_v_p
-    TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  ::  t_surf_whole_v
-    TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  ::  t_surf_whole_v_p
     TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  ::  t_surf_10cm_v
     TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  ::  t_surf_10cm_v_p
@@ -550,6 +549,4 @@
     REAL(wp), DIMENSION(:), POINTER                :: t_surf_green_h
     REAL(wp), DIMENSION(:), POINTER                :: t_surf_green_h_p 
-    REAL(wp), DIMENSION(:), POINTER                :: t_surf_whole_h
-    REAL(wp), DIMENSION(:), POINTER                :: t_surf_whole_h_p 
     REAL(wp), DIMENSION(:), POINTER                :: t_surf_10cm_h
     REAL(wp), DIMENSION(:), POINTER                :: t_surf_10cm_h_p
@@ -561,6 +558,4 @@
     REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_green_h_1
     REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_green_h_2
-    REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_whole_h_1
-    REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_whole_h_2
     REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_10cm_h_1
     REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_10cm_h_2
@@ -572,6 +567,4 @@
     TYPE(t_surf_vertical), DIMENSION(:), POINTER ::  t_surf_green_v
     TYPE(t_surf_vertical), DIMENSION(:), POINTER ::  t_surf_green_v_p
-    TYPE(t_surf_vertical), DIMENSION(:), POINTER ::  t_surf_whole_v
-    TYPE(t_surf_vertical), DIMENSION(:), POINTER ::  t_surf_whole_v_p
     TYPE(t_surf_vertical), DIMENSION(:), POINTER ::  t_surf_10cm_v
     TYPE(t_surf_vertical), DIMENSION(:), POINTER ::  t_surf_10cm_v_p
@@ -583,6 +576,4 @@
     TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  :: t_surf_green_v_1
     TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  :: t_surf_green_v_2
-    TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  :: t_surf_whole_v_1
-    TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  :: t_surf_whole_v_2
     TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  :: t_surf_10cm_v_1
     TYPE(t_surf_vertical), DIMENSION(0:3), TARGET  :: t_surf_10cm_v_2
@@ -592,5 +583,4 @@
     REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_window_av   !< average of window surface temperature (K)
     REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_green_av    !< average of green wall surface temperature (K)
-    REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_whole_av    !< average of whole wall surface temperature (K)
     REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET    :: t_surf_10cm_av    !< average of whole wall surface temperature (K)
 
@@ -941,8 +931,4 @@
         IF ( .NOT. ALLOCATED( t_green_h_p ) )                                  &           
            ALLOCATE ( t_green_h_p(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) )  
-        IF ( .NOT. ALLOCATED( t_surf_whole_h ) )                               &
-           ALLOCATE ( t_surf_whole_h(1:surf_usm_h%ns) )
-        IF ( .NOT. ALLOCATED( t_surf_whole_h_p ) )                             &
-           ALLOCATE ( t_surf_whole_h_p(1:surf_usm_h%ns) )           
         IF ( .NOT. ALLOCATED( t_surf_10cm_h ) )                                &
            ALLOCATE ( t_surf_10cm_h(1:surf_usm_h%ns) )
@@ -977,8 +963,4 @@
         IF ( .NOT. ALLOCATED( t_green_h_2 ) )                                  &           
            ALLOCATE ( t_green_h_2(nzb_wall:nzt_wall+1,1:surf_usm_h%ns) )          
-        IF ( .NOT. ALLOCATED( t_surf_whole_h_1 ) )                             &
-           ALLOCATE ( t_surf_whole_h_1(1:surf_usm_h%ns) )
-        IF ( .NOT. ALLOCATED( t_surf_whole_h_2 ) )                             &
-           ALLOCATE ( t_surf_whole_h_2(1:surf_usm_h%ns) )
         IF ( .NOT. ALLOCATED( t_surf_10cm_h_1 ) )                              &
            ALLOCATE ( t_surf_10cm_h_1(1:surf_usm_h%ns) )
@@ -993,5 +975,4 @@
         t_surf_window_h => t_surf_window_h_1; t_surf_window_h_p => t_surf_window_h_2  
         t_surf_green_h => t_surf_green_h_1; t_surf_green_h_p => t_surf_green_h_2           
-        t_surf_whole_h => t_surf_whole_h_1; t_surf_whole_h_p => t_surf_whole_h_2
         t_surf_10cm_h => t_surf_10cm_h_1; t_surf_10cm_h_p => t_surf_10cm_h_2  
  
@@ -1025,8 +1006,4 @@
            IF ( .NOT. ALLOCATED( t_surf_green_v_p(l)%t ) )                     &
               ALLOCATE ( t_surf_green_v_p(l)%t(1:surf_usm_v(l)%ns) )
-           IF ( .NOT. ALLOCATED( t_surf_whole_v(l)%t ) )                       &
-              ALLOCATE ( t_surf_whole_v(l)%t(1:surf_usm_v(l)%ns) )
-           IF ( .NOT. ALLOCATED( t_surf_whole_v_p(l)%t ) )                     &
-              ALLOCATE ( t_surf_whole_v_p(l)%t(1:surf_usm_v(l)%ns) )
            IF ( .NOT. ALLOCATED( t_surf_10cm_v(l)%t ) )                        &
               ALLOCATE ( t_surf_10cm_v(l)%t(1:surf_usm_v(l)%ns) )
@@ -1063,8 +1040,4 @@
            IF ( .NOT. ALLOCATED( t_green_v_2(l)%t ) )                          &           
               ALLOCATE ( t_green_v_2(l)%t(nzb_wall:nzt_wall+1,1:surf_usm_v(l)%ns) )  
-           IF ( .NOT. ALLOCATED( t_surf_whole_v_1(l)%t ) )                     &
-              ALLOCATE ( t_surf_whole_v_1(l)%t(1:surf_usm_v(l)%ns) )
-           IF ( .NOT. ALLOCATED( t_surf_whole_v_2(l)%t ) )                     &
-              ALLOCATE ( t_surf_whole_v_2(l)%t(1:surf_usm_v(l)%ns) )
            IF ( .NOT. ALLOCATED( t_surf_10cm_v_1(l)%t ) )                     &
               ALLOCATE ( t_surf_10cm_v_1(l)%t(1:surf_usm_v(l)%ns) )
@@ -1080,5 +1053,4 @@
         t_surf_window_v => t_surf_window_v_1; t_surf_window_v_p => t_surf_window_v_2
         t_surf_green_v => t_surf_green_v_1; t_surf_green_v_p => t_surf_green_v_2
-        t_surf_whole_v => t_surf_whole_v_1; t_surf_whole_v_p => t_surf_whole_v_2
         t_surf_10cm_v => t_surf_10cm_v_1; t_surf_10cm_v_p => t_surf_10cm_v_2
 
@@ -1454,17 +1426,4 @@
                     ENDDO
                 
-                CASE ( 'usm_t_surf_whole' )
-!--                 surface temperature for whole surfaces
-                    IF ( .NOT.  ALLOCATED(surf_usm_h%t_surf_whole_av) )  THEN
-                        ALLOCATE( surf_usm_h%t_surf_whole_av(1:surf_usm_h%ns) )
-                        surf_usm_h%t_surf_whole_av = 0.0_wp
-                    ENDIF
-                    DO  l = 0, 3
-                       IF ( .NOT.  ALLOCATED(surf_usm_v(l)%t_surf_whole_av) )  THEN
-                           ALLOCATE( surf_usm_v(l)%t_surf_whole_av(1:surf_usm_v(l)%ns) )
-                           surf_usm_v(l)%t_surf_whole_av = 0.0_wp
-                       ENDIF
-                    ENDDO
-                    
                 CASE ( 'usm_t_surf_10cm' )
 !--                 near surface temperature for whole surfaces
@@ -1785,19 +1744,4 @@
                     ENDDO
                 
-                CASE ( 'usm_t_surf_whole' )
-!--                 surface temperature for whole surfaces
-                    DO  m = 1, surf_usm_h%ns
-                       surf_usm_h%t_surf_whole_av(m) =                               & 
-                                          surf_usm_h%t_surf_whole_av(m) +            &
-                                          t_surf_whole_h(m)
-                    ENDDO
-                    DO  l = 0, 3
-                       DO  m = 1, surf_usm_v(l)%ns
-                          surf_usm_v(l)%t_surf_whole_av(m) =                         &
-                                          surf_usm_v(l)%t_surf_whole_av(m) +         &
-                                          t_surf_whole_v(l)%t(m)
-                       ENDDO
-                    ENDDO
-                    
                 CASE ( 'usm_t_surf_10cm' )
 !--                 near surface temperature for whole surfaces
@@ -2119,19 +2063,4 @@
                           surf_usm_v(l)%t_surf_green_av(m) =                         &
                                           surf_usm_v(l)%t_surf_green_av(m) /         &
-                                          REAL( average_count_3d, kind=wp )
-                       ENDDO
-                    ENDDO
-                    
-                CASE ( 'usm_t_surf_whole' )
-!--                 surface temperature for whole surfaces
-                    DO  m = 1, surf_usm_h%ns
-                       surf_usm_h%t_surf_whole_av(m) =                               & 
-                                          surf_usm_h%t_surf_whole_av(m) /            &
-                                          REAL( average_count_3d, kind=wp )
-                    ENDDO
-                    DO  l = 0, 3
-                       DO  m = 1, surf_usm_v(l)%ns
-                          surf_usm_v(l)%t_surf_whole_av(m) =                         &
-                                          surf_usm_v(l)%t_surf_whole_av(m) /         &
                                           REAL( average_count_3d, kind=wp )
                        ENDDO
@@ -2279,5 +2208,5 @@
                   var(1:12) == 'usm_t_window' .OR. var(1:17) == 'usm_t_surf_window' .OR.  &
                   var(1:16) == 'usm_t_surf_green'  .OR.                                   &
-                  var(1:16) == 'usm_t_surf_whole' .OR. var(1:11) == 'usm_t_green' .OR.    &
+                  var(1:11) == 'usm_t_green' .OR.                                         &
                   var(1:15) == 'usm_t_surf_10cm')  THEN
             unit = 'K'
@@ -3062,42 +2991,4 @@
               ENDIF
 
-          CASE ( 'usm_t_surf_whole' )
-!--           surface temperature for whole surfaces
-
-              IF ( av == 0 )  THEN
-                 DO  m = 1, surf_usm_h%ns
-                    i = surf_usm_h%i(m)
-                    j = surf_usm_h%j(m)
-                    k = surf_usm_h%k(m)
-                    temp_pf(k,j,i) = t_surf_whole_h(m)
-                 ENDDO
-                 DO  l = 0, 3
-                    DO  m = 1, surf_usm_v(l)%ns
-                       i = surf_usm_v(l)%i(m)
-                       j = surf_usm_v(l)%j(m)
-                       k = surf_usm_v(l)%k(m)
-                       temp_pf(k,j,i) = t_surf_whole_v(l)%t(m)
-                    ENDDO
-                 ENDDO
-
-              ELSE
-                 DO  m = 1, surf_usm_h%ns
-                    i = surf_usm_h%i(m)
-                    j = surf_usm_h%j(m)
-                    k = surf_usm_h%k(m)
-                    temp_pf(k,j,i) = surf_usm_h%t_surf_whole_av(m)
-                 ENDDO
-                 DO  l = 0, 3
-                    DO  m = 1, surf_usm_v(l)%ns
-                       i = surf_usm_v(l)%i(m)
-                       j = surf_usm_v(l)%j(m)
-                       k = surf_usm_v(l)%k(m)
-                       temp_pf(k,j,i) = surf_usm_v(l)%t_surf_whole_av(m)
-                    ENDDO
-
-                 ENDDO
-
-              ENDIF
-              
           CASE ( 'usm_t_surf_10cm' )
 !--           near surface temperature for whole surfaces
@@ -3292,5 +3183,5 @@
              var(1:10) == 'usm_t_surf'  .OR.  var(1:10) == 'usm_t_wall'  .OR.               &
              var(1:17) == 'usm_t_surf_window'  .OR.  var(1:12) == 'usm_t_window'  .OR.      &
-             var(1:16) == 'usm_t_surf_green'  .OR.  var(1:16) == 'usm_t_surf_whole' .OR.    &
+             var(1:16) == 'usm_t_surf_green'  .OR.                                          &
              var(1:15) == 'usm_t_surf_10cm' .OR.                                            &
              var(1:9) == 'usm_surfz'  .OR.  var(1:7) == 'usm_svf'  .OR.                     & 
@@ -4488,5 +4379,5 @@
                t_surf_window_h(m) = pt(k,j,i) * exn
                t_surf_green_h(m) = pt(k,j,i) * exn
-               t_surf_whole_h(m) = pt(k,j,i) * exn
+               surf_usm_h%pt_surface(m) = pt(k,j,i) * exn
             ENDDO
 !
@@ -4501,5 +4392,5 @@
                   t_surf_window_v(l)%t(m) = pt(k,j,i) * exn
                   t_surf_green_v(l)%t(m) = pt(k,j,i) * exn
-                  t_surf_whole_v(l)%t(m) = pt(k,j,i) * exn
+                  surf_usm_v(l)%pt_surface(m) = pt(k,j,i) * exn
                ENDDO
             ENDDO
@@ -4563,6 +4454,4 @@
         t_surf_window_h_p = t_surf_window_h
         t_surf_window_v_p = t_surf_window_v
-        t_surf_whole_h_p = t_surf_whole_h
-        t_surf_whole_v_p = t_surf_whole_v
         t_surf_green_h_p = t_surf_green_h
         t_surf_green_v_p = t_surf_green_v
@@ -5151,5 +5040,5 @@
           k = surf_usm_h%k(m)
 
-          t_surf_10cm_h(m) = t_surf_whole_h(m) + surf_usm_h%ts(m) / kappa        &
+          t_surf_10cm_h(m) = surf_usm_h%pt_surface(m) + surf_usm_h%ts(m) / kappa        &
                              * ( log( 0.1_wp /  surf_usm_h%z0h(m) )              &
                                - psi_h( 0.1_wp / surf_usm_h%ol(m) )              &
@@ -5167,5 +5056,5 @@
              k = surf_usm_v(l)%k(m)
 
-             t_surf_10cm_v(l)%t(m) = t_surf_whole_v(l)%t(m) + surf_usm_v(l)%ts(m) / kappa &
+             t_surf_10cm_v(l)%t(m) =surf_usm_v(l)%pt_surface(m) + surf_usm_v(l)%ts(m) / kappa &
                                      * ( log( 0.1_wp / surf_usm_v(l)%z0h(m) )             &
                                        - psi_h( 0.1_wp / surf_usm_v(l)%ol(m) )            &
@@ -7385,6 +7274,4 @@
        t_green_h    = t_green_h_p
        t_green_v    = t_green_v_p
-       t_surf_whole_h    = t_surf_whole_h_p
-       t_surf_whole_v    = t_surf_whole_v_p
 #else
        SELECT CASE ( mod_count )
@@ -7398,5 +7285,4 @@
              t_surf_green_h  => t_surf_green_h_1; t_surf_green_h_p  => t_surf_green_h_2
              t_green_h     => t_green_h_1;    t_green_h_p     => t_green_h_2
-             t_surf_whole_h  => t_surf_whole_h_1; t_surf_whole_h_p  => t_surf_whole_h_2
 !
 !--          Vertical surfaces
@@ -7407,5 +7293,4 @@
              t_surf_green_v  => t_surf_green_v_1; t_surf_green_v_p  => t_surf_green_v_2
              t_green_v     => t_green_v_1;    t_green_v_p     => t_green_v_2
-             t_surf_whole_v  => t_surf_whole_v_1; t_surf_whole_v_p  => t_surf_whole_v_2
           CASE ( 1 )
 !
@@ -7417,5 +7302,4 @@
              t_surf_green_h  => t_surf_green_h_2; t_surf_green_h_p  => t_surf_green_h_1
              t_green_h     => t_green_h_2;    t_green_h_p     => t_green_h_1
-             t_surf_whole_h  => t_surf_whole_h_2; t_surf_whole_h_p  => t_surf_whole_h_1
 !
 !--          Vertical surfaces
@@ -7426,5 +7310,4 @@
              t_surf_green_v  => t_surf_green_v_2; t_surf_green_v_p  => t_surf_green_v_1
              t_green_v     => t_green_v_2;    t_green_v_p     => t_green_v_1
-             t_surf_whole_v  => t_surf_whole_v_2; t_surf_whole_v_p  => t_surf_whole_v_1
        END SELECT
 #endif
