Index: palm/trunk/SOURCE/land_surface_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/land_surface_model_mod.f90	(revision 2765)
+++ palm/trunk/SOURCE/land_surface_model_mod.f90	(revision 2797)
@@ -25,4 +25,10 @@
 ! -----------------
 ! $Id$
+! Move output of ghf to general 2D output to output ghf also at urban-type 
+! surfaces. 
+! Move restart data of ghf_av to read/write_3d_binary, as this is not a 
+! exclusively LSM variable anymore.   
+! 
+! 2765 2018-01-22 11:34:58Z maronga
 ! Major bugfix in calculation of f_shf for vertical surfaces
 ! 
@@ -598,5 +604,4 @@
               c_soil_av,        & !< average of c_soil
               c_veg_av,         & !< average of c_veg
-              ghf_av,           & !< average of ghf
               lai_av,           & !< average of lai
               qsws_liq_av,      & !< average of qsws_liq
@@ -1044,5 +1049,5 @@
           unit = 'K'   
              
-       CASE ( 'lai*', 'c_liq*', 'c_soil*', 'c_veg*', 'ghf*', 'm_liq*',         &
+       CASE ( 'lai*', 'c_liq*', 'c_soil*', 'c_veg*', 'm_liq*',                 &
               'qsws_liq*', 'qsws_soil*', 'qsws_veg*', 'r_s*' )
           IF ( k == 0  .OR.  data_output(i)(ilen-2:ilen) /= '_xy' )  THEN
@@ -1072,9 +1077,4 @@
              CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 )
           ENDIF
-          IF ( TRIM( var ) == 'ghf*'  .AND.  .NOT.  land_surface )  THEN
-             message_string = 'output of "' // TRIM( var ) // '" requi' //     &
-                              'res land_surface = .TRUE.'
-             CALL message( 'check_parameters', 'PA0404', 1, 2, 0, 6, 0 )
-          ENDIF
           IF ( TRIM( var ) == 'm_liq*'  .AND.  .NOT.  land_surface )  THEN
              message_string = 'output of "' // TRIM( var ) // '" requi' //     &
@@ -1111,5 +1111,4 @@
           IF ( TRIM( var ) == 'c_soil*')      unit = 'none'
           IF ( TRIM( var ) == 'c_veg*' )      unit = 'none'
-          IF ( TRIM( var ) == 'ghf*')         unit = 'W/m2'
           IF ( TRIM( var ) == 'm_liq*'     )  unit = 'm'
           IF ( TRIM( var ) == 'qsws_liq*'  )  unit = 'W/m2'
@@ -5042,10 +5041,4 @@
                 c_veg_av = 0.0_wp
 
-             CASE ( 'ghf*' )
-                IF ( .NOT. ALLOCATED( ghf_av ) )  THEN
-                   ALLOCATE( ghf_av(nysg:nyng,nxlg:nxrg) )
-                ENDIF
-                ghf_av = 0.0_wp
-
              CASE ( 'lai*' )
                 IF ( .NOT. ALLOCATED( lai_av ) )  THEN
@@ -5124,11 +5117,4 @@
                 j   = surf_lsm_h%j(m)
                 c_veg_av(j,i) = c_veg_av(j,i) + surf_lsm_h%c_veg(m)
-             ENDDO
-
-          CASE ( 'ghf*' )
-             DO  m = 1, surf_lsm_h%ns
-                i   = surf_lsm_h%i(m)            
-                j   = surf_lsm_h%j(m)
-                ghf_av(j,i) = ghf_av(j,i) + surf_lsm_h%ghf(m)
              ENDDO
 
@@ -5226,12 +5212,4 @@
                    c_veg_av(j,i) = c_veg_av(j,i)                               &
                                    / REAL( average_count_3d, KIND=wp )
-                ENDDO
-             ENDDO
-
-          CASE ( 'ghf*' )
-             DO  i = nxl, nxr
-                DO  j = nys, nyn
-                   ghf_av(j,i) = ghf_av(j,i)                                   &
-                                 / REAL( average_count_3d, KIND=wp )
                 ENDDO
              ENDDO
@@ -5439,22 +5417,4 @@
                 DO  j = nys, nyn
                    local_pf(i,j,nzb+1) = c_veg_av(j,i)
-                ENDDO
-             ENDDO
-          ENDIF
-
-          two_d = .TRUE.
-          grid = 'zu1'
-
-       CASE ( 'ghf*_xy' )        ! 2d-array
-          IF ( av == 0 )  THEN
-             DO  m = 1, surf_lsm_h%ns
-                i                   = surf_lsm_h%i(m)            
-                j                   = surf_lsm_h%j(m)
-                local_pf(i,j,nzb+1) = surf_lsm_h%ghf(m)
-             ENDDO
-          ELSE
-             DO  i = nxl, nxr
-                DO  j = nys, nyn
-                   local_pf(i,j,nzb+1) = ghf_av(j,i)
                 ENDDO
              ENDDO
@@ -5750,7 +5710,4 @@
        IF ( ALLOCATED( c_veg_av ) )  THEN
           WRITE ( 14 )  'c_veg_av            ';  WRITE ( 14 ) c_veg_av
-       ENDIF
-       IF ( ALLOCATED( ghf_av ) )  THEN
-          WRITE ( 14 )  'ghf_av              ';  WRITE ( 14 )  ghf_av
        ENDIF
        IF ( ALLOCATED( lai_av ) )  THEN
@@ -5993,12 +5950,4 @@
                                   tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
 
-                CASE ( 'ghf_av' )
-                   IF ( .NOT. ALLOCATED( ghf_av ) )  THEN
-                      ALLOCATE( ghf_av(nysg:nyng,nxlg:nxrg) )
-                   ENDIF
-                   IF ( k == 1 )  READ ( 13 )  tmp_2d
-                   ghf_av(nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =           &
-                                  tmp_2d(nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
-
                 CASE ( 'lai_av' )
                    IF ( .NOT. ALLOCATED( lai_av ) )  THEN
