Index: palm/trunk/SOURCE/virtual_measurement_mod.f90
===================================================================
--- palm/trunk/SOURCE/virtual_measurement_mod.f90	(revision 4694)
+++ palm/trunk/SOURCE/virtual_measurement_mod.f90	(revision 4695)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Introduce additional namelist parameters to further customize sampling in the horizontal and
+! vertical surroundings of the original observation coordinates
+!
+! 4671 2020-09-09 20:27:58Z pavelkrc
 ! Implementation of downward facing USM and LSM surfaces
 !
@@ -369,10 +373,16 @@
     INTEGER(iwp) ::  maximum_name_length = 32  !< maximum name length of station names
     INTEGER(iwp) ::  ntimesteps                !< number of timesteps defined in NetCDF output file
-    INTEGER(iwp) ::  off_pr              = 1   !< number of neighboring grid points (in each direction) where virtual profile
+    INTEGER(iwp) ::  off_pr              = 1   !< number of neighboring grid points (in horizontal direction) where virtual profile
                                                !< measurements shall be taken, in addition to the given coordinates in the driver
-    INTEGER(iwp) ::  off_ts              = 1   !< number of neighboring grid points (in each direction) where virtual timeseries
+    INTEGER(iwp) ::  off_pr_z            = 0   !< number of additional grid points (in each upwardd and downward direction) where 
+                                               !< virtual profile measurements shall be taken, in addition to the given z coordinates in the driver
+    INTEGER(iwp) ::  off_ts              = 1   !< number of neighboring grid points (in horizontal direction) where virtual profile
                                                !< measurements shall be taken, in addition to the given coordinates in the driver
-    INTEGER(iwp) ::  off_tr              = 1   !< number of neighboring grid points (in each direction) where virtual trajectory
+    INTEGER(iwp) ::  off_ts_z            = 50  !< number of additional grid points (in each upwardd and downward direction) where 
+                                               !< virtual profile measurements shall be taken, in addition to the given z coordinates in the driver
+    INTEGER(iwp) ::  off_tr              = 1   !< number of neighboring grid points (in horizontal direction) where virtual profile
                                                !< measurements shall be taken, in addition to the given coordinates in the driver
+    INTEGER(iwp) ::  off_tr_z            = 1   !< number of additional grid points (in each upwardd and downward direction) where 
+                                               !< virtual profile measurements shall be taken, in addition to the given z coordinates in the driver
     LOGICAL ::  global_attribute          = .TRUE.   !< flag indicating a global attribute
     LOGICAL ::  initial_write_coordinates = .FALSE.  !< flag indicating a global attribute
@@ -875,5 +885,6 @@
     INTEGER(iwp) ::  nofill     !< dummy for nofill return value (not used)
     INTEGER(iwp) ::  ns         !< counter variable for number of observation points on subdomain
-    INTEGER(iwp) ::  off        !< number of surrounding grid points to be sampled
+    INTEGER(iwp) ::  off        !< number of horizontally surrounding grid points to be sampled
+    INTEGER(iwp) ::  off_z      !< number of vertically surrounding grid points to be sampled
     INTEGER(iwp) ::  t          !< running index over number of trajectories
 
@@ -1118,9 +1129,12 @@
 !--          according to the featureType.
              IF ( vmea(l)%timseries_profile )  THEN
-                off = off_pr
+                off   = off_pr
+                off_z = off_pr_z
              ELSEIF ( vmea(l)%timseries     )  THEN
-                off = off_ts
+                off   = off_ts
+                off_z = off_ts_z
              ELSEIF ( vmea(l)%trajectory    )  THEN
-                off = off_tr
+                off   = off_tr
+                off_z = off_tr_z
              ENDIF
 
@@ -1142,6 +1156,6 @@
 !--                coordinate points, but first check whether the surrounding coordinate points are
 !--                on the subdomain.
-                   kl = MERGE( ks-off, ksurf, ks-off >= nzb  .AND. ks-off >= ksurf )
-                   ku = MERGE( ks+off, nzt,   ks+off < nzt+1 )
+                   kl = MERGE( ks-off_z, ksurf, ks-off_z >= nzb  .AND. ks-off_z >= ksurf )
+                   ku = MERGE( ks+off_z, nzt,   ks+off_z < nzt+1 )
 
                    DO  i = is-off, is+off
