Index: palm/trunk/SOURCE/virtual_measurement_mod.f90
===================================================================
--- palm/trunk/SOURCE/virtual_measurement_mod.f90	(revision 4760)
+++ palm/trunk/SOURCE/virtual_measurement_mod.f90	(revision 4763)
@@ -25,4 +25,12 @@
 ! -----------------
 ! $Id$
+! - Simplified input of coordinates. All coordinate and height arrays are now 1D, independent on
+!   featuretype. This allows easier usage also for other campaign data sets independent of UC2.
+! - Avoid type conversion from 64 to 32 bit when output the data
+! - Increase dimension size of sample-variable string (sometimes more than 100 variables are listed
+!   for heavy measured locations)
+! - Remove quantities that cannot be sampled
+!
+! 4752 2020-10-21 13:54:51Z suehring
 ! Remove unnecessary output and merge output for quantities that are represented by the same
 ! variable in PALM, e.g. surface temperature and brightness temperature
@@ -191,4 +199,5 @@
         ONLY:  air_chemistry,                                                                      &
                coupling_char,                                                                      &
+               debug_output,                                                                       &
                dz,                                                                                 &
                end_time,                                                                           &
@@ -305,5 +314,5 @@
        INTEGER(iwp) ::  ns              = 0  !< number of observation coordinates on subdomain, for atmospheric measurements
        INTEGER(iwp) ::  ns_tot          = 0  !< total number of observation coordinates, for atmospheric measurements
-       INTEGER(iwp) ::  n_tr_st              !< number of trajectories / station of a measurement
+       INTEGER(iwp) ::  nst                  !< number of coordinate points given for a measurement
        INTEGER(iwp) ::  nmeas                !< number of measured variables (atmosphere + soil)
        INTEGER(iwp) ::  ns_soil         = 0  !< number of observation coordinates on subdomain, for soil measurements
@@ -677,9 +686,4 @@
           output_variable%units         = 'm2 s-2'
 
-       CASE ( 'plev' )
-          output_variable%long_name     = 'air pressure'
-          output_variable%standard_name = 'air_pressure'
-          output_variable%units         = 'Pa'
-
        CASE ( 'm_soil' )
           output_variable%long_name     = 'soil moisture volumetric'
@@ -731,14 +735,4 @@
           output_variable%units         = 'hPa'
 
-       CASE ( 'pswrtg' )
-          output_variable%long_name     = 'platform speed wrt ground'
-          output_variable%standard_name = 'platform_speed_wrt_ground'
-          output_variable%units         = 'm s-1'
-
-       CASE ( 'pswrta' )
-          output_variable%long_name     = 'platform speed wrt air'
-          output_variable%standard_name = 'platform_speed_wrt_air'
-          output_variable%units         = 'm s-1'
-
        CASE ( 'pwv' )
           output_variable%long_name     = 'water vapor partial pressure in air'
@@ -746,9 +740,4 @@
           output_variable%units         = 'hPa'
 
-       CASE ( 'ssdu' )
-          output_variable%long_name     = 'duration of sunshine'
-          output_variable%standard_name = 'duration_of_sunshine'
-          output_variable%units         = 's'
-
        CASE ( 't_lw' )
           output_variable%long_name     = 'land water temperature'
@@ -771,14 +760,4 @@
           output_variable%long_name     = 'upward kinematic latent heat flux in air'
           output_variable%units         = 'g kg-1 m s-1'
-
-       CASE ( 'zcb' )
-          output_variable%long_name     = 'cloud base altitude'
-          output_variable%standard_name = 'cloud_base_altitude'
-          output_variable%units         = 'm'
-
-       CASE ( 'zmla' )
-          output_variable%long_name     = 'atmosphere boundary layer thickness'
-          output_variable%standard_name = 'atmosphere_boundary_layer_thickness'
-          output_variable%units         = 'm'
 
        CASE ( 'mcpm1' )
@@ -880,8 +859,7 @@
 
     CHARACTER(LEN=5)                  ::  dum                           !< dummy string indicating station id
-    CHARACTER(LEN=100), DIMENSION(50) ::  measured_variables_file = ''  !< array with all measured variables read from NetCDF
-    CHARACTER(LEN=100), DIMENSION(50) ::  measured_variables      = ''  !< dummy array with all measured variables that are allowed
-
-    INTEGER(iwp) ::  dim_ntime  !< dimension size of time coordinate
+    CHARACTER(LEN=100), DIMENSION(200) ::  measured_variables_file = ''  !< array with all measured variables read from NetCDF
+    CHARACTER(LEN=100), DIMENSION(200) ::  measured_variables      = ''  !< dummy array with all measured variables that are allowed
+
     INTEGER(iwp) ::  i          !< grid index of virtual observation point in x-direction
     INTEGER(iwp) ::  is         !< grid index of real observation point of the respective station in x-direction
@@ -897,5 +875,4 @@
     INTEGER(iwp) ::  ll         !< running index over all measured variables in file
     INTEGER(iwp) ::  m          !< running index for surface elements
-    INTEGER(iwp) ::  n          !< running index over trajectory coordinates
     INTEGER(iwp) ::  nofill     !< dummy for nofill return value (not used)
     INTEGER(iwp) ::  ns         !< counter variable for number of observation points on subdomain
@@ -922,11 +899,13 @@
     REAL(wp) ::  fill_zar    !< _FillValue for zar coordinate
 
-    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  e_utm      !< easting UTM coordinate, temporary variable
-    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  e_utm_tmp  !< EUTM coordinate before rotation
-    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  height     !< observation height above ground (for trajectories)
-    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  n_utm      !< northing UTM coordinate, temporary variable
-    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  n_utm_tmp  !< NUTM coordinate before rotation
-    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  station_h  !< station height above reference
-    REAL(wp), DIMENSION(:,:), ALLOCATABLE ::  zar        !< observation height above reference
+    REAL(wp), DIMENSION(:), ALLOCATABLE ::  e_utm      !< easting UTM coordinate, temporary variable
+    REAL(wp), DIMENSION(:), ALLOCATABLE ::  e_utm_tmp  !< EUTM coordinate before rotation
+    REAL(wp), DIMENSION(:), ALLOCATABLE ::  height     !< observation height above ground (for trajectories)
+    REAL(wp), DIMENSION(:), ALLOCATABLE ::  n_utm      !< northing UTM coordinate, temporary variable
+    REAL(wp), DIMENSION(:), ALLOCATABLE ::  n_utm_tmp  !< NUTM coordinate before rotation
+    REAL(wp), DIMENSION(:), ALLOCATABLE ::  station_h  !< station height above reference
+    REAL(wp), DIMENSION(:), ALLOCATABLE ::  zar        !< observation height above reference
+
+    IF ( debug_output )  CALL debug_message( 'vm_init', 'start' )
 #if defined( __netcdf )
 !
@@ -1042,32 +1021,15 @@
        IF ( vmea(l)%nmeas > 0 )  THEN
 !
-!--       For stationary measurements UTM coordinates are just one value and its dimension is
-!--       "station", while for mobile measurements UTM coordinates are arrays depending on the
-!--       number of trajectories and time, according to (UC)2 standard. First, inquire dimension
-!--       length of the UTM coordinates.
-          IF ( vmea(l)%trajectory )  THEN
-!
-!--          For non-stationary measurements read the number of trajectories and the number of time
-!--          coordinates.
-             CALL get_dimension_length( pids_id, vmea(l)%n_tr_st, "traj" // TRIM( dum ) )
-             CALL get_dimension_length( pids_id, dim_ntime, "ntime" // TRIM( dum ) )
-!
-!--       For stationary measurements the dimension for UTM is station and for the time-coordinate
-!--       it is one.
-          ELSE
-             CALL get_dimension_length( pids_id, vmea(l)%n_tr_st, "station" // TRIM( dum ) )
-             dim_ntime = 1
-          ENDIF
-!
-!-        Allocate array which defines individual time/space frame for each trajectory or station.
-          ALLOCATE( vmea(l)%dim_t(1:vmea(l)%n_tr_st) )
+!--       For stationary and mobile measurements UTM coordinates are just one value and its dimension
+!--       is "station".
+          CALL get_dimension_length( pids_id, vmea(l)%nst, "station" // TRIM( dum ) )
 !
 !--       Allocate temporary arrays for UTM and height coordinates. Note, on file UTM coordinates
 !--       might be 1D or 2D variables
-          ALLOCATE( e_utm(1:vmea(l)%n_tr_st,1:dim_ntime)       )
-          ALLOCATE( n_utm(1:vmea(l)%n_tr_st,1:dim_ntime)       )
-          ALLOCATE( station_h(1:vmea(l)%n_tr_st,1:dim_ntime)   )
-          ALLOCATE( zar(1:vmea(l)%n_tr_st,1:dim_ntime)         )
-          IF ( vmea(l)%trajectory )  ALLOCATE( height(1:vmea(l)%n_tr_st,1:dim_ntime) )
+          ALLOCATE( e_utm(1:vmea(l)%nst)       )
+          ALLOCATE( n_utm(1:vmea(l)%nst)       )
+          ALLOCATE( station_h(1:vmea(l)%nst)   )
+          ALLOCATE( zar(1:vmea(l)%nst)         )
+          IF ( vmea(l)%trajectory )  ALLOCATE( height(1:vmea(l)%nst) )
           e_utm     = 0.0_wp
           n_utm     = 0.0_wp
@@ -1076,6 +1038,6 @@
           IF ( vmea(l)%trajectory )  height = 0.0_wp
 
-          ALLOCATE( e_utm_tmp(1:vmea(l)%n_tr_st,1:dim_ntime) )
-          ALLOCATE( n_utm_tmp(1:vmea(l)%n_tr_st,1:dim_ntime) )
+          ALLOCATE( e_utm_tmp(1:vmea(l)%nst) )
+          ALLOCATE( n_utm_tmp(1:vmea(l)%nst) )
 !
 !--       Read UTM and height coordinates for all trajectories and times. Note, in case
@@ -1094,17 +1056,12 @@
 !--       UC2-standard.
           IF ( vmea(l)%trajectory )  THEN
-             CALL get_variable( pids_id, char_eutm   // TRIM( dum ), e_utm,  0, dim_ntime-1, 0,    &
-                                vmea(l)%n_tr_st-1 )
-             CALL get_variable( pids_id, char_nutm   // TRIM( dum ), n_utm,  0, dim_ntime-1, 0,    &
-                                vmea(l)%n_tr_st-1 )
-             CALL get_variable( pids_id, char_zar    // TRIM( dum ), zar,    0, dim_ntime-1, 0,    &
-                                vmea(l)%n_tr_st-1 )
-             CALL get_variable( pids_id, char_height // TRIM( dum ), height, 0, dim_ntime-1, 0,    &
-                                vmea(l)%n_tr_st-1 )
+             CALL get_variable( pids_id, char_eutm      // TRIM( dum ), e_utm(:)     )
+             CALL get_variable( pids_id, char_nutm      // TRIM( dum ), n_utm(:)     )
+             CALL get_variable( pids_id, char_height    // TRIM( dum ), height(:)    )
           ELSE
-             CALL get_variable( pids_id, char_eutm      // TRIM( dum ), e_utm(:,1)     )
-             CALL get_variable( pids_id, char_nutm      // TRIM( dum ), n_utm(:,1)     )
-             CALL get_variable( pids_id, char_station_h // TRIM( dum ), station_h(:,1) )
-             CALL get_variable( pids_id, char_zar       // TRIM( dum ), zar(:,1)       )
+             CALL get_variable( pids_id, char_eutm      // TRIM( dum ), e_utm(:)     )
+             CALL get_variable( pids_id, char_nutm      // TRIM( dum ), n_utm(:)     )
+             CALL get_variable( pids_id, char_station_h // TRIM( dum ), station_h(:) )
+             CALL get_variable( pids_id, char_zar       // TRIM( dum ), zar(:)       )
           ENDIF
 
@@ -1116,5 +1073,5 @@
 !
 !--       Compute observation height above ground. Note, for trajectory measurements the height
-!--       above the surface is actually stored in 'height'
+!--       above the surface is actually stored in 'height'.
           IF ( vmea(l)%trajectory )  THEN
              zar      = height
@@ -1127,5 +1084,5 @@
 !--       on subdomain. This case, setup grid index space sample these quantities.
           meas_flag = 0
-          DO  t = 1, vmea(l)%n_tr_st
+          DO  t = 1, vmea(l)%nst
 !
 !--          First, compute relative x- and y-coordinates with respect to the lower-left origin of
@@ -1133,25 +1090,14 @@
 !--          is not correct, the virtual sites will be misplaced. Further, in case of an rotated
 !--          model domain, the UTM coordinates must also be rotated.
-             e_utm_tmp(t,1:dim_ntime) = e_utm(t,1:dim_ntime) - init_model%origin_x
-             n_utm_tmp(t,1:dim_ntime) = n_utm(t,1:dim_ntime) - init_model%origin_y
-             e_utm(t,1:dim_ntime) = COS( init_model%rotation_angle * pi / 180.0_wp )               &
-                                    * e_utm_tmp(t,1:dim_ntime)                                     &
+             e_utm_tmp(t) = e_utm(t) - init_model%origin_x
+             n_utm_tmp(t) = n_utm(t) - init_model%origin_y
+             e_utm(t) = COS( init_model%rotation_angle * pi / 180.0_wp )                           &
+                                    * e_utm_tmp(t)                                                 &
                                   - SIN( init_model%rotation_angle * pi / 180.0_wp )               &
-                                    * n_utm_tmp(t,1:dim_ntime)
-             n_utm(t,1:dim_ntime) = SIN( init_model%rotation_angle * pi / 180.0_wp )               &
-                                    * e_utm_tmp(t,1:dim_ntime)                                     &
+                                    * n_utm_tmp(t)
+             n_utm(t) = SIN( init_model%rotation_angle * pi / 180.0_wp )                           &
+                                    * e_utm_tmp(t)                                                 &
                                   + COS( init_model%rotation_angle * pi / 180.0_wp )               &
-                                    * n_utm_tmp(t,1:dim_ntime)
-!
-!--          Determine the individual time coordinate length for each station and trajectory. This
-!--          is required as several stations and trajectories are merged into one file but they do
-!--          not have the same number of points in time, hence, missing values may occur and cannot
-!--          be processed further. This is actually a work-around for the specific (UC)2 dataset,
-!--          but it won't harm anyway.
-             vmea(l)%dim_t(t) = 0
-             DO  n = 1, dim_ntime
-                IF ( e_utm(t,n) /= fill_eutm  .AND.  n_utm(t,n) /= fill_nutm  .AND.                &
-                     zar(t,n)   /= fill_zar )  vmea(l)%dim_t(t) = n
-             ENDDO
+                                    * n_utm_tmp(t)
 !
 !--          Compute grid indices relative to origin and check if these are on the subdomain. Note,
@@ -1170,34 +1116,32 @@
              ENDIF
 
-             DO  n = 1, vmea(l)%dim_t(t)
-                 is = INT( ( e_utm(t,n) + 0.5_wp * dx ) * ddx, KIND = iwp )
-                 js = INT( ( n_utm(t,n) + 0.5_wp * dy ) * ddy, KIND = iwp )
-!
-!--             Is the observation point on subdomain?
-                on_pe = ( is >= nxl  .AND.  is <= nxr  .AND.  js >= nys  .AND.  js <= nyn )
-!
-!--             Check if observation coordinate is on subdomain.
-                IF ( on_pe )  THEN
-!
-!--                Determine vertical index which corresponds to the observation height.
-                   ksurf = topo_top_ind(js,is,0)
-                   ks = MINLOC( ABS( zu - zw(ksurf) - zar(t,n) ), DIM = 1 ) - 1
-!
-!--                Set mask array at the observation coordinates. Also, flag the surrounding
-!--                coordinate points, but first check whether the surrounding coordinate points are
-!--                on the subdomain.
-                   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
-                      DO  j = js-off, js+off
-                         DO  k = kl, ku
-                            meas_flag(k,j,i) = MERGE( IBSET( meas_flag(k,j,i), 0 ), 0,             &
-                                                      BTEST( wall_flags_total_0(k,j,i), 0 ) )
-                         ENDDO
+             is = INT( ( e_utm(t) + 0.5_wp * dx ) * ddx, KIND = iwp )
+             js = INT( ( n_utm(t) + 0.5_wp * dy ) * ddy, KIND = iwp )
+!
+!--          Is the observation point on subdomain?
+             on_pe = ( is >= nxl  .AND.  is <= nxr  .AND.  js >= nys  .AND.  js <= nyn )
+!
+!--          Check if observation coordinate is on subdomain.
+             IF ( on_pe )  THEN
+!
+!--             Determine vertical index which corresponds to the observation height.
+                ksurf = topo_top_ind(js,is,0)
+                ks = MINLOC( ABS( zu - zw(ksurf) - zar(t) ), DIM = 1 ) - 1
+!
+!--             Set mask array at the observation coordinates. Also, flag the surrounding
+!--             coordinate points, but first check whether the surrounding coordinate points are
+!--             on the subdomain.
+                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
+                   DO  j = js-off, js+off
+                      DO  k = kl, ku
+                         meas_flag(k,j,i) = MERGE( IBSET( meas_flag(k,j,i), 0 ), 0,                &
+                                                          BTEST( wall_flags_total_0(k,j,i), 0 ) )
                       ENDDO
                    ENDDO
-                ENDIF
-             ENDDO
+                ENDDO
+             ENDIF
 
           ENDDO
@@ -1317,5 +1261,4 @@
           IF ( ALLOCATED( n_utm_tmp ) )  DEALLOCATE( n_utm_tmp )
           IF ( ALLOCATED( n_utm )     )  DEALLOCATE( n_utm )
-          IF ( ALLOCATED( zar  )      )  DEALLOCATE( vmea(l)%dim_t )
           IF ( ALLOCATED( zar  )      )  DEALLOCATE( zar  )
           IF ( ALLOCATED( height )    )  DEALLOCATE( height )
@@ -1336,6 +1279,5 @@
     ns_all = 0
 #if defined( __parallel )
-    CALL MPI_ALLREDUCE( vmea(:)%ns, ns_all(:), vmea_general%nvm,                                   &
-                        MPI_INTEGER, MPI_SUM, comm2d, ierr )
+    CALL MPI_ALLREDUCE( vmea(:)%ns, ns_all(:), vmea_general%nvm, MPI_INTEGER, MPI_SUM, comm2d, ierr )
 #else
     ns_all(:) = vmea(:)%ns
@@ -1346,6 +1288,5 @@
     ns_all = 0
 #if defined( __parallel )
-    CALL MPI_ALLREDUCE( vmea(:)%ns_soil, ns_all(:), vmea_general%nvm,                              &
-                        MPI_INTEGER, MPI_SUM, comm2d, ierr )
+    CALL MPI_ALLREDUCE( vmea(:)%ns_soil, ns_all(:), vmea_general%nvm, MPI_INTEGER, MPI_SUM, comm2d, ierr )
 #else
     ns_all(:) = vmea(:)%ns_soil
@@ -1403,5 +1344,5 @@
 
 #endif
-
+    IF ( debug_output )  CALL debug_message( 'vm_init', 'end' )
  END SUBROUTINE vm_init
 
@@ -1999,8 +1940,8 @@
     REAL(wp), DIMENSION(:), ALLOCATABLE           ::  dum_lon                   !< transformed geographical coordinate (longitude)
     REAL(wp), DIMENSION(:), ALLOCATABLE           ::  oro_rel                   !< relative altitude of model surface
-    REAL(wp), DIMENSION(:), POINTER               ::  output_values_1d_pointer  !< pointer for 1d output array
-    REAL(wp), DIMENSION(:), ALLOCATABLE, TARGET   ::  output_values_1d_target   !< target for 1d output array
-    REAL(wp), DIMENSION(:,:), POINTER             ::  output_values_2d_pointer  !< pointer for 2d output array
-    REAL(wp), DIMENSION(:,:), ALLOCATABLE, TARGET ::  output_values_2d_target   !< target for 2d output array
+    REAL(sp), DIMENSION(:), POINTER               ::  output_values_1d_pointer  !< pointer for 1d output array
+    REAL(sp), DIMENSION(:), ALLOCATABLE, TARGET   ::  output_values_1d_target   !< target for 1d output array
+    REAL(sp), DIMENSION(:,:), POINTER             ::  output_values_2d_pointer  !< pointer for 2d output array
+    REAL(sp), DIMENSION(:,:), ALLOCATABLE, TARGET ::  output_values_2d_target   !< target for 2d output array
 
     CALL cpu_log( log_point_s(26), 'VM output', 'start' )
@@ -2027,5 +1968,5 @@
 
           return_value = dom_write_var( vmea(l)%nc_filename, 'E_UTM',                              &
-                                        values_realwp_1d = output_values_1d_pointer,               &
+                                        values_real32_1d = output_values_1d_pointer,               &
                                         bounds_start = (/vmea(l)%start_coord_a/),                  &
                                         bounds_end   = (/vmea(l)%end_coord_a  /) )
@@ -2040,5 +1981,5 @@
           output_values_1d_pointer => output_values_1d_target
           return_value = dom_write_var( vmea(l)%nc_filename, 'N_UTM',                              &
-                                        values_realwp_1d = output_values_1d_pointer,               &
+                                        values_real32_1d = output_values_1d_pointer,               &
                                         bounds_start = (/vmea(l)%start_coord_a/),                  &
                                         bounds_end   = (/vmea(l)%end_coord_a  /) )
@@ -2066,5 +2007,5 @@
           output_values_1d_pointer => output_values_1d_target
           return_value = dom_write_var( vmea(l)%nc_filename, 'lat',                                &
-                                        values_realwp_1d = output_values_1d_pointer,               &
+                                        values_real32_1d = output_values_1d_pointer,               &
                                         bounds_start = (/vmea(l)%start_coord_a/),                  &
                                         bounds_end   = (/vmea(l)%end_coord_a  /) )
@@ -2073,5 +2014,5 @@
           output_values_1d_pointer => output_values_1d_target
           return_value = dom_write_var( vmea(l)%nc_filename, 'lon',                                &
-                                        values_realwp_1d = output_values_1d_pointer,               &
+                                        values_real32_1d = output_values_1d_pointer,               &
                                         bounds_start = (/vmea(l)%start_coord_a/),                  &
                                         bounds_end   = (/vmea(l)%end_coord_a  /) )
@@ -2089,5 +2030,5 @@
           output_values_1d_pointer => output_values_1d_target
           return_value = dom_write_var( vmea(l)%nc_filename, 'z',                                  &
-                                        values_realwp_1d = output_values_1d_pointer,               &
+                                        values_real32_1d = output_values_1d_pointer,               &
                                         bounds_start = (/vmea(l)%start_coord_a/),                  &
                                         bounds_end   = (/vmea(l)%end_coord_a  /) )
@@ -2098,5 +2039,5 @@
           output_values_1d_pointer => output_values_1d_target
           return_value = dom_write_var( vmea(l)%nc_filename, 'station_h',                          &
-                                        values_realwp_1d = output_values_1d_pointer,               &
+                                        values_real32_1d = output_values_1d_pointer,               &
                                         bounds_start = (/vmea(l)%start_coord_a/),                  &
                                         bounds_end   = (/vmea(l)%end_coord_a  /) )
@@ -2141,5 +2082,5 @@
              output_values_1d_pointer => output_values_1d_target
              return_value = dom_write_var( vmea(l)%nc_filename, 'E_UTM_soil',                      &
-                                           values_realwp_1d = output_values_1d_pointer,            &
+                                           values_real32_1d = output_values_1d_pointer,            &
                                            bounds_start = (/vmea(l)%start_coord_s/),               &
                                            bounds_end   = (/vmea(l)%end_coord_s  /) )
@@ -2154,5 +2095,5 @@
              output_values_1d_pointer => output_values_1d_target
              return_value = dom_write_var( vmea(l)%nc_filename, 'N_UTM_soil',                      &
-                                           values_realwp_1d = output_values_1d_pointer,            &
+                                           values_real32_1d = output_values_1d_pointer,            &
                                            bounds_start = (/vmea(l)%start_coord_s/),               &
                                            bounds_end   = (/vmea(l)%end_coord_s  /) )
@@ -2180,5 +2121,5 @@
              output_values_1d_pointer => output_values_1d_target
              return_value = dom_write_var( vmea(l)%nc_filename, 'lat_soil',                        &
-                                           values_realwp_1d = output_values_1d_pointer,            &
+                                           values_real32_1d = output_values_1d_pointer,            &
                                            bounds_start = (/vmea(l)%start_coord_s/),               &
                                            bounds_end   = (/vmea(l)%end_coord_s  /) )
@@ -2187,5 +2128,5 @@
              output_values_1d_pointer => output_values_1d_target
              return_value = dom_write_var( vmea(l)%nc_filename, 'lon_soil',                        &
-                                           values_realwp_1d = output_values_1d_pointer,            &
+                                           values_real32_1d = output_values_1d_pointer,            &
                                            bounds_start = (/vmea(l)%start_coord_s/),               &
                                            bounds_end   = (/vmea(l)%end_coord_s  /) )
@@ -2203,5 +2144,5 @@
              output_values_1d_pointer => output_values_1d_target
              return_value = dom_write_var( vmea(l)%nc_filename, 'z_soil',                          &
-                                           values_realwp_1d = output_values_1d_pointer,            &
+                                           values_real32_1d = output_values_1d_pointer,            &
                                            bounds_start = (/vmea(l)%start_coord_s/),               &
                                            bounds_end   = (/vmea(l)%end_coord_s  /) )
@@ -2212,5 +2153,5 @@
              output_values_1d_pointer => output_values_1d_target
              return_value = dom_write_var( vmea(l)%nc_filename, 'station_h_soil',                  &
-                                           values_realwp_1d = output_values_1d_pointer,            &
+                                           values_real32_1d = output_values_1d_pointer,            &
                                            bounds_start = (/vmea(l)%start_coord_s/),               &
                                            bounds_end   = (/vmea(l)%end_coord_s  /) )
@@ -2270,5 +2211,5 @@
 
              return_value = dom_write_var( vmea(l)%nc_filename, variable_name,                     &
-                                           values_realwp_2d = output_values_2d_pointer,            &
+                                           values_real32_2d = output_values_2d_pointer,            &
                                            bounds_start = (/vmea(l)%start_coord_s, t_ind/),        &
                                            bounds_end   = (/vmea(l)%end_coord_s, t_ind /) )
@@ -2278,5 +2219,5 @@
              output_values_2d_pointer => output_values_2d_target
              return_value = dom_write_var( vmea(l)%nc_filename, variable_name,                     &
-                                           values_realwp_2d = output_values_2d_pointer,            &
+                                           values_real32_2d = output_values_2d_pointer,            &
                                            bounds_start = (/vmea(l)%start_coord_s, t_ind/),        &
                                            bounds_end   = (/vmea(l)%end_coord_s, t_ind  /) )
@@ -2291,5 +2232,5 @@
 
              return_value = dom_write_var( vmea(l)%nc_filename, variable_name,                     &
-                                           values_realwp_2d = output_values_2d_pointer,            &
+                                           values_real32_2d = output_values_2d_pointer,            &
                                            bounds_start = (/vmea(l)%start_coord_a, t_ind/),        &
                                            bounds_end   = (/vmea(l)%end_coord_a, t_ind/) )
@@ -2300,5 +2241,5 @@
              output_values_2d_pointer => output_values_2d_target
              return_value = dom_write_var( vmea(l)%nc_filename, variable_name,                     &
-                                           values_realwp_2d = output_values_2d_pointer,            &
+                                           values_real32_2d = output_values_2d_pointer,            &
                                            bounds_start = (/ vmea(l)%start_coord_a, t_ind /),      &
                                            bounds_end   = (/ vmea(l)%end_coord_a, t_ind /) )
