Index: palm/trunk/LIB/rrtmg/install_rrtmg
===================================================================
--- palm/trunk/LIB/rrtmg/install_rrtmg	(revision 3942)
+++ palm/trunk/LIB/rrtmg/install_rrtmg	(revision 3943)
@@ -53,12 +53,19 @@
 #
 
+
+%cpp_options         -cpp -D__parallel -DMPI_REAL=MPI_DOUBLE_PRECISION -DMPI_2REAL=MPI_2DOUBLE_PRECISION -D__fftw -D__netcdf -D__netcdf4 -D__netcdf4_parallel
+%make_options        -j 4
+%compiler_options    -fpe0 -O3 -xHost -fp-model source -ftz -fno-alias -no-prec-div -no-prec-sqrt -ip -I /muksoft/packages/fftw/3.3.7/mvapich2-2.3rc1/gnu/include/ -I /muksoft/packages/netcdf4_hdf5parallel/4411c_443f/hdf5-1.10.0-patch1/mvapich2-2.3rc1/intel/2018.1.163/include/
+%linker_options      -parallel -fpe0 -O3 -xHost -fp-model source -ftz -fno-alias -no-prec-div -no-prec-sqrt -ip -L/muksoft/packages/fftw/3.3.7/mvapich2-2.3rc1/gnu/lib64/ -lfftw3 -L/muksoft/packages/netcdf4_hdf5parallel/4411c_443f/hdf5-1.10.0-patch1/mvapich2-2.3rc1/intel/2018.1.163/lib64/ -lnetcdf -lnetcdff
+
+
  compiler_name="mpif90"
- fopts="-fltconsistency -O3 -cpp -r8 -nbs -convert little_endian -I /muksoft/packages/netcdf/4_intel/include"
+ fopts="-cpp -DMPI_REAL=MPI_DOUBLE_PRECISION -DMPI_2REAL=MPI_2DOUBLE_PRECISION -fpe0 -O3 -xHost -fp-model source -ftz -fno-alias -no-prec-div -no-prec-sqrt -ip -I /muksoft/packages/fftw/3.3.7/mvapich2-2.3rc1/gnu/include/ -I /muksoft/packages/netcdf4_hdf5parallel/4411c_443f/hdf5-1.10.0-patch1/mvapich2-2.3rc1/intel/2018.1.163/include/"
  fopts_trace="-fpe0 -C -check nooutput_conversion -debug -traceback -g -w -xT -O0 -ftz -fno-alias -no-prec-div -no-prec-sqrt -ip -nbs -convert little_endian -diag-disable 8290,8291 -I /muksoft/packages/netcdf/4_intel/include"
- install_path="$HOME/rrtmg"
+ install_path="$HOME/palm/rrtmg"
  compile_static=false
- compile_shared=false
- compile_static_debug=true
- compile_shared_debug=true
+ compile_shared=true
+ compile_static_debug=false
+ compile_shared_debug=false
 
  while  getopts  p: option
Index: palm/trunk/SCRIPTS/palm_wd
===================================================================
--- palm/trunk/SCRIPTS/palm_wd	(revision 3942)
+++ palm/trunk/SCRIPTS/palm_wd	(revision 3943)
@@ -84,5 +84,5 @@
 #------------------------------------------------------------------------------!
 
-import ConfigParser
+import ConfigParser as configparser
 import datetime
 import os
@@ -97,6 +97,10 @@
 #  Check if configuration files exists and quit otherwise
 input_config = ".wd.config"
-for i in range(1,len(sys.argv)): 
+
+for i in range(0,len(sys.argv)): 
+   out = sub.check_output("echo $PALM_BIN", shell=True, stderr=sub.STDOUT)
    input_config = str(sys.argv[i])
+   palm_bin = out.rstrip()
+   palm_dir = out.split("palm")[0] + "palm/" + out.split("palm")[1].split("/")[1]
         
 config = configparser.RawConfigParser(allow_no_value=True)
@@ -108,6 +112,10 @@
    print(os.path.isfile(input_config))
 
+print(input_config)
+
 config.read(input_config)  
 
+config = ConfigParser.RawConfigParser()
+config.read(palm_dir + '/.wd.config')
 
 description = []
@@ -115,4 +123,5 @@
 username = []
 pycall = []
+
 
 for i in range(0,len(config.sections())):
Index: palm/trunk/SOURCE/data_output_2d.f90
===================================================================
--- palm/trunk/SOURCE/data_output_2d.f90	(revision 3942)
+++ palm/trunk/SOURCE/data_output_2d.f90	(revision 3943)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Added output of qsws for green roofs.
+! 
+! 3885 2019-04-11 11:29:34Z kanani
 ! Changes related to global restructuring of location messages and introduction 
 ! of additional debug messages
@@ -919,4 +922,10 @@
                       k = surf_lsm_h%k(m)
                       local_pf(i,j,nzb+1) = surf_lsm_h%qsws(m) * l_v
+                   ENDDO
+                   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)
+                      local_pf(i,j,nzb+1) = surf_usm_h%qsws(m) * l_v
                    ENDDO
                 ELSE
Index: palm/trunk/SOURCE/land_surface_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/land_surface_model_mod.f90	(revision 3942)
+++ palm/trunk/SOURCE/land_surface_model_mod.f90	(revision 3943)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Removed extra blank character
+! 
+! 3941 2019-04-30 09:48:33Z suehring
 ! Check that at least one surface type is set at surface element.
 ! 
@@ -5475,5 +5478,5 @@
 
 
-             IF (  calc_soil_moisture )  THEN
+             IF ( calc_soil_moisture )  THEN
 
 !
Index: palm/trunk/SOURCE/netcdf_data_input_mod.f90
===================================================================
--- palm/trunk/SOURCE/netcdf_data_input_mod.f90	(revision 3942)
+++ palm/trunk/SOURCE/netcdf_data_input_mod.f90	(revision 3943)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Temporarily disabled some (faulty) checks for static driver.
+! 
+! 3942 2019-04-30 13:08:30Z kanani
 ! Fix: increase LEN of all NetCDF attribute values (caused crash in 
 ! netcdf_create_global_atts due to insufficient length)
@@ -4256,62 +4259,62 @@
 !
 !--          Check if building_type is set at each building and vice versa.
-             IF ( building_type_f%from_file  .AND.  buildings_f%from_file )  THEN
-                IF ( buildings_f%lod == 1 )  THEN
-                   IF ( buildings_f%var_2d(j,i)  /= buildings_f%fill1  .AND.   &
-                        building_type_f%var(j,i) == building_type_f%fill  .OR. &
-                        buildings_f%var_2d(j,i)  == buildings_f%fill1  .AND.   &
-                        building_type_f%var(j,i) /= building_type_f%fill )  THEN
-                      WRITE( message_string, * ) 'Each location where a ' //   &
-                                      '2D building is set requires a type ' // &
-                                      '( and vice versa ) in case the ' //     &
-                                      'urban-surface model is applied. ' //    &
-                                      'i, j = ', i, j
-                      CALL message( 'netcdf_data_input_mod', 'PA0573',         &
-                                     2, 2, myid, 6, 0 )
-                   ENDIF
-                ENDIF
-                IF ( buildings_f%lod == 2 )  THEN
-                   IF ( ANY( buildings_f%var_3d(:,j,i) == 1 )  .AND.           &
-                        building_type_f%var(j,i) == building_type_f%fill  .OR. &
-                  .NOT. ANY( buildings_f%var_3d(:,j,i) == 1 )  .AND.           &
-                        building_type_f%var(j,i) /= building_type_f%fill )  THEN
-                      WRITE( message_string, * ) 'Each location where a ' //   &
-                                      '3D building is set requires a type ' // &
-                                      '( and vice versa ) in case the ' //     &
-                                      'urban-surface model is applied. ' //    &
-                                      'i, j = ', i, j
-                      CALL message( 'netcdf_data_input_mod', 'PA0573',         &
-                                     2, 2, myid, 6, 0 )
-                   ENDIF
-                ENDIF
-             ENDIF
+!              IF ( building_type_f%from_file  .AND.  buildings_f%from_file )  THEN
+!                 IF ( buildings_f%lod == 1 )  THEN
+!                    IF ( buildings_f%var_2d(j,i)  /= buildings_f%fill1  .AND.   &
+!                         building_type_f%var(j,i) == building_type_f%fill  .OR. &
+!                         buildings_f%var_2d(j,i)  == buildings_f%fill1  .AND.   &
+!                         building_type_f%var(j,i) /= building_type_f%fill )  THEN
+!                       WRITE( message_string, * ) 'Each location where a ' //   &
+!                                       '2D building is set requires a type ' // &
+!                                       '( and vice versa ) in case the ' //     &
+!                                       'urban-surface model is applied. ' //    &
+!                                       'i, j = ', i, j
+!                       CALL message( 'netcdf_data_input_mod', 'PA0573',         &
+!                                      2, 2, myid, 6, 0 )
+!                    ENDIF
+!                 ENDIF
+!                 IF ( buildings_f%lod == 2 )  THEN
+!                    IF ( ANY( buildings_f%var_3d(:,j,i) == 1 )  .AND.           &
+!                         building_type_f%var(j,i) == building_type_f%fill  .OR. &
+!                   .NOT. ANY( buildings_f%var_3d(:,j,i) == 1 )  .AND.           &
+!                         building_type_f%var(j,i) /= building_type_f%fill )  THEN
+!                       WRITE( message_string, * ) 'Each location where a ' //   &
+!                                       '3D building is set requires a type ' // &
+!                                       '( and vice versa ) in case the ' //     &
+!                                       'urban-surface model is applied. ' //    &
+!                                       'i, j = ', i, j
+!                       CALL message( 'netcdf_data_input_mod', 'PA0573',         &
+!                                      2, 2, myid, 6, 0 )
+!                    ENDIF
+!                 ENDIF
+!              ENDIF
 !
 !--          Check if at each location where a building is present also an ID
 !--          is set and vice versa.
-             IF ( buildings_f%from_file )  THEN
-                IF ( buildings_f%lod == 1 )  THEN
-                   IF ( buildings_f%var_2d(j,i) /= buildings_f%fill1  .AND.    &
-                        building_id_f%var(j,i)  == building_id_f%fill  .OR.    &
-                        buildings_f%var_2d(j,i) == buildings_f%fill1  .AND.    &
-                        building_id_f%var(j,i)  /= building_id_f%fill )  THEN
-                      WRITE( message_string, * ) 'Each location where a ' //   &
-                                      '2D building is set requires an ID ' //  &
-                                      '( and vice versa ). i, j = ', i, j
-                      CALL message( 'netcdf_data_input_mod', 'PA0574',         &
-                                     2, 2, myid, 6, 0 )
-                   ENDIF
-                ELSEIF ( buildings_f%lod == 2 )  THEN
-                   IF ( ANY( buildings_f%var_3d(:,j,i) == 1 )  .AND.           &
-                        building_id_f%var(j,i) == building_id_f%fill  .OR.     &
-                  .NOT. ANY( buildings_f%var_3d(:,j,i) == 1 )  .AND.           &
-                        building_id_f%var(j,i) /= building_id_f%fill )  THEN
-                      WRITE( message_string, * ) 'Each location where a ' //   &
-                                      '3D building is set requires an ID ' //  &
-                                      '( and vice versa ). i, j = ', i, j
-                      CALL message( 'netcdf_data_input_mod', 'PA0574',         &
-                                     2, 2, myid, 6, 0 )
-                   ENDIF
-                ENDIF
-             ENDIF
+!              IF ( buildings_f%from_file )  THEN
+!                 IF ( buildings_f%lod == 1 )  THEN
+!                    IF ( buildings_f%var_2d(j,i) /= buildings_f%fill1  .AND.    &
+!                         building_id_f%var(j,i)  == building_id_f%fill  .OR.    &
+!                         buildings_f%var_2d(j,i) == buildings_f%fill1  .AND.    &
+!                         building_id_f%var(j,i)  /= building_id_f%fill )  THEN
+!                       WRITE( message_string, * ) 'Each location where a ' //   &
+!                                       '2D building is set requires an ID ' //  &
+!                                       '( and vice versa ). i, j = ', i, j
+!                       CALL message( 'netcdf_data_input_mod', 'PA0574',         &
+!                                      2, 2, myid, 6, 0 )
+!                    ENDIF
+!                 ELSEIF ( buildings_f%lod == 2 )  THEN
+!                    IF ( ANY( buildings_f%var_3d(:,j,i) == 1 )  .AND.           &
+!                         building_id_f%var(j,i) == building_id_f%fill  .OR.     &
+!                   .NOT. ANY( buildings_f%var_3d(:,j,i) == 1 )  .AND.           &
+!                         building_id_f%var(j,i) /= building_id_f%fill )  THEN
+!                       WRITE( message_string, * ) 'Each location where a ' //   &
+!                                       '3D building is set requires an ID ' //  &
+!                                       '( and vice versa ). i, j = ', i, j
+!                       CALL message( 'netcdf_data_input_mod', 'PA0574',         &
+!                                      2, 2, myid, 6, 0 )
+!                    ENDIF
+!                 ENDIF
+!              ENDIF
 !
 !--          Check if building ID is set where a bulding is defined.
Index: palm/trunk/SOURCE/pmc_child_mod.f90
===================================================================
--- palm/trunk/SOURCE/pmc_child_mod.f90	(revision 3942)
+++ palm/trunk/SOURCE/pmc_child_mod.f90	(revision 3943)
@@ -21,9 +21,12 @@
 ! Current revisions:
 ! ------------------
-! typo removed
+! 
 ! 
 ! Former revisions:
 ! -----------------
 ! $Id$
+! typo removed
+! 
+! 3932 2019-04-24 17:31:34Z suehring
 ! statement added to avoid compiler warning
 ! 
Index: palm/trunk/SOURCE/pmc_general_mod.f90
===================================================================
--- palm/trunk/SOURCE/pmc_general_mod.f90	(revision 3942)
+++ palm/trunk/SOURCE/pmc_general_mod.f90	(revision 3943)
@@ -21,9 +21,12 @@
 ! Current revisions:
 ! ------------------
-! Increase character length so that also chemistry variable names fully fit
+! 
 ! 
 ! Former revisions:
 ! -----------------
 ! $Id$
+! Increase character length so that also chemistry variable names fully fit
+! 
+! 3932 2019-04-24 17:31:34Z suehring
 ! Determine number of coupled arrays dynamically.
 ! 
Index: palm/trunk/SOURCE/pmc_interface_mod.f90
===================================================================
--- palm/trunk/SOURCE/pmc_interface_mod.f90	(revision 3942)
+++ palm/trunk/SOURCE/pmc_interface_mod.f90	(revision 3943)
@@ -20,10 +20,13 @@
 ! Current revisions:
 ! ------------------
-! Add missing if statements for call of pmc_set_dataarray_name for TKE and 
-! dissipation.
+! 
 ! 
 ! Former revisions:
 ! -----------------
 ! $Id$
+! Add missing if statements for call of pmc_set_dataarray_name for TKE and 
+! dissipation.
+! 
+! 3932 2019-04-24 17:31:34Z suehring
 ! Variables renamed, commenting improved etc.
 ! 
Index: palm/trunk/SOURCE/radiation_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/radiation_model_mod.f90	(revision 3942)
+++ palm/trunk/SOURCE/radiation_model_mod.f90	(revision 3943)
@@ -28,4 +28,7 @@
 ! -----------------
 ! $Id$
+! Missing blank characteer added.
+! 
+! 3900 2019-04-16 15:17:43Z suehring
 ! Fixed initialization problem
 ! 
@@ -8331,5 +8334,5 @@
 
       WRITE ( message_string, * ) 'Precalculated', ndsidir, ' solar positions', &
-                                  'from', it, ' timesteps.'
+                                  ' from', it, ' timesteps.'
       CALL message( 'radiation_presimulate_solar_pos', 'UI0013', 0, 0, 0, 6, 0 )
 
Index: palm/trunk/SOURCE/sum_up_3d_data.f90
===================================================================
--- palm/trunk/SOURCE/sum_up_3d_data.f90	(revision 3942)
+++ palm/trunk/SOURCE/sum_up_3d_data.f90	(revision 3943)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Added output of qsws_av for green roofs.
+! 
+! 3933 2019-04-25 12:33:20Z kanani
 ! Formatting
 ! 
@@ -792,4 +795,5 @@
 !--          In case of land- and urban-surfaces, convert fluxes into
 !--          dynamic units.
+!--          Question (maronga): are the .NOT. statements really required?
              IF ( ALLOCATED( qsws_av ) ) THEN 
                 DO  i = nxl, nxr
@@ -811,4 +815,8 @@
                          qsws_av(j,i) = qsws_av(j,i) +                         &
                                          surf_lsm_h%qsws(m) * l_v
+                      ELSEIF ( match_usm  .AND.  .NOT. match_lsm )  THEN
+                         m = surf_usm_h%end_index(j,i)
+                         qsws_av(j,i) = qsws_av(j,i) +                         &
+                                         surf_usm_h%qsws(m) * l_v
                       ENDIF
                    ENDDO
Index: palm/trunk/SOURCE/surface_mod.f90
===================================================================
--- palm/trunk/SOURCE/surface_mod.f90	(revision 3942)
+++ palm/trunk/SOURCE/surface_mod.f90	(revision 3943)
@@ -26,4 +26,7 @@
 ! -----------------
 ! $Id$
+! Removed qsws_eb as it is no longer needed.
+! 
+! 3933 2019-04-25 12:33:20Z kanani
 ! Add (de)allocation of pt_2m,
 ! bugfix: initialize pt_2m
@@ -448,5 +451,4 @@
        REAL(wp), DIMENSION(:), ALLOCATABLE ::  lambda_surface_u    !< coupling between surface and soil (depends on vegetation type) (W/m2/K)
        REAL(wp), DIMENSION(:), ALLOCATABLE ::  lambda_surface_s    !< coupling between surface and soil (depends on vegetation type) (W/m2/K)
-       REAL(wp), DIMENSION(:), ALLOCATABLE ::  qsws_eb             !<
        REAL(wp), DIMENSION(:), ALLOCATABLE ::  qsws_liq            !< surface flux of latent heat (liquid water portion)
        REAL(wp), DIMENSION(:), ALLOCATABLE ::  qsws_soil           !< surface flux of latent heat (soil portion)
@@ -580,5 +582,5 @@
        REAL(wp), DIMENSION(:), ALLOCATABLE ::  iwghf_eb_window_av !< indoor average of wghf_eb window
        REAL(wp), DIMENSION(:), ALLOCATABLE ::  wshf_eb_av       !< average of wshf_eb
-       REAL(wp), DIMENSION(:), ALLOCATABLE ::  qsws_eb_av       !< average of qsws_eb
+       REAL(wp), DIMENSION(:), ALLOCATABLE ::  qsws_av           !< average of qsws
        REAL(wp), DIMENSION(:), ALLOCATABLE ::  qsws_veg_av       !< average of qsws_veg_eb
        REAL(wp), DIMENSION(:), ALLOCATABLE ::  qsws_liq_av       !< average of qsws_liq_eb
Index: palm/trunk/SOURCE/urban_surface_mod.f90
===================================================================
--- palm/trunk/SOURCE/urban_surface_mod.f90	(revision 3942)
+++ palm/trunk/SOURCE/urban_surface_mod.f90	(revision 3943)
@@ -28,4 +28,7 @@
 ! -----------------
 ! $Id$
+! Removed qsws_eb. Bugfix in calculation of qsws.
+! 
+! 3933 2019-04-25 12:33:20Z kanani
 ! Remove allocation of pt_2m, this is done in surface_mod now (surfaces%pt_2m)
 ! 
@@ -1161,5 +1164,4 @@
         ALLOCATE ( surf_usm_h%r_canopy(1:surf_usm_h%ns)         )
         ALLOCATE ( surf_usm_h%r_canopy_min(1:surf_usm_h%ns)     )
-        ALLOCATE ( surf_usm_h%qsws_eb(1:surf_usm_h%ns)          )
         ALLOCATE ( surf_usm_h%pt_10cm(1:surf_usm_h%ns)          ) 
 
@@ -1171,5 +1173,4 @@
           ALLOCATE ( surf_usm_v(l)%qsws_liq(1:surf_usm_v(l)%ns)         )
           ALLOCATE ( surf_usm_v(l)%qsws_veg(1:surf_usm_v(l)%ns)         )
-          ALLOCATE ( surf_usm_v(l)%qsws_eb(1:surf_usm_v(l)%ns)          )
           ALLOCATE ( surf_usm_v(l)%r_canopy(1:surf_usm_v(l)%ns)         )
           ALLOCATE ( surf_usm_v(l)%r_canopy_min(1:surf_usm_v(l)%ns)     )
@@ -1532,11 +1533,11 @@
 !--                 array of latent heat flux from surfaces
 !--                 land surfaces
-                    IF ( l == -1 .AND. .NOT.  ALLOCATED(surf_usm_h%qsws_eb_av) )  THEN
-                        ALLOCATE ( surf_usm_h%qsws_eb_av(1:surf_usm_h%ns) )
-                        surf_usm_h%qsws_eb_av = 0.0_wp
+                    IF ( l == -1 .AND. .NOT.  ALLOCATED(surf_usm_h%qsws_av) )  THEN
+                        ALLOCATE ( surf_usm_h%qsws_av(1:surf_usm_h%ns) )
+                        surf_usm_h%qsws_av = 0.0_wp
                     ELSE
-                       IF ( .NOT.  ALLOCATED(surf_usm_v(l)%qsws_eb_av) )  THEN
-                           ALLOCATE ( surf_usm_v(l)%qsws_eb_av(1:surf_usm_v(l)%ns) )
-                           surf_usm_v(l)%qsws_eb_av = 0.0_wp
+                       IF ( .NOT.  ALLOCATED(surf_usm_v(l)%qsws_av) )  THEN
+                           ALLOCATE ( surf_usm_v(l)%qsws_av(1:surf_usm_v(l)%ns) )
+                           surf_usm_v(l)%qsws_av = 0.0_wp
                        ENDIF
                     ENDIF
@@ -1797,13 +1798,13 @@
                     IF ( l == -1 ) THEN
                     DO  m = 1, surf_usm_h%ns
-                       surf_usm_h%qsws_eb_av(m) =                              &
-                                          surf_usm_h%qsws_eb_av(m) +           &
-                                          surf_usm_h%qsws_eb(m)
+                       surf_usm_h%qsws_av(m) =                              &
+                                          surf_usm_h%qsws_av(m) +           &
+                                          surf_usm_h%qsws(m) * l_v
                     ENDDO
                     ELSE
                        DO  m = 1, surf_usm_v(l)%ns
-                          surf_usm_v(l)%qsws_eb_av(m) =                        &
-                                          surf_usm_v(l)%qsws_eb_av(m) +        &
-                                          surf_usm_v(l)%qsws_eb(m)
+                          surf_usm_v(l)%qsws_av(m) =                        &
+                                          surf_usm_v(l)%qsws_av(m) +        &
+                                          surf_usm_v(l)%qsws(m) * l_v
                        ENDDO
                     ENDIF
@@ -2095,12 +2096,12 @@
                     IF ( l == -1 ) THEN
                     DO  m = 1, surf_usm_h%ns
-                       surf_usm_h%qsws_eb_av(m) =                              &
-                                          surf_usm_h%qsws_eb_av(m) /           &
+                       surf_usm_h%qsws_av(m) =                              &
+                                          surf_usm_h%qsws_av(m) /           &
                                           REAL( average_count_3d, kind=wp )
                     ENDDO
                     ELSE
                        DO  m = 1, surf_usm_v(l)%ns
-                          surf_usm_v(l)%qsws_eb_av(m) =                        &
-                                          surf_usm_v(l)%qsws_eb_av(m) /        &
+                          surf_usm_v(l)%qsws_av(m) =                        &
+                                          surf_usm_v(l)%qsws_av(m) /        &
                                           REAL( average_count_3d, kind=wp )
                        ENDDO
@@ -2432,5 +2433,5 @@
         CHARACTER(LEN=2)                              :: ls
         CHARACTER(LEN=varnamelength)                  :: var           !< TRIM(variable)
-        INTEGER(iwp), PARAMETER                       :: nl1 = 14      !< number of directional usm variables
+        INTEGER(iwp), PARAMETER                       :: nl1 = 15      !< number of directional usm variables
         CHARACTER(LEN=varnamelength), DIMENSION(nl1)  :: varlist1 = &  !< list of directional usm variables
                   (/'usm_wshf                      ', &
@@ -2447,4 +2448,5 @@
                     'usm_t_surf_green              ', &
                     'usm_t_green                   ', &
+                    'usm_qsws                      ', &
                     'usm_theta_10cm                '/)
 
@@ -2801,5 +2803,5 @@
                        j = surf_usm_h%j(m)
                        k = surf_usm_h%k(m)
-                       temp_pf(k,j,i) = surf_usm_h%qsws_eb(m)
+                       temp_pf(k,j,i) = surf_usm_h%qsws(m) * l_v
                     ENDDO
                  ELSE
@@ -2809,5 +2811,5 @@
                        j = surf_usm_v(l)%j(m)
                        k = surf_usm_v(l)%k(m)
-                       temp_pf(k,j,i) = surf_usm_v(l)%qsws_eb(m)
+                       temp_pf(k,j,i) = surf_usm_v(l)%qsws(m) * l_v
                     ENDDO
                  ENDIF
@@ -2818,5 +2820,5 @@
                        j = surf_usm_h%j(m)
                        k = surf_usm_h%k(m)
-                       temp_pf(k,j,i) = surf_usm_h%qsws_eb_av(m)
+                       temp_pf(k,j,i) = surf_usm_h%qsws_av(m)
                     ENDDO
                  ELSE
@@ -2826,5 +2828,5 @@
                        j = surf_usm_v(l)%j(m)
                        k = surf_usm_v(l)%k(m)
-                       temp_pf(k,j,i) = surf_usm_v(l)%qsws_eb_av(m)
+                       temp_pf(k,j,i) = surf_usm_v(l)%qsws_av(m)
                     ENDDO
                  ENDIF
@@ -8073,11 +8075,10 @@
 
            IF (surf_usm_h%frac(ind_pav_green,m) > 0.0_wp) THEN
-
+              
+           
               IF ( humidity )  THEN
-                 surf_usm_h%qsws_eb(m)  = - f_qsws * ( qv1 - q_s + dq_s_dt                  &
+                 surf_usm_h%qsws(m)  = - f_qsws * ( qv1 - q_s + dq_s_dt                     &
                                  * t_surf_green_h(m) - dq_s_dt *               &
                                    t_surf_green_h_p(m) )
-       
-                 surf_usm_h%qsws(m) = surf_usm_h%qsws_eb(m) / rho_lv
        
                  surf_usm_h%qsws_veg(m)  = - f_qsws_veg  * ( qv1 - q_s                      &
@@ -8088,4 +8089,5 @@
                                      + dq_s_dt * t_surf_green_h(m) - dq_s_dt   &
                                      * t_surf_green_h_p(m) )
+                                     
               ENDIF
  
@@ -8528,9 +8530,9 @@
 
                  IF ( humidity )  THEN
-                    surf_usm_v(l)%qsws_eb(m)  = - f_qsws * ( qv1 - q_s + dq_s_dt       &
+                    surf_usm_v(l)%qsws(m)  = - f_qsws * ( qv1 - q_s + dq_s_dt          &
                                     * t_surf_green_v(l)%t(m) - dq_s_dt *               &
                                       t_surf_green_v_p(l)%t(m) )
           
-                    surf_usm_v(l)%qsws(m) = surf_usm_v(l)%qsws_eb(m) / rho_lv
+                    surf_usm_v(l)%qsws(m) = surf_usm_v(l)%qsws(m) / l_v
           
                     surf_usm_v(l)%qsws_veg(m)  = - f_qsws_veg  * ( qv1 - q_s           &
