Index: palm/trunk/SOURCE/check_parameters.f90
===================================================================
--- palm/trunk/SOURCE/check_parameters.f90	(revision 3763)
+++ palm/trunk/SOURCE/check_parameters.f90	(revision 3766)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! trim added to avoid truncation compiler warnings
+! 
+! 3761 2019-02-25 15:31:42Z raasch
 ! unused variables removed
 ! 
@@ -1260,7 +1263,7 @@
 !
 !-- set time series output units for fluxes
-    dots_unit(14:16) = heatflux_output_unit
-    dots_unit(21)    = waterflux_output_unit
-    dots_unit(19:20) = momentumflux_output_unit
+    dots_unit(14:16) = TRIM( heatflux_output_unit )
+    dots_unit(21)    = TRIM( waterflux_output_unit )
+    dots_unit(19:20) = TRIM( momentumflux_output_unit )
 
 !
Index: palm/trunk/SOURCE/data_output_2d.f90
===================================================================
--- palm/trunk/SOURCE/data_output_2d.f90	(revision 3763)
+++ palm/trunk/SOURCE/data_output_2d.f90	(revision 3766)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! unused variables removed
+! 
+! 3655 2019-01-07 16:51:22Z knoop
 ! Bugfix: use time_since_reference_point instead of simulated_time (relevant
 ! when using wall/soil spinup)
@@ -281,8 +284,7 @@
  
 
-    USE arrays_3d,                                                             &
-        ONLY:  dzw, e, heatflux_output_conversion, nc, nr, p, pt,              &
-               precipitation_amount, prr, q, qc, ql, ql_c, ql_v, qr, s, tend,  &
-               u, v, vpt, w, zu, zw, waterflux_output_conversion, hyrho, d_exner
+    USE arrays_3d,                                                                                 &
+        ONLY:  dzw, d_exner, e, heatflux_output_conversion, p, pt, q, ql, ql_c, ql_v, s, tend, u,  &
+               v, vpt, w, waterflux_output_conversion, zu, zw
 
     USE averaging
Index: palm/trunk/SOURCE/data_output_3d.f90
===================================================================
--- palm/trunk/SOURCE/data_output_3d.f90	(revision 3763)
+++ palm/trunk/SOURCE/data_output_3d.f90	(revision 3766)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! unused variables removed
+! 
+! 3655 2019-01-07 16:51:22Z knoop
 ! Bugfix: use time_since_reference_point instead of simulated_time (relevant
 ! when using wall/soil spinup)
@@ -244,6 +247,5 @@
 
     USE arrays_3d,                                                             &
-        ONLY:  d_exner, e, nc, nr, p, pt, prr, q, qc, ql, ql_c, ql_v, qr, s,   &
-               tend, u, v, vpt, w
+        ONLY:  d_exner, e, p, pt, q, ql, ql_c, ql_v, s, tend, u, v, vpt, w
 
     USE averaging
@@ -256,9 +258,7 @@
 
     USE control_parameters,                                                    &
-        ONLY:  air_chemistry, biometeorology, do3d, do3d_no, do3d_time_count,  &
-               io_blocks, io_group, land_surface, message_string,              &
-               ntdim_3d, nz_do3d,  ocean_mode, plant_canopy,                   &
-               psolver, salsa, time_since_reference_point,                     &
-               urban_surface, varnamelength
+        ONLY:  do3d, do3d_no, do3d_time_count, io_blocks, io_group,            &
+               land_surface, message_string, ntdim_3d, nz_do3d, psolver,       &
+               time_since_reference_point, urban_surface, varnamelength
 
     USE cpulog,                                                                &
Index: palm/trunk/SOURCE/init_masks.f90
===================================================================
--- palm/trunk/SOURCE/init_masks.f90	(revision 3763)
+++ palm/trunk/SOURCE/init_masks.f90	(revision 3766)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! unused variables removed
+! 
+! 3687 2019-01-22 10:42:06Z knoop
 ! unused variables removed
 ! 
@@ -166,6 +169,5 @@
 
     USE control_parameters,                                                    &
-        ONLY:  air_chemistry,                                                  &
-               constant_diffusion, cloud_droplets,                             &
+        ONLY:  constant_diffusion, cloud_droplets,                             &
                data_output_masks, data_output_masks_user,                      &
                doav, doav_n, domask, domask_no, dz, dz_stretch_level_start,    &
@@ -177,5 +179,5 @@
                mask_x_loop, mask_xyz_dimension, mask_y, mask_y_loop, mask_z,   &
                mask_z_loop, max_masks,  message_string, mid,                   &
-               passive_scalar, ocean_mode, salsa, varnamelength
+               passive_scalar, ocean_mode, varnamelength
 
     USE grid_variables,                                                        &
Index: palm/trunk/SOURCE/module_interface.f90
===================================================================
--- palm/trunk/SOURCE/module_interface.f90	(revision 3763)
+++ palm/trunk/SOURCE/module_interface.f90	(revision 3766)
@@ -25,4 +25,9 @@
 ! -----------------
 ! $Id$
+! first argument removed from module_interface_rrd_*, statement added to avoid
+! compiler warning about unused variable, file reformatted with respect to coding
+! standards
+! 
+! 3762 2019-02-25 16:54:16Z suehring
 ! only pass required arguments to surface_data_output_rrd_local
 ! 
@@ -76,65 +81,65 @@
 !> @todo Re-format module to be consistent with coding standard
 !------------------------------------------------------------------------------!
-MODULE module_interface
-
-   USE indices,                                                                &
-       ONLY:  nbgp, nxl, nxlg, nxr, nxrg, nys, nysg, nyn, nyng, nzb, nzt
-
-   USE kinds
-
-!- load module-specific control parameters.
-!- ToDo: move all of them to respective module or a dedicated central module
-
-   USE control_parameters,                                                     &
-       ONLY:  biometeorology,                                                  &
-              air_chemistry,                                                   &
-              indoor_model,                                                    &
-              land_surface,                                                    &
-              large_scale_forcing,                                             &
-              nesting_offline,                                                 &
-              nudging,                                                         &
-              ocean_mode,                                                      &
-              plant_canopy,                                                    &
-              salsa,                                                           &
-              surface_output,                                                  &
-              syn_turb_gen,                                                    &
-              urban_surface,                                                   &
-              virtual_flight,                                                  &
-              virtual_measurement,                                             &
-              wind_turbine
-
-!- load interface routines of all PALM modules
-
-   USE biometeorology_mod,                                                     &
-       ONLY:  bio_parin,                                                       &
-              bio_check_data_output,                                           &
-              bio_init,                                                        &
-              bio_init_checks,                                                 &
-              bio_header,                                                      &
-              bio_3d_data_averaging,                                           &
-              bio_data_output_2d,                                              &
-              bio_data_output_3d,                                              &
-              bio_rrd_global,                                                  &
-              bio_rrd_local,                                                   &
-              bio_wrd_global,                                                  &
-              bio_wrd_local
-
-   USE bulk_cloud_model_mod,                                                   &
-       ONLY:  bulk_cloud_model,                                                &
-              bcm_parin,                                                       &
-              bcm_check_parameters,                                            &
-              bcm_check_data_output_pr,                                        &
-              bcm_check_data_output,                                           &
-              bcm_init_arrays,                                                 &
-              bcm_init,                                                        &
-              bcm_header,                                                      &
-              bcm_swap_timelevel,                                              &
-              bcm_3d_data_averaging,                                           &
-              bcm_data_output_2d,                                              &
-              bcm_data_output_3d,                                              &
-              bcm_rrd_global,                                                  &
-              bcm_wrd_global,                                                  &
-              bcm_rrd_local,                                                   &
-              bcm_wrd_local
+ MODULE module_interface
+
+    USE indices,                                                               &
+        ONLY:  nbgp, nxl, nxlg, nxr, nxrg, nys, nysg, nyn, nyng, nzb, nzt
+
+    USE kinds
+
+!
+!-- load module-specific control parameters.
+!-- ToDo: move all of them to respective module or a dedicated central module
+    USE control_parameters,                                                    &
+        ONLY:  biometeorology,                                                 &
+               air_chemistry,                                                  &
+               indoor_model,                                                   &
+               land_surface,                                                   &
+               large_scale_forcing,                                            &
+               nesting_offline,                                                &
+               nudging,                                                        &
+               ocean_mode,                                                     &
+               plant_canopy,                                                   &
+               salsa,                                                          &
+               surface_output,                                                 &
+               syn_turb_gen,                                                   &
+               urban_surface,                                                  &
+               virtual_flight,                                                 &
+               virtual_measurement,                                            &
+               wind_turbine
+
+!
+!-- load interface routines of all PALM modules
+    USE biometeorology_mod,                                                    &
+        ONLY:  bio_parin,                                                      &
+               bio_check_data_output,                                          &
+               bio_init,                                                       &
+               bio_init_checks,                                                &
+               bio_header,                                                     &
+               bio_3d_data_averaging,                                          &
+               bio_data_output_2d,                                             &
+               bio_data_output_3d,                                             &
+               bio_rrd_global,                                                 &
+               bio_rrd_local,                                                  &
+               bio_wrd_global,                                                 &
+               bio_wrd_local
+
+    USE bulk_cloud_model_mod,                                                  &
+        ONLY:  bulk_cloud_model,                                               &
+               bcm_parin,                                                      &
+               bcm_check_parameters,                                           &
+               bcm_check_data_output_pr,                                       &
+               bcm_check_data_output,                                          &
+               bcm_init_arrays,                                                &
+               bcm_init,                                                       &
+               bcm_header,                                                     &
+               bcm_swap_timelevel,                                             &
+               bcm_3d_data_averaging,                                          &
+               bcm_data_output_2d,                                             &
+               bcm_data_output_3d,                                             &
+               bcm_rrd_global,                                                 &
+               bcm_wrd_global,                                                 &
+               bcm_rrd_local,                                                  &
+               bcm_wrd_local
 
    USE chemistry_model_mod,                                                    &
@@ -152,313 +157,313 @@
               chem_statistics,                                                 &
               chem_rrd_local,                                                  &
-              chem_wrd_local
-
-   USE flight_mod,                                                             &
-       ONLY:  flight_parin,                                                    &
-              flight_header,                                                   &
-              flight_init,                                                     &
-              flight_rrd_global,                                               &
-              flight_wrd_global
-
-   USE gust_mod,                                                               &
-       ONLY:  gust_module_enabled,                                             &
-              gust_parin,                                                      &
-              gust_check_parameters,                                           &
-              gust_check_data_output_pr,                                       &
-              gust_check_data_output,                                          &
-              gust_init_arrays,                                                &
-              gust_init,                                                       &
-              gust_header,                                                     &
-              gust_actions,                                                    &
-              gust_swap_timelevel,                                             &
-              gust_3d_data_averaging,                                          &
-              gust_data_output_2d,                                             &
-              gust_data_output_3d,                                             &
-              gust_statistics,                                                 &
-              gust_rrd_global,                                                 &
-              gust_wrd_global,                                                 &
-              gust_rrd_local,                                                  &
-              gust_wrd_local
-
-   USE indoor_model_mod,                                                       &
-       ONLY:  im_parin,                                                        &
-              im_check_data_output,                                            &
-              im_check_parameters,                                             &
-              im_data_output_3d,                                               &
-              im_init
-
-   USE land_surface_model_mod,                                                 &
-       ONLY:  lsm_parin,                                                       &
-              lsm_check_parameters,                                            &
-              lsm_check_data_output_pr,                                        &
-              lsm_check_data_output,                                           &
-              lsm_init_arrays,                                                 &
-              lsm_init,                                                        &
-              lsm_header,                                                      &
-              lsm_swap_timelevel,                                              &
-              lsm_3d_data_averaging,                                           &
-              lsm_data_output_2d,                                              &
-              lsm_rrd_local,                                                   &
-              lsm_wrd_local
-
-   USE lsf_nudging_mod,                                                        &
-       ONLY:  lsf_nudging_check_parameters,                                    &
-              lsf_nudging_check_data_output_pr,                                &
-              lsf_init,                                                        &
-              nudge_init,                                                      &
-              lsf_nudging_header
-
-   USE multi_agent_system_mod,                                                 &
-       ONLY:  mas_parin
-
-   USE nesting_offl_mod,                                                       &
-       ONLY:  nesting_offl_parin,                                              &
-              nesting_offl_check_parameters,                                   &
-              nesting_offl_header
-
-   USE ocean_mod,                                                              &
-       ONLY:  ocean_parin,                                                     &
-              ocean_check_parameters,                                          &
-              ocean_check_data_output_pr,                                      &
-              ocean_check_data_output,                                         &
-              ocean_init_arrays,                                               &
-              ocean_init,                                                      &
-              ocean_header,                                                    &
-              ocean_swap_timelevel,                                            &
-              ocean_3d_data_averaging,                                         &
-              ocean_data_output_2d,                                            &
-              ocean_data_output_3d,                                            &
-              ocean_rrd_global,                                                &
-              ocean_wrd_global,                                                &
-              ocean_rrd_local,                                                 &
-              ocean_wrd_local
-
-   USE plant_canopy_model_mod,                                                 &
-        ONLY: pcm_parin,                                                       &
-              pcm_check_parameters,                                            &
-              pcm_check_data_output,                                           &
-              pcm_init,                                                        &
-              pcm_header,                                                      &
-              pcm_data_output_3d
-
-   USE radiation_model_mod,                                                    &
-       ONLY:  radiation,                                                       &
-              radiation_parin,                                                 &
-              radiation_check_parameters,                                      &
-              radiation_check_data_output_ts,                                  &
-              radiation_check_data_output_pr,                                  &
-              radiation_check_data_output,                                     &
-              radiation_init,                                                  &
-              radiation_header,                                                &
-              radiation_3d_data_averaging,                                     &
-              radiation_data_output_2d,                                        &
-              radiation_data_output_3d,                                        &
-              radiation_rrd_local,                                             &
-              radiation_wrd_local
-
-   USE salsa_mod,                                                              &
-       ONLY:  salsa_parin,                                                     &
-              salsa_check_parameters,                                          &
-              salsa_check_data_output,                                         &
-              salsa_init_arrays,                                               &
-              salsa_init,                                                      &
-              salsa_header,                                                    &
-              salsa_swap_timelevel,                                            &
-              salsa_3d_data_averaging,                                         &
-              salsa_data_output_2d,                                            &
-              salsa_data_output_3d,                                            &
-              salsa_rrd_local,                                                 &
-              salsa_wrd_local
-
-   USE spectra_mod,                                                            &
-       ONLY:  calculate_spectra,                                               &
-              spectra_parin,                                                   &
-              spectra_check_parameters,                                        &
-              spectra_header
-
-   USE surface_data_output_mod,                                                &
-       ONLY:  surface_data_output_parin,                                       &
-              surface_data_output_check_parameters,                            &
-              surface_data_output_init_arrays,                                 &
-              surface_data_output_rrd_local,                                   &
-              surface_data_output_rrd_global,                                  &
-              surface_data_output_wrd_local,                                   &
-              surface_data_output_wrd_global
-
-   USE synthetic_turbulence_generator_mod,                                     &
-       ONLY:  stg_parin,                                                       &
-              stg_check_parameters,                                            &
-              stg_header,                                                      &
-              stg_rrd_global,                                                  &
-              stg_wrd_global
-
-   USE urban_surface_mod,                                                      &
-       ONLY:  usm_parin,                                                       &
-              usm_check_parameters,                                            &
-              usm_check_data_output,                                           &
-              usm_init_arrays,                                                 &
-              usm_init,                                                        &
-              usm_swap_timelevel,                                              &
-              usm_3d_data_averaging,                                           &
-              usm_rrd_local,                                                   &
-              usm_wrd_local
-
-   USE user,                                                                   &
-       ONLY:  user_module_enabled,                                             &
-              user_parin,                                                      &
-              user_check_parameters,                                           &
-              user_check_data_output_ts,                                       &
-              user_check_data_output_pr,                                       &
-              user_check_data_output,                                          &
-              user_init,                                                       &
-              user_init_arrays,                                                &
-              user_header,                                                     &
-              user_actions,                                                    &
-              user_3d_data_averaging,                                          &
-              user_data_output_2d,                                             &
-              user_data_output_3d,                                             &
-              user_statistics,                                                 &
-              user_rrd_global,                                                 &
-              user_rrd_local,                                                  &
-              user_wrd_global,                                                 &
-              user_wrd_local,                                                  &
-              user_last_actions
-
-   USE virtual_measurement_mod,                                                &
-       ONLY:  vm_check_parameters,                                             &
-              vm_init,                                                         &
-              vm_last_actions,                                                 &
-              vm_parin
-
-   USE wind_turbine_model_mod,                                                 &
-       ONLY:  wtm_parin,                                                       &
-              wtm_check_parameters,                                            &
-              wtm_init_arrays,                                                 &
-              wtm_init,                                                        &
-              wtm_rrd_global,                                                  &
-              wtm_wrd_global
-
-   IMPLICIT NONE
-
-   PRIVATE
-
-!
-!- Public functions
-   PUBLIC                                                                      &
-      module_interface_parin,                                                  &
-      module_interface_check_parameters,                                       &
-      module_interface_check_data_output_ts,                                   &
-      module_interface_check_data_output_pr,                                   &
-      module_interface_check_data_output,                                      &
-      module_interface_init_masks,                                             &
-      module_interface_define_netcdf_grid,                                     &
-      module_interface_init_arrays,                                            &
-      module_interface_init,                                                   &
-      module_interface_init_checks,                                            &
-      module_interface_header,                                                 &
-      module_interface_actions,                                                &
-      module_interface_swap_timelevel,                                         &
-      module_interface_3d_data_averaging,                                      &
-      module_interface_data_output_2d,                                         &
-      module_interface_data_output_3d,                                         &
-      module_interface_statistics,                                             &
-      module_interface_rrd_global,                                             &
-      module_interface_wrd_global,                                             &
-      module_interface_rrd_local,                                              &
-      module_interface_wrd_local,                                              &
-      module_interface_last_actions
-
-
-   INTERFACE module_interface_parin
-      MODULE PROCEDURE module_interface_parin
-   END INTERFACE module_interface_parin
-
-   INTERFACE module_interface_check_parameters
-      MODULE PROCEDURE module_interface_check_parameters
-   END INTERFACE module_interface_check_parameters
-
-   INTERFACE module_interface_check_data_output_ts
-      MODULE PROCEDURE module_interface_check_data_output_ts
-   END INTERFACE module_interface_check_data_output_ts
-
-   INTERFACE module_interface_check_data_output_pr
-      MODULE PROCEDURE module_interface_check_data_output_pr
-   END INTERFACE module_interface_check_data_output_pr
-
-   INTERFACE module_interface_check_data_output
-      MODULE PROCEDURE module_interface_check_data_output
-   END INTERFACE module_interface_check_data_output
-
-   INTERFACE module_interface_init_masks
-      MODULE PROCEDURE module_interface_init_masks
-   END INTERFACE module_interface_init_masks
-
-   INTERFACE module_interface_define_netcdf_grid
-      MODULE PROCEDURE module_interface_define_netcdf_grid
-   END INTERFACE module_interface_define_netcdf_grid
-
-   INTERFACE module_interface_init_arrays
-      MODULE PROCEDURE module_interface_init_arrays
-   END INTERFACE module_interface_init_arrays
-
-   INTERFACE module_interface_init
-      MODULE PROCEDURE module_interface_init
-   END INTERFACE module_interface_init
-
-   INTERFACE module_interface_init_checks
-      MODULE PROCEDURE module_interface_init_checks
-   END INTERFACE module_interface_init_checks
-
-   INTERFACE module_interface_header
-      MODULE PROCEDURE module_interface_header
-   END INTERFACE module_interface_header
-
-   INTERFACE module_interface_actions
-      MODULE PROCEDURE module_interface_actions
-      MODULE PROCEDURE module_interface_actions_ij
-   END INTERFACE module_interface_actions
-
-   INTERFACE module_interface_swap_timelevel
-      MODULE PROCEDURE module_interface_swap_timelevel
-   END INTERFACE module_interface_swap_timelevel
-
-   INTERFACE module_interface_3d_data_averaging
-      MODULE PROCEDURE module_interface_3d_data_averaging
-   END INTERFACE module_interface_3d_data_averaging
-
-   INTERFACE module_interface_data_output_2d
-      MODULE PROCEDURE module_interface_data_output_2d
-   END INTERFACE module_interface_data_output_2d
-
-   INTERFACE module_interface_data_output_3d
-      MODULE PROCEDURE module_interface_data_output_3d
-   END INTERFACE module_interface_data_output_3d
-
-   INTERFACE module_interface_statistics
-      MODULE PROCEDURE module_interface_statistics
-   END INTERFACE module_interface_statistics
-
-   INTERFACE module_interface_rrd_global
-      MODULE PROCEDURE module_interface_rrd_global
-   END INTERFACE module_interface_rrd_global
-
-   INTERFACE module_interface_wrd_global
-      MODULE PROCEDURE module_interface_wrd_global
-   END INTERFACE module_interface_wrd_global
-
-   INTERFACE module_interface_rrd_local
-      MODULE PROCEDURE module_interface_rrd_local
-   END INTERFACE module_interface_rrd_local
-
-   INTERFACE module_interface_wrd_local
-      MODULE PROCEDURE module_interface_wrd_local
-   END INTERFACE module_interface_wrd_local
-
-   INTERFACE module_interface_last_actions
-      MODULE PROCEDURE module_interface_last_actions
-   END INTERFACE module_interface_last_actions
-
-
-CONTAINS
+               chem_wrd_local
+
+    USE flight_mod,                                                            &
+        ONLY:  flight_parin,                                                   &
+               flight_header,                                                  &
+               flight_init,                                                    &
+               flight_rrd_global,                                              &
+               flight_wrd_global
+
+    USE gust_mod,                                                              &
+        ONLY:  gust_module_enabled,                                            &
+               gust_parin,                                                     &
+               gust_check_parameters,                                          &
+               gust_check_data_output_pr,                                      &
+               gust_check_data_output,                                         &
+               gust_init_arrays,                                               &
+               gust_init,                                                      &
+               gust_header,                                                    &
+               gust_actions,                                                   &
+               gust_swap_timelevel,                                            &
+               gust_3d_data_averaging,                                         &
+               gust_data_output_2d,                                            &
+               gust_data_output_3d,                                            &
+               gust_statistics,                                                &
+               gust_rrd_global,                                                &
+               gust_wrd_global,                                                &
+               gust_rrd_local,                                                 &
+               gust_wrd_local
+
+    USE indoor_model_mod,                                                      &
+        ONLY:  im_parin,                                                       &
+               im_check_data_output,                                           &
+               im_check_parameters,                                            &
+               im_data_output_3d,                                              &
+               im_init
+
+    USE land_surface_model_mod,                                                &
+        ONLY:  lsm_parin,                                                      &
+               lsm_check_parameters,                                           &
+               lsm_check_data_output_pr,                                       &
+               lsm_check_data_output,                                          &
+               lsm_init_arrays,                                                &
+               lsm_init,                                                       &
+               lsm_header,                                                     &
+               lsm_swap_timelevel,                                             &
+               lsm_3d_data_averaging,                                          &
+               lsm_data_output_2d,                                             &
+               lsm_rrd_local,                                                  &
+               lsm_wrd_local
+
+    USE lsf_nudging_mod,                                                       &
+        ONLY:  lsf_nudging_check_parameters,                                   &
+               lsf_nudging_check_data_output_pr,                               &
+               lsf_init,                                                       &
+               nudge_init,                                                     &
+               lsf_nudging_header
+
+    USE multi_agent_system_mod,                                                &
+        ONLY:  mas_parin
+
+    USE nesting_offl_mod,                                                      &
+        ONLY:  nesting_offl_parin,                                             &
+               nesting_offl_check_parameters,                                  &
+               nesting_offl_header
+
+    USE ocean_mod,                                                             &
+        ONLY:  ocean_parin,                                                    &
+               ocean_check_parameters,                                         &
+               ocean_check_data_output_pr,                                     &
+               ocean_check_data_output,                                        &
+               ocean_init_arrays,                                              &
+               ocean_init,                                                     &
+               ocean_header,                                                   &
+               ocean_swap_timelevel,                                           &
+               ocean_3d_data_averaging,                                        &
+               ocean_data_output_2d,                                           &
+               ocean_data_output_3d,                                           &
+               ocean_rrd_global,                                               &
+               ocean_wrd_global,                                               &
+               ocean_rrd_local,                                                &
+               ocean_wrd_local
+
+    USE plant_canopy_model_mod,                                                &
+         ONLY: pcm_parin,                                                      &
+               pcm_check_parameters,                                           &
+               pcm_check_data_output,                                          &
+               pcm_init,                                                       &
+               pcm_header,                                                     &
+               pcm_data_output_3d
+
+    USE radiation_model_mod,                                                   &
+        ONLY:  radiation,                                                      &
+               radiation_parin,                                                &
+               radiation_check_parameters,                                     &
+               radiation_check_data_output_ts,                                 &
+               radiation_check_data_output_pr,                                 &
+               radiation_check_data_output,                                    &
+               radiation_init,                                                 &
+               radiation_header,                                               &
+               radiation_3d_data_averaging,                                    &
+               radiation_data_output_2d,                                       &
+               radiation_data_output_3d,                                       &
+               radiation_rrd_local,                                            &
+               radiation_wrd_local
+
+    USE salsa_mod,                                                             &
+        ONLY:  salsa_parin,                                                    &
+               salsa_check_parameters,                                         &
+               salsa_check_data_output,                                        &
+               salsa_init_arrays,                                              &
+               salsa_init,                                                     &
+               salsa_header,                                                   &
+               salsa_swap_timelevel,                                           &
+               salsa_3d_data_averaging,                                        &
+               salsa_data_output_2d,                                           &
+               salsa_data_output_3d,                                           &
+               salsa_rrd_local,                                                &
+               salsa_wrd_local
+
+    USE spectra_mod,                                                           &
+        ONLY:  calculate_spectra,                                              &
+               spectra_parin,                                                  &
+               spectra_check_parameters,                                       &
+               spectra_header
+
+    USE surface_data_output_mod,                                               &
+        ONLY:  surface_data_output_parin,                                      &
+               surface_data_output_check_parameters,                           &
+               surface_data_output_init_arrays,                                &
+               surface_data_output_rrd_local,                                  &
+               surface_data_output_rrd_global,                                 &
+               surface_data_output_wrd_local,                                  &
+               surface_data_output_wrd_global
+
+    USE synthetic_turbulence_generator_mod,                                    &
+        ONLY:  stg_parin,                                                      &
+               stg_check_parameters,                                           &
+               stg_header,                                                     &
+               stg_rrd_global,                                                 &
+               stg_wrd_global
+
+    USE urban_surface_mod,                                                     &
+        ONLY:  usm_parin,                                                      &
+               usm_check_parameters,                                           &
+               usm_check_data_output,                                          &
+               usm_init_arrays,                                                &
+               usm_init,                                                       &
+               usm_swap_timelevel,                                             &
+               usm_3d_data_averaging,                                          &
+               usm_rrd_local,                                                  &
+               usm_wrd_local
+
+    USE user,                                                                  &
+        ONLY:  user_module_enabled,                                            &
+               user_parin,                                                     &
+               user_check_parameters,                                          &
+               user_check_data_output_ts,                                      &
+               user_check_data_output_pr,                                      &
+               user_check_data_output,                                         &
+               user_init,                                                      &
+               user_init_arrays,                                               &
+               user_header,                                                    &
+               user_actions,                                                   &
+               user_3d_data_averaging,                                         &
+               user_data_output_2d,                                            &
+               user_data_output_3d,                                            &
+               user_statistics,                                                &
+               user_rrd_global,                                                &
+               user_rrd_local,                                                 &
+               user_wrd_global,                                                &
+               user_wrd_local,                                                 &
+               user_last_actions
+
+    USE virtual_measurement_mod,                                               &
+        ONLY:  vm_check_parameters,                                            &
+               vm_init,                                                        &
+               vm_last_actions,                                                &
+               vm_parin
+
+    USE wind_turbine_model_mod,                                                &
+        ONLY:  wtm_parin,                                                      &
+               wtm_check_parameters,                                           &
+               wtm_init_arrays,                                                &
+               wtm_init,                                                       &
+               wtm_rrd_global,                                                 &
+               wtm_wrd_global
+
+    IMPLICIT NONE
+
+    PRIVATE
+
+!
+!-- Public functions
+    PUBLIC                                                                     &
+       module_interface_parin,                                                 &
+       module_interface_check_parameters,                                      &
+       module_interface_check_data_output_ts,                                  &
+       module_interface_check_data_output_pr,                                  &
+       module_interface_check_data_output,                                     &
+       module_interface_init_masks,                                            &
+       module_interface_define_netcdf_grid,                                    &
+       module_interface_init_arrays,                                           &
+       module_interface_init,                                                  &
+       module_interface_init_checks,                                           &
+       module_interface_header,                                                &
+       module_interface_actions,                                               &
+       module_interface_swap_timelevel,                                        &
+       module_interface_3d_data_averaging,                                     &
+       module_interface_data_output_2d,                                        &
+       module_interface_data_output_3d,                                        &
+       module_interface_statistics,                                            &
+       module_interface_rrd_global,                                            &
+       module_interface_wrd_global,                                            &
+       module_interface_rrd_local,                                             &
+       module_interface_wrd_local,                                             &
+       module_interface_last_actions
+
+
+    INTERFACE module_interface_parin
+       MODULE PROCEDURE module_interface_parin
+    END INTERFACE module_interface_parin
+
+    INTERFACE module_interface_check_parameters
+       MODULE PROCEDURE module_interface_check_parameters
+    END INTERFACE module_interface_check_parameters
+
+    INTERFACE module_interface_check_data_output_ts
+       MODULE PROCEDURE module_interface_check_data_output_ts
+    END INTERFACE module_interface_check_data_output_ts
+
+    INTERFACE module_interface_check_data_output_pr
+       MODULE PROCEDURE module_interface_check_data_output_pr
+    END INTERFACE module_interface_check_data_output_pr
+
+    INTERFACE module_interface_check_data_output
+       MODULE PROCEDURE module_interface_check_data_output
+    END INTERFACE module_interface_check_data_output
+
+    INTERFACE module_interface_init_masks
+       MODULE PROCEDURE module_interface_init_masks
+    END INTERFACE module_interface_init_masks
+
+    INTERFACE module_interface_define_netcdf_grid
+       MODULE PROCEDURE module_interface_define_netcdf_grid
+    END INTERFACE module_interface_define_netcdf_grid
+
+    INTERFACE module_interface_init_arrays
+       MODULE PROCEDURE module_interface_init_arrays
+    END INTERFACE module_interface_init_arrays
+
+    INTERFACE module_interface_init
+       MODULE PROCEDURE module_interface_init
+    END INTERFACE module_interface_init
+
+    INTERFACE module_interface_init_checks
+       MODULE PROCEDURE module_interface_init_checks
+    END INTERFACE module_interface_init_checks
+
+    INTERFACE module_interface_header
+       MODULE PROCEDURE module_interface_header
+    END INTERFACE module_interface_header
+
+    INTERFACE module_interface_actions
+       MODULE PROCEDURE module_interface_actions
+       MODULE PROCEDURE module_interface_actions_ij
+    END INTERFACE module_interface_actions
+
+    INTERFACE module_interface_swap_timelevel
+       MODULE PROCEDURE module_interface_swap_timelevel
+    END INTERFACE module_interface_swap_timelevel
+
+    INTERFACE module_interface_3d_data_averaging
+       MODULE PROCEDURE module_interface_3d_data_averaging
+    END INTERFACE module_interface_3d_data_averaging
+
+    INTERFACE module_interface_data_output_2d
+       MODULE PROCEDURE module_interface_data_output_2d
+    END INTERFACE module_interface_data_output_2d
+
+    INTERFACE module_interface_data_output_3d
+       MODULE PROCEDURE module_interface_data_output_3d
+    END INTERFACE module_interface_data_output_3d
+
+    INTERFACE module_interface_statistics
+       MODULE PROCEDURE module_interface_statistics
+    END INTERFACE module_interface_statistics
+
+    INTERFACE module_interface_rrd_global
+       MODULE PROCEDURE module_interface_rrd_global
+    END INTERFACE module_interface_rrd_global
+
+    INTERFACE module_interface_wrd_global
+       MODULE PROCEDURE module_interface_wrd_global
+    END INTERFACE module_interface_wrd_global
+
+    INTERFACE module_interface_rrd_local
+       MODULE PROCEDURE module_interface_rrd_local
+    END INTERFACE module_interface_rrd_local
+
+    INTERFACE module_interface_wrd_local
+       MODULE PROCEDURE module_interface_wrd_local
+    END INTERFACE module_interface_wrd_local
+
+    INTERFACE module_interface_last_actions
+       MODULE PROCEDURE module_interface_last_actions
+    END INTERFACE module_interface_last_actions
+
+
+ CONTAINS
 
 
@@ -468,33 +473,33 @@
 !> Read module-specific parameter namelists
 !------------------------------------------------------------------------------!
-SUBROUTINE module_interface_parin
-
-
-   CALL bio_parin
-   CALL bcm_parin
-   CALL chem_parin
-   CALL flight_parin ! ToDo: rename module to match filename
-   CALL gust_parin
-   CALL im_parin
-   CALL lsm_parin
-   ! ToDo: create parin routine for large_scale_forcing and nudging (should be seperate modules or new module switch)
-   CALL mas_parin
-   CALL nesting_offl_parin
-   CALL ocean_parin
-   CALL pcm_parin
-   CALL radiation_parin
-   CALL salsa_parin
-   CALL spectra_parin
-   CALL surface_data_output_parin
-   CALL stg_parin
-   CALL user_parin ! ToDo: make user code a single Fortran module
-   CALL usm_parin
-   CALL vm_parin
-   CALL wtm_parin
-
-   CALL package_parin ! ToDo: deprecated, needs to be dissolved
-
-
-END SUBROUTINE module_interface_parin
+ SUBROUTINE module_interface_parin
+
+
+    CALL bio_parin
+    CALL bcm_parin
+    CALL chem_parin
+    CALL flight_parin ! ToDo: rename module to match filename
+    CALL gust_parin
+    CALL im_parin
+    CALL lsm_parin
+    ! ToDo: create parin routine for large_scale_forcing and nudging (should be seperate modules or new module switch)
+    CALL mas_parin
+    CALL nesting_offl_parin
+    CALL ocean_parin
+    CALL pcm_parin
+    CALL radiation_parin
+    CALL salsa_parin
+    CALL spectra_parin
+    CALL surface_data_output_parin
+    CALL stg_parin
+    CALL user_parin ! ToDo: make user code a single Fortran module
+    CALL usm_parin
+    CALL vm_parin
+    CALL wtm_parin
+
+    CALL package_parin ! ToDo: deprecated, needs to be dissolved
+
+
+ END SUBROUTINE module_interface_parin
 
 
@@ -504,28 +509,28 @@
 !> Perform module-specific initialization checks
 !------------------------------------------------------------------------------!
-SUBROUTINE module_interface_check_parameters
-
-
-   IF ( bulk_cloud_model )     CALL bcm_check_parameters
-   IF ( air_chemistry )        CALL chem_check_parameters
-   IF ( gust_module_enabled )  CALL gust_check_parameters
-   IF ( indoor_model )         CALL im_check_parameters
-   IF ( land_surface )         CALL lsm_check_parameters
-   IF ( large_scale_forcing  .OR.  nudging )  CALL lsf_nudging_check_parameters ! ToDo: create single module switch
-   IF ( nesting_offline )      CALL nesting_offl_check_parameters
-   IF ( ocean_mode )           CALL ocean_check_parameters
-   IF ( plant_canopy )         CALL pcm_check_parameters
-   IF ( radiation )            CALL radiation_check_parameters
-   IF ( salsa )                CALL salsa_check_parameters
-   IF ( calculate_spectra )    CALL spectra_check_parameters
-   IF ( surface_output )       CALL surface_data_output_check_parameters
-   IF ( syn_turb_gen )         CALL stg_check_parameters
-   IF ( urban_surface )        CALL usm_check_parameters
-   IF ( virtual_measurement )  CALL vm_check_parameters
-   IF ( wind_turbine )         CALL wtm_check_parameters
-   IF ( user_module_enabled )  CALL user_check_parameters
-
-
-END SUBROUTINE module_interface_check_parameters
+ SUBROUTINE module_interface_check_parameters
+
+
+    IF ( bulk_cloud_model )     CALL bcm_check_parameters
+    IF ( air_chemistry )        CALL chem_check_parameters
+    IF ( gust_module_enabled )  CALL gust_check_parameters
+    IF ( indoor_model )         CALL im_check_parameters
+    IF ( land_surface )         CALL lsm_check_parameters
+    IF ( large_scale_forcing  .OR.  nudging )  CALL lsf_nudging_check_parameters ! ToDo: create single module switch
+    IF ( nesting_offline )      CALL nesting_offl_check_parameters
+    IF ( ocean_mode )           CALL ocean_check_parameters
+    IF ( plant_canopy )         CALL pcm_check_parameters
+    IF ( radiation )            CALL radiation_check_parameters
+    IF ( salsa )                CALL salsa_check_parameters
+    IF ( calculate_spectra )    CALL spectra_check_parameters
+    IF ( surface_output )       CALL surface_data_output_check_parameters
+    IF ( syn_turb_gen )         CALL stg_check_parameters
+    IF ( urban_surface )        CALL usm_check_parameters
+    IF ( virtual_measurement )  CALL vm_check_parameters
+    IF ( wind_turbine )         CALL wtm_check_parameters
+    IF ( user_module_enabled )  CALL user_check_parameters
+
+
+ END SUBROUTINE module_interface_check_parameters
 
 
@@ -535,23 +540,23 @@
 !> Check module-specific data output of timeseries
 !------------------------------------------------------------------------------!
-SUBROUTINE module_interface_check_data_output_ts( dots_max, dots_num, dots_label, dots_unit )
-
-
-   INTEGER(iwp),      INTENT(IN)    ::  dots_max !< variable output array index
-   INTEGER(iwp),      INTENT(INOUT)    ::  dots_num !< variable output array index
-   CHARACTER (LEN=*), DIMENSION(dots_max), INTENT(INOUT) :: dots_label
-   CHARACTER (LEN=*), DIMENSION(dots_max), INTENT(INOUT) :: dots_unit
-
-
-   IF ( radiation )  THEN
-      CALL radiation_check_data_output_ts( dots_max, dots_num, dots_label, dots_unit )
-   ENDIF
-
-   IF ( user_module_enabled )  THEN
-      CALL user_check_data_output_ts( dots_max, dots_num, dots_label, dots_unit )
-   ENDIF
-
-
-END SUBROUTINE module_interface_check_data_output_ts
+ SUBROUTINE module_interface_check_data_output_ts( dots_max, dots_num, dots_label, dots_unit )
+
+
+    INTEGER(iwp),      INTENT(IN)    ::  dots_max !< variable output array index
+    INTEGER(iwp),      INTENT(INOUT)    ::  dots_num !< variable output array index
+    CHARACTER (LEN=*), DIMENSION(dots_max), INTENT(INOUT) :: dots_label
+    CHARACTER (LEN=*), DIMENSION(dots_max), INTENT(INOUT) :: dots_unit
+
+
+    IF ( radiation )  THEN
+       CALL radiation_check_data_output_ts( dots_max, dots_num, dots_label, dots_unit )
+    ENDIF
+
+    IF ( user_module_enabled )  THEN
+       CALL user_check_data_output_ts( dots_max, dots_num, dots_label, dots_unit )
+    ENDIF
+
+
+ END SUBROUTINE module_interface_check_data_output_ts
 
 
@@ -561,49 +566,48 @@
 !> Check module-specific data output of profiles
 !------------------------------------------------------------------------------!
-SUBROUTINE module_interface_check_data_output_pr( variable, var_count, unit,   &
-                                                dopr_unit )
-
-
-   CHARACTER (LEN=*), INTENT(IN)    ::  variable  !< variable name
-   INTEGER(iwp),      INTENT(IN)    ::  var_count !< variable output array index
-   CHARACTER (LEN=*), INTENT(INOUT) ::  unit      !< physical unit of variable
-   CHARACTER (LEN=*), INTENT(OUT)   ::  dopr_unit !< local value of dopr_unit
-
-   IF ( unit == 'illegal' .AND.  bulk_cloud_model )  THEN
-      CALL bcm_check_data_output_pr( variable, var_count, unit, dopr_unit )
-   ENDIF
-
-   IF ( unit == 'illegal' .AND.  air_chemistry )  THEN
-      CALL chem_check_data_output_pr( variable, var_count, unit, dopr_unit )
-   ENDIF
-
-   IF ( unit == 'illegal'  .AND.  gust_module_enabled  )  THEN
-      CALL gust_check_data_output_pr( variable, var_count, unit, dopr_unit )
-   ENDIF
-
-   IF ( unit == 'illegal' )  THEN ! ToDo: add module switch if possible
-      CALL lsm_check_data_output_pr( variable, var_count, unit, dopr_unit )
-   ENDIF
-
-   IF ( unit == 'illegal' )  THEN ! ToDo: add module switch if possible
-      CALL lsf_nudging_check_data_output_pr( variable, var_count, unit, dopr_unit )
-   ENDIF
-
-   IF ( unit == 'illegal'  .AND.  ocean_mode )  THEN
-      CALL ocean_check_data_output_pr( variable, var_count, unit, dopr_unit )
-   ENDIF
-
-   IF ( unit == 'illegal'  .AND.  radiation )  THEN
-      CALL radiation_check_data_output_pr( variable, var_count, unit, dopr_unit )
-   ENDIF
-
-   IF ( unit == 'illegal'  .AND.  user_module_enabled )  THEN
-      unit = '' ! ToDo: Seems like a hack. Find a general soultion!
-      CALL user_check_data_output_pr( variable, var_count, unit, dopr_unit )
-   ENDIF
-
-
-
-END SUBROUTINE module_interface_check_data_output_pr
+ SUBROUTINE module_interface_check_data_output_pr( variable, var_count, unit,  &
+                                                   dopr_unit )
+
+
+    CHARACTER (LEN=*), INTENT(IN)    ::  variable  !< variable name
+    INTEGER(iwp),      INTENT(IN)    ::  var_count !< variable output array index
+    CHARACTER (LEN=*), INTENT(INOUT) ::  unit      !< physical unit of variable
+    CHARACTER (LEN=*), INTENT(OUT)   ::  dopr_unit !< local value of dopr_unit
+
+    IF ( unit == 'illegal' .AND.  bulk_cloud_model )  THEN
+       CALL bcm_check_data_output_pr( variable, var_count, unit, dopr_unit )
+    ENDIF
+
+    IF ( unit == 'illegal' .AND.  air_chemistry )  THEN
+       CALL chem_check_data_output_pr( variable, var_count, unit, dopr_unit )
+    ENDIF
+
+    IF ( unit == 'illegal'  .AND.  gust_module_enabled  )  THEN
+       CALL gust_check_data_output_pr( variable, var_count, unit, dopr_unit )
+    ENDIF
+
+    IF ( unit == 'illegal' )  THEN ! ToDo: add module switch if possible
+       CALL lsm_check_data_output_pr( variable, var_count, unit, dopr_unit )
+    ENDIF
+
+    IF ( unit == 'illegal' )  THEN ! ToDo: add module switch if possible
+       CALL lsf_nudging_check_data_output_pr( variable, var_count, unit, dopr_unit )
+    ENDIF
+
+    IF ( unit == 'illegal'  .AND.  ocean_mode )  THEN
+       CALL ocean_check_data_output_pr( variable, var_count, unit, dopr_unit )
+    ENDIF
+
+    IF ( unit == 'illegal'  .AND.  radiation )  THEN
+       CALL radiation_check_data_output_pr( variable, var_count, unit, dopr_unit )
+    ENDIF
+
+    IF ( unit == 'illegal'  .AND.  user_module_enabled )  THEN
+       unit = '' ! ToDo: Seems like a hack. Find a general soultion!
+       CALL user_check_data_output_pr( variable, var_count, unit, dopr_unit )
+    ENDIF
+
+
+ END SUBROUTINE module_interface_check_data_output_pr
 
 !------------------------------------------------------------------------------!
@@ -612,69 +616,69 @@
 !> Check module-specific 2D and 3D data output
 !------------------------------------------------------------------------------!
-SUBROUTINE module_interface_check_data_output( variable, unit, i, j, ilen, k )
-
-
-   CHARACTER (LEN=*), INTENT(IN)    ::  variable !< variable name
-   CHARACTER (LEN=*), INTENT(INOUT) ::  unit     !< physical unit of variable
-
-   INTEGER(iwp),      INTENT(IN)    :: i         !< ToDo: remove dummy argument, instead pass string from data_output
-   INTEGER(iwp),      INTENT(IN)    :: j         !< average quantity? 0 = no, 1 = yes
-   INTEGER(iwp),      INTENT(IN)    :: ilen      !< ToDo: remove dummy argument, instead pass string from data_output
-   INTEGER(iwp),      INTENT(IN)    :: k         !< ToDo: remove dummy argument, instead pass string from data_output
-
-   IF ( unit == 'illegal'  .AND.  biometeorology )  THEN
-      CALL bio_check_data_output( variable, unit, i, j, ilen, k )
-   ENDIF
-
-   IF ( unit == 'illegal'  .AND.  bulk_cloud_model  )  THEN
-      CALL bcm_check_data_output( variable, unit )
-   ENDIF
-
-   IF ( unit == 'illegal'  .AND.  air_chemistry                                &
-        .AND.  (variable(1:3) == 'kc_' .OR. variable(1:3) == 'em_') )  THEN  ! ToDo: remove aditional conditions
-      CALL chem_check_data_output( variable, unit, i, ilen, k )
-   ENDIF
-
-   IF ( unit == 'illegal'  .AND.  gust_module_enabled  )  THEN
-      CALL gust_check_data_output( variable, unit )
-   ENDIF
-
-   IF ( unit == 'illegal' )  THEN  ! ToDo: add module switch if possible
-      CALL lsm_check_data_output( variable, unit, i, ilen, k )
-   ENDIF
-
-   IF ( unit == 'illegal'  .AND.  ocean_mode )  THEN
-      CALL ocean_check_data_output( variable, unit )
-   ENDIF
-
-   IF ( unit == 'illegal'  .AND.  plant_canopy                                 &
-        .AND.  variable(1:4) == 'pcm_' )  THEN  ! ToDo: remove aditional conditions
-      CALL pcm_check_data_output( variable, unit )
-   ENDIF
-
-   IF ( unit == 'illegal'  .AND.  radiation )  THEN
-      CALL radiation_check_data_output( variable, unit, i, ilen, k )
-   ENDIF
-
-   IF ( unit == 'illegal' .AND. salsa ) THEN
+ SUBROUTINE module_interface_check_data_output( variable, unit, i, j, ilen, k )
+
+
+    CHARACTER (LEN=*), INTENT(IN)    ::  variable !< variable name
+    CHARACTER (LEN=*), INTENT(INOUT) ::  unit     !< physical unit of variable
+
+    INTEGER(iwp),      INTENT(IN)    :: i         !< ToDo: remove dummy argument, instead pass string from data_output
+    INTEGER(iwp),      INTENT(IN)    :: j         !< average quantity? 0 = no, 1 = yes
+    INTEGER(iwp),      INTENT(IN)    :: ilen      !< ToDo: remove dummy argument, instead pass string from data_output
+    INTEGER(iwp),      INTENT(IN)    :: k         !< ToDo: remove dummy argument, instead pass string from data_output
+
+    IF ( unit == 'illegal'  .AND.  biometeorology )  THEN
+       CALL bio_check_data_output( variable, unit, i, j, ilen, k )
+    ENDIF
+
+    IF ( unit == 'illegal'  .AND.  bulk_cloud_model  )  THEN
+       CALL bcm_check_data_output( variable, unit )
+    ENDIF
+
+    IF ( unit == 'illegal'  .AND.  air_chemistry                               &
+         .AND.  (variable(1:3) == 'kc_' .OR. variable(1:3) == 'em_') )  THEN  ! ToDo: remove aditional conditions
+       CALL chem_check_data_output( variable, unit, i, ilen, k )
+    ENDIF
+
+    IF ( unit == 'illegal'  .AND.  gust_module_enabled  )  THEN
+       CALL gust_check_data_output( variable, unit )
+    ENDIF
+
+    IF ( unit == 'illegal' )  THEN  ! ToDo: add module switch if possible
+       CALL lsm_check_data_output( variable, unit, i, ilen, k )
+    ENDIF
+
+    IF ( unit == 'illegal'  .AND.  ocean_mode )  THEN
+       CALL ocean_check_data_output( variable, unit )
+    ENDIF
+
+    IF ( unit == 'illegal'  .AND.  plant_canopy                                &
+         .AND.  variable(1:4) == 'pcm_' )  THEN  ! ToDo: remove aditional conditions
+       CALL pcm_check_data_output( variable, unit )
+    ENDIF
+
+    IF ( unit == 'illegal'  .AND.  radiation )  THEN
+       CALL radiation_check_data_output( variable, unit, i, ilen, k )
+    ENDIF
+
+    IF ( unit == 'illegal' .AND. salsa ) THEN
        CALL salsa_check_data_output( variable, unit )
-   ENDIF
-
-   IF ( unit == 'illegal' .AND. indoor_model ) THEN
+    ENDIF
+
+    IF ( unit == 'illegal' .AND. indoor_model ) THEN
        CALL im_check_data_output( variable, unit )
-   ENDIF
+    ENDIF
    
-   IF ( unit == 'illegal'  .AND.  urban_surface                      &
+    IF ( unit == 'illegal'  .AND.  urban_surface                      &
         .AND.  variable(1:4) == 'usm_' )  THEN  ! ToDo: remove aditional conditions
        CALL usm_check_data_output( variable, unit )
-   ENDIF
-
-   IF ( unit == 'illegal'  .AND.  user_module_enabled )  THEN
-      unit = ''
-      CALL user_check_data_output( variable, unit )
-   ENDIF
-
-
-END SUBROUTINE module_interface_check_data_output
+    ENDIF
+
+    IF ( unit == 'illegal'  .AND.  user_module_enabled )  THEN
+       unit = ''
+       CALL user_check_data_output( variable, unit )
+    ENDIF
+
+
+ END SUBROUTINE module_interface_check_data_output
 
 
@@ -685,30 +689,30 @@
 !> Interface for init_masks. ToDo: get rid of these redundant calls!
 !------------------------------------------------------------------------------!
-SUBROUTINE module_interface_init_masks( variable, unit )
-
-
-   CHARACTER (LEN=*), INTENT(IN)    ::  variable !< variable name
-   CHARACTER (LEN=*), INTENT(INOUT) ::  unit     !< physical unit of variable
-
-   IF ( unit == 'illegal'  .AND.  air_chemistry                                &
-        .AND.  (variable(1:3) == 'kc_' .OR. variable(1:3) == 'em_') )  THEN  ! ToDo: remove aditional conditions
-      CALL chem_check_data_output( variable, unit, 0, 0, 0 )
-   ENDIF
-
-   IF ( unit == 'illegal'  .AND.  radiation )  THEN
-      CALL radiation_check_data_output( variable, unit, 0, 0, 0 )
-   ENDIF
-
-   IF ( unit == 'illegal'  .AND.  salsa )  THEN
-      CALL salsa_check_data_output( variable, unit )
-   ENDIF
-
-   IF ( unit == 'illegal'  .AND.  user_module_enabled )  THEN
-      unit = ''
-      CALL user_check_data_output( variable, unit )
-   ENDIF
-
-
-END SUBROUTINE module_interface_init_masks
+ SUBROUTINE module_interface_init_masks( variable, unit )
+
+
+    CHARACTER (LEN=*), INTENT(IN)    ::  variable !< variable name
+    CHARACTER (LEN=*), INTENT(INOUT) ::  unit     !< physical unit of variable
+
+    IF ( unit == 'illegal'  .AND.  air_chemistry                               &
+         .AND.  (variable(1:3) == 'kc_' .OR. variable(1:3) == 'em_') )  THEN  ! ToDo: remove aditional conditions
+       CALL chem_check_data_output( variable, unit, 0, 0, 0 )
+    ENDIF
+
+    IF ( unit == 'illegal'  .AND.  radiation )  THEN
+       CALL radiation_check_data_output( variable, unit, 0, 0, 0 )
+    ENDIF
+
+    IF ( unit == 'illegal'  .AND.  salsa )  THEN
+       CALL salsa_check_data_output( variable, unit )
+    ENDIF
+
+    IF ( unit == 'illegal'  .AND.  user_module_enabled )  THEN
+       unit = ''
+       CALL user_check_data_output( variable, unit )
+    ENDIF
+
+
+ END SUBROUTINE module_interface_init_masks
 
 
@@ -719,22 +723,25 @@
 !> Define appropriate grid for module-specific netcdf output variables.
 !------------------------------------------------------------------------------!
-SUBROUTINE module_interface_define_netcdf_grid( var, found,                    &
-                                                grid_x, grid_y, grid_z )
-
-
-   CHARACTER (LEN=*), INTENT(IN)  ::  var    !< variable name
-   LOGICAL,           INTENT(OUT) ::  found  !< indicates if variable was found
-   CHARACTER (LEN=*), INTENT(OUT) ::  grid_x !< netcdf dimension in x-direction
-   CHARACTER (LEN=*), INTENT(OUT) ::  grid_y !< netcdf dimension in y-direction
-   CHARACTER (LEN=*), INTENT(OUT) ::  grid_z !< netcdf dimension in z-direction
-!
-!--As long as no action is done in this subroutine, initialize strings with   
-!--intent(out) attribute, in order to avoid compiler warnings.
-   found  = .FALSE.
-   grid_x = 'none'
-   grid_y = 'none'
-   grid_z = 'none'
-
-END SUBROUTINE module_interface_define_netcdf_grid
+ SUBROUTINE module_interface_define_netcdf_grid( var, found,                   &
+                                                 grid_x, grid_y, grid_z )
+
+
+    CHARACTER (LEN=*), INTENT(IN)  ::  var    !< variable name
+    LOGICAL,           INTENT(OUT) ::  found  !< indicates if variable was found
+    CHARACTER (LEN=*), INTENT(OUT) ::  grid_x !< netcdf dimension in x-direction
+    CHARACTER (LEN=*), INTENT(OUT) ::  grid_y !< netcdf dimension in y-direction
+    CHARACTER (LEN=*), INTENT(OUT) ::  grid_z !< netcdf dimension in z-direction
+!
+!-- As long as no action is done in this subroutine, initialize strings with
+!-- intent(out) attribute, in order to avoid compiler warnings.
+    found  = .FALSE.
+    grid_x = 'none'
+    grid_y = 'none'
+    grid_z = 'none'
+!
+!-- Use var to avoid compiler warning about unused variable
+    IF ( var == ' ' )  RETURN
+
+ END SUBROUTINE module_interface_define_netcdf_grid
 
 
@@ -744,20 +751,20 @@
 !> Allocate module-specific arrays and pointers
 !------------------------------------------------------------------------------!
-SUBROUTINE module_interface_init_arrays
-
-
-   IF ( bulk_cloud_model    )  CALL bcm_init_arrays
-   IF ( air_chemistry       )  CALL chem_init_arrays
-   IF ( gust_module_enabled )  CALL gust_init_arrays
-   IF ( land_surface        )  CALL lsm_init_arrays
-   IF ( ocean_mode          )  CALL ocean_init_arrays
-   IF ( salsa               )  CALL salsa_init_arrays
-   IF ( urban_surface       )  CALL usm_init_arrays
-   IF ( surface_output      )  CALL surface_data_output_init_arrays
-   IF ( wind_turbine        )  CALL wtm_init_arrays
-   IF ( user_module_enabled )  CALL user_init_arrays
-
-
-END SUBROUTINE module_interface_init_arrays
+ SUBROUTINE module_interface_init_arrays
+
+
+    IF ( bulk_cloud_model    )  CALL bcm_init_arrays
+    IF ( air_chemistry       )  CALL chem_init_arrays
+    IF ( gust_module_enabled )  CALL gust_init_arrays
+    IF ( land_surface        )  CALL lsm_init_arrays
+    IF ( ocean_mode          )  CALL ocean_init_arrays
+    IF ( salsa               )  CALL salsa_init_arrays
+    IF ( urban_surface       )  CALL usm_init_arrays
+    IF ( surface_output      )  CALL surface_data_output_init_arrays
+    IF ( wind_turbine        )  CALL wtm_init_arrays
+    IF ( user_module_enabled )  CALL user_init_arrays
+
+
+ END SUBROUTINE module_interface_init_arrays
 
 
@@ -767,27 +774,27 @@
 !> Perform module-specific initialization
 !------------------------------------------------------------------------------!
-SUBROUTINE module_interface_init
-
-
-   IF ( biometeorology      )  CALL bio_init
-   IF ( bulk_cloud_model    )  CALL bcm_init
-   IF ( air_chemistry       )  CALL chem_init
-   IF ( virtual_flight      )  CALL flight_init
-   IF ( gust_module_enabled )  CALL gust_init
-   IF ( indoor_model        )  CALL im_init
-   IF ( large_scale_forcing )  CALL lsf_init
-   IF ( land_surface        )  CALL lsm_init
-   IF ( nudging             )  CALL nudge_init
-   IF ( ocean_mode          )  CALL ocean_init
-   IF ( plant_canopy        )  CALL pcm_init
-   IF ( salsa               )  CALL salsa_init
-   IF ( urban_surface       )  CALL usm_init
-   IF ( virtual_measurement )  CALL vm_init
-   IF ( wind_turbine        )  CALL wtm_init
-   IF ( radiation           )  CALL radiation_init
-   IF ( user_module_enabled )  CALL user_init
-
-
-END SUBROUTINE module_interface_init
+ SUBROUTINE module_interface_init
+
+
+    IF ( biometeorology      )  CALL bio_init
+    IF ( bulk_cloud_model    )  CALL bcm_init
+    IF ( air_chemistry       )  CALL chem_init
+    IF ( virtual_flight      )  CALL flight_init
+    IF ( gust_module_enabled )  CALL gust_init
+    IF ( indoor_model        )  CALL im_init
+    IF ( large_scale_forcing )  CALL lsf_init
+    IF ( land_surface        )  CALL lsm_init
+    IF ( nudging             )  CALL nudge_init
+    IF ( ocean_mode          )  CALL ocean_init
+    IF ( plant_canopy        )  CALL pcm_init
+    IF ( salsa               )  CALL salsa_init
+    IF ( urban_surface       )  CALL usm_init
+    IF ( virtual_measurement )  CALL vm_init
+    IF ( wind_turbine        )  CALL wtm_init
+    IF ( radiation           )  CALL radiation_init
+    IF ( user_module_enabled )  CALL user_init
+
+
+ END SUBROUTINE module_interface_init
 
 
@@ -797,11 +804,11 @@
 !> Perform module-specific post-initialization checks
 !------------------------------------------------------------------------------!
-SUBROUTINE module_interface_init_checks
-
-
-   IF ( biometeorology      )  CALL bio_init_checks
-
-
-END SUBROUTINE module_interface_init_checks
+ SUBROUTINE module_interface_init_checks
+
+
+    IF ( biometeorology      )  CALL bio_init_checks
+
+
+ END SUBROUTINE module_interface_init_checks
 
 
@@ -811,28 +818,28 @@
 !> Gather module-specific header output
 !------------------------------------------------------------------------------!
-SUBROUTINE module_interface_header( io )
-
-
-   INTEGER(iwp), INTENT(IN) ::  io  !< unit of the output file
-
-
-   IF ( biometeorology      )  CALL bio_header ( io )
-   IF ( bulk_cloud_model    )  CALL bcm_header( io )
-   IF ( air_chemistry       )  CALL chem_header ( io )
-   IF ( virtual_flight      )  CALL flight_header( io )
-   IF ( gust_module_enabled )  CALL gust_header( io )
-   IF ( land_surface        )  CALL lsm_header( io )
-   IF ( large_scale_forcing )  CALL lsf_nudging_header( io )
-   IF ( nesting_offline     )  CALL nesting_offl_header( io )
-   IF ( ocean_mode          )  CALL ocean_header( io )
-   IF ( plant_canopy        )  CALL pcm_header( io )
-   IF ( radiation           )  CALL radiation_header( io )
-   IF ( salsa               )  CALL salsa_header( io )
-   IF ( calculate_spectra   )  CALL spectra_header( io )
-   IF ( syn_turb_gen        )  CALL stg_header( io )
-   IF ( user_module_enabled )  CALL user_header( io )
-
-
-END SUBROUTINE module_interface_header
+ SUBROUTINE module_interface_header( io )
+
+
+    INTEGER(iwp), INTENT(IN) ::  io  !< unit of the output file
+
+
+    IF ( biometeorology      )  CALL bio_header ( io )
+    IF ( bulk_cloud_model    )  CALL bcm_header( io )
+    IF ( air_chemistry       )  CALL chem_header ( io )
+    IF ( virtual_flight      )  CALL flight_header( io )
+    IF ( gust_module_enabled )  CALL gust_header( io )
+    IF ( land_surface        )  CALL lsm_header( io )
+    IF ( large_scale_forcing )  CALL lsf_nudging_header( io )
+    IF ( nesting_offline     )  CALL nesting_offl_header( io )
+    IF ( ocean_mode          )  CALL ocean_header( io )
+    IF ( plant_canopy        )  CALL pcm_header( io )
+    IF ( radiation           )  CALL radiation_header( io )
+    IF ( salsa               )  CALL salsa_header( io )
+    IF ( calculate_spectra   )  CALL spectra_header( io )
+    IF ( syn_turb_gen        )  CALL stg_header( io )
+    IF ( user_module_enabled )  CALL user_header( io )
+
+
+ END SUBROUTINE module_interface_header
 
 
@@ -842,15 +849,15 @@
 !> Perform module-specific actions while in time-integration (cache-optimized)
 !------------------------------------------------------------------------------!
-SUBROUTINE module_interface_actions( location )
-
-
-   CHARACTER (LEN=*), INTENT(IN) ::  location !< call location string
-
-
-   IF ( gust_module_enabled )  CALL gust_actions( location )
-   IF ( user_module_enabled )  CALL user_actions( location )
-
-
-END SUBROUTINE module_interface_actions
+ SUBROUTINE module_interface_actions( location )
+
+
+    CHARACTER (LEN=*), INTENT(IN) ::  location !< call location string
+
+
+    IF ( gust_module_enabled )  CALL gust_actions( location )
+    IF ( user_module_enabled )  CALL user_actions( location )
+
+
+ END SUBROUTINE module_interface_actions
 
 
@@ -860,17 +867,17 @@
 !> Perform module-specific actions while in time-integration (vector-optimized)
 !------------------------------------------------------------------------------!
-SUBROUTINE module_interface_actions_ij( i, j, location )
-
-
-   INTEGER(iwp),      INTENT(IN) ::  i         !< grid index in x-direction
-   INTEGER(iwp),      INTENT(IN) ::  j         !< grid index in y-direction
-   CHARACTER (LEN=*), INTENT(IN) ::  location  !< call location string
-
-
-   IF ( gust_module_enabled )  CALL gust_actions( i, j, location )
-   IF ( user_module_enabled )  CALL user_actions( i, j, location )
-
-
-END SUBROUTINE module_interface_actions_ij
+ SUBROUTINE module_interface_actions_ij( i, j, location )
+
+
+    INTEGER(iwp),      INTENT(IN) ::  i         !< grid index in x-direction
+    INTEGER(iwp),      INTENT(IN) ::  j         !< grid index in y-direction
+    CHARACTER (LEN=*), INTENT(IN) ::  location  !< call location string
+
+
+    IF ( gust_module_enabled )  CALL gust_actions( i, j, location )
+    IF ( user_module_enabled )  CALL user_actions( i, j, location )
+
+
+ END SUBROUTINE module_interface_actions_ij
 
 
@@ -880,19 +887,19 @@
 !> Swap the timelevel pointers for module-specific arrays
 !------------------------------------------------------------------------------!
-SUBROUTINE module_interface_swap_timelevel ( swap_mode )
-
-
-   INTEGER(iwp), INTENT(IN) :: swap_mode !< determines procedure of pointer swap
-
-   IF ( bulk_cloud_model    )  CALL bcm_swap_timelevel( swap_mode )
-   IF ( air_chemistry       )  CALL chem_swap_timelevel( swap_mode )
-   IF ( gust_module_enabled )  CALL gust_swap_timelevel( swap_mode )
-   IF ( land_surface        )  CALL lsm_swap_timelevel( swap_mode )
-   IF ( ocean_mode          )  CALL ocean_swap_timelevel( swap_mode )
-   IF ( salsa               )  CALL salsa_swap_timelevel( swap_mode )
-   IF ( urban_surface       )  CALL usm_swap_timelevel( swap_mode )
-
-
-END SUBROUTINE module_interface_swap_timelevel
+ SUBROUTINE module_interface_swap_timelevel ( swap_mode )
+
+
+    INTEGER(iwp), INTENT(IN) :: swap_mode !< determines procedure of pointer swap
+
+    IF ( bulk_cloud_model    )  CALL bcm_swap_timelevel( swap_mode )
+    IF ( air_chemistry       )  CALL chem_swap_timelevel( swap_mode )
+    IF ( gust_module_enabled )  CALL gust_swap_timelevel( swap_mode )
+    IF ( land_surface        )  CALL lsm_swap_timelevel( swap_mode )
+    IF ( ocean_mode          )  CALL ocean_swap_timelevel( swap_mode )
+    IF ( salsa               )  CALL salsa_swap_timelevel( swap_mode )
+    IF ( urban_surface       )  CALL usm_swap_timelevel( swap_mode )
+
+
+ END SUBROUTINE module_interface_swap_timelevel
 
 
@@ -903,23 +910,23 @@
 !> Perform module-specific averaging of 3D data
 !------------------------------------------------------------------------------!
-SUBROUTINE module_interface_3d_data_averaging( mode, variable )
-
-
-   CHARACTER (LEN=*), INTENT(IN) ::  mode     !< averaging interface mode
-   CHARACTER (LEN=*), INTENT(IN) ::  variable !< variable name
-
-   IF ( biometeorology      )  CALL bio_3d_data_averaging( mode, variable )
-   IF ( bulk_cloud_model    )  CALL bcm_3d_data_averaging( mode, variable )
-   IF ( air_chemistry       )  CALL chem_3d_data_averaging( mode, variable )
-   IF ( gust_module_enabled )  CALL gust_3d_data_averaging( mode, variable )
-   IF ( land_surface        )  CALL lsm_3d_data_averaging( mode, variable )
-   IF ( ocean_mode          )  CALL ocean_3d_data_averaging( mode, variable )
-   IF ( radiation           )  CALL radiation_3d_data_averaging( mode, variable )
-   IF ( salsa               )  CALL salsa_3d_data_averaging( mode, variable )
-   IF ( urban_surface       )  CALL usm_3d_data_averaging( mode, variable )
-   IF ( user_module_enabled )  CALL user_3d_data_averaging( mode, variable )
-
-
-END SUBROUTINE module_interface_3d_data_averaging
+ SUBROUTINE module_interface_3d_data_averaging( mode, variable )
+
+
+    CHARACTER (LEN=*), INTENT(IN) ::  mode     !< averaging interface mode
+    CHARACTER (LEN=*), INTENT(IN) ::  variable !< variable name
+
+    IF ( biometeorology      )  CALL bio_3d_data_averaging( mode, variable )
+    IF ( bulk_cloud_model    )  CALL bcm_3d_data_averaging( mode, variable )
+    IF ( air_chemistry       )  CALL chem_3d_data_averaging( mode, variable )
+    IF ( gust_module_enabled )  CALL gust_3d_data_averaging( mode, variable )
+    IF ( land_surface        )  CALL lsm_3d_data_averaging( mode, variable )
+    IF ( ocean_mode          )  CALL ocean_3d_data_averaging( mode, variable )
+    IF ( radiation           )  CALL radiation_3d_data_averaging( mode, variable )
+    IF ( salsa               )  CALL salsa_3d_data_averaging( mode, variable )
+    IF ( urban_surface       )  CALL usm_3d_data_averaging( mode, variable )
+    IF ( user_module_enabled )  CALL user_3d_data_averaging( mode, variable )
+
+
+ END SUBROUTINE module_interface_3d_data_averaging
 
 !------------------------------------------------------------------------------!
@@ -929,76 +936,76 @@
 !> Define module-specific 2D output variables
 !------------------------------------------------------------------------------!
-SUBROUTINE module_interface_data_output_2d( av, variable, found, grid, mode,   &
-                                            local_pf, two_d, nzb_do, nzt_do,   &
-                                            fill_value )
-
-   INTEGER(iwp),      INTENT(IN)    ::  av         !< flag for (non-)average output
-   CHARACTER (LEN=*), INTENT(IN)    ::  variable   !< variable name
-   LOGICAL,           INTENT(INOUT) ::  found      !< flag if output variable is found
-   CHARACTER (LEN=*), INTENT(INOUT) ::  grid       !< name of vertical grid
-   CHARACTER (LEN=*), INTENT(IN)    ::  mode       !< either 'xy', 'xz' or 'yz'
-   LOGICAL,           INTENT(OUT)   ::  two_d      !< flag for 2D variables
-   INTEGER(iwp),      INTENT(IN)    ::  nzb_do     !< vertical output index (bottom) (usually 0)
-   INTEGER(iwp),      INTENT(IN)    ::  nzt_do     !< vertical output index (top) (usually nz_do3d)
-   REAL(wp),          INTENT(IN)    ::  fill_value !< to be removed
-
-   REAL(wp), DIMENSION(nxl:nxr,nys:nyn,nzb_do:nzt_do), INTENT(OUT) ::  local_pf !< ToDo: can also be kind=sp
-
-
-   IF ( .NOT. found  .AND.  biometeorology )  THEN
-      CALL bio_data_output_2d(                                                 &
-              av, variable, found, grid, local_pf, two_d, nzb_do, nzt_do       &
-           )
-   ENDIF
-
-   IF ( .NOT. found  .AND.  bulk_cloud_model )  THEN
-      CALL bcm_data_output_2d(                                                 &
-              av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do &
-           )
-   ENDIF
-
-   IF ( .NOT. found  .AND.  air_chemistry )  THEN
-      CALL chem_data_output_2d(                                                &
-              av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do, fill_value &
-           )
-   ENDIF
-
-   IF ( .NOT. found  .AND.  gust_module_enabled )  THEN
-      CALL gust_data_output_2d(                                                &
-              av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do, fill_value &
-           )
-   ENDIF
-
-   IF ( .NOT. found  .AND.  land_surface )  THEN
-      CALL lsm_data_output_2d(                                                 &
-              av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do &
-           )
-   ENDIF
-
-   IF ( .NOT. found  .AND.  ocean_mode )  THEN
-      CALL ocean_data_output_2d(                                               &
-              av, variable, found, grid, mode, local_pf, nzb_do, nzt_do        &
-           )
-   ENDIF
-
-   IF ( .NOT. found  .AND.  radiation )  THEN
-      CALL radiation_data_output_2d(                                           &
-              av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do &
-           )
-   ENDIF
-
-   IF ( .NOT. found  .AND.  salsa )  THEN
-      CALL salsa_data_output_2d(                                               &
-              av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do &
-           )
-   ENDIF
-
-   IF ( .NOT. found  .AND.  user_module_enabled )  THEN
-      CALL user_data_output_2d(                                                &
-              av, variable, found, grid, local_pf, two_d, nzb_do, nzt_do       &
-           )
-   ENDIF
-
-END SUBROUTINE module_interface_data_output_2d
+ SUBROUTINE module_interface_data_output_2d( av, variable, found, grid, mode,  &
+                                             local_pf, two_d, nzb_do, nzt_do,  &
+                                             fill_value )
+
+    INTEGER(iwp),      INTENT(IN)    ::  av         !< flag for (non-)average output
+    CHARACTER (LEN=*), INTENT(IN)    ::  variable   !< variable name
+    LOGICAL,           INTENT(INOUT) ::  found      !< flag if output variable is found
+    CHARACTER (LEN=*), INTENT(INOUT) ::  grid       !< name of vertical grid
+    CHARACTER (LEN=*), INTENT(IN)    ::  mode       !< either 'xy', 'xz' or 'yz'
+    LOGICAL,           INTENT(OUT)   ::  two_d      !< flag for 2D variables
+    INTEGER(iwp),      INTENT(IN)    ::  nzb_do     !< vertical output index (bottom) (usually 0)
+    INTEGER(iwp),      INTENT(IN)    ::  nzt_do     !< vertical output index (top) (usually nz_do3d)
+    REAL(wp),          INTENT(IN)    ::  fill_value !< to be removed
+
+    REAL(wp), DIMENSION(nxl:nxr,nys:nyn,nzb_do:nzt_do), INTENT(OUT) ::  local_pf !< ToDo: can also be kind=sp
+
+
+    IF ( .NOT. found  .AND.  biometeorology )  THEN
+       CALL bio_data_output_2d(                                                &
+               av, variable, found, grid, local_pf, two_d, nzb_do, nzt_do      &
+            )
+    ENDIF
+
+    IF ( .NOT. found  .AND.  bulk_cloud_model )  THEN
+       CALL bcm_data_output_2d(                                                &
+               av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do&
+            )
+    ENDIF
+
+    IF ( .NOT. found  .AND.  air_chemistry )  THEN
+       CALL chem_data_output_2d(                                               &
+               av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do, fill_value &
+            )
+    ENDIF
+
+    IF ( .NOT. found  .AND.  gust_module_enabled )  THEN
+       CALL gust_data_output_2d(                                               &
+               av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do, fill_value &
+            )
+    ENDIF
+
+    IF ( .NOT. found  .AND.  land_surface )  THEN
+       CALL lsm_data_output_2d(                                                &
+               av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do&
+            )
+    ENDIF
+
+    IF ( .NOT. found  .AND.  ocean_mode )  THEN
+       CALL ocean_data_output_2d(                                              &
+               av, variable, found, grid, mode, local_pf, nzb_do, nzt_do       &
+            )
+    ENDIF
+
+    IF ( .NOT. found  .AND.  radiation )  THEN
+       CALL radiation_data_output_2d(                                          &
+               av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do&
+            )
+    ENDIF
+
+    IF ( .NOT. found  .AND.  salsa )  THEN
+       CALL salsa_data_output_2d(                                              &
+               av, variable, found, grid, mode, local_pf, two_d, nzb_do, nzt_do&
+            )
+    ENDIF
+
+    IF ( .NOT. found  .AND.  user_module_enabled )  THEN
+       CALL user_data_output_2d(                                               &
+               av, variable, found, grid, local_pf, two_d, nzb_do, nzt_do      &
+            )
+    ENDIF
+
+ END SUBROUTINE module_interface_data_output_2d
 
 
@@ -1009,71 +1016,71 @@
 !> Define module-specific 3D output variables
 !------------------------------------------------------------------------------!
-SUBROUTINE module_interface_data_output_3d( av, variable, found, local_pf,     &
-                                            fill_value, resorted, nzb_do, nzt_do )
-
-
-   INTEGER(iwp),      INTENT(IN)    ::  av         !< flag for (non-)average output
-   CHARACTER (LEN=*), INTENT(IN)    ::  variable   !< variable name
-   LOGICAL,           INTENT(INOUT) ::  found      !< flag if output variable is found
-   REAL(wp),          INTENT(IN)    ::  fill_value !< ToDo: refactor
-   LOGICAL,           INTENT(OUT)   ::  resorted   !< flag if output has been resorted
-   INTEGER(iwp),      INTENT(IN)    ::  nzb_do     !< vertical output index (bottom) (usually 0)
-   INTEGER(iwp),      INTENT(IN)    ::  nzt_do     !< vertical output index (top) (usually nz_do3d)
-
-   REAL(sp), DIMENSION(nxl:nxr,nys:nyn,nzb_do:nzt_do), INTENT(OUT) ::  local_pf
-
-
-   IF ( .NOT. found  .AND.  biometeorology )  THEN
-      CALL bio_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do )
-      resorted = .FALSE.
-   ENDIF
-
-   IF ( .NOT. found  .AND.  bulk_cloud_model )  THEN
-      CALL bcm_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do )
-      resorted = .TRUE.
-   ENDIF
-
-   IF ( .NOT. found  .AND.  air_chemistry )  THEN
-      CALL chem_data_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do )
-      resorted = .TRUE.
-   ENDIF
-
-   IF ( .NOT. found  .AND.  gust_module_enabled )  THEN
-      CALL gust_data_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do )
-      resorted = .TRUE.
-   ENDIF
+ SUBROUTINE module_interface_data_output_3d( av, variable, found, local_pf,    &
+                                             fill_value, resorted, nzb_do, nzt_do )
+
+
+    INTEGER(iwp),      INTENT(IN)    ::  av         !< flag for (non-)average output
+    CHARACTER (LEN=*), INTENT(IN)    ::  variable   !< variable name
+    LOGICAL,           INTENT(INOUT) ::  found      !< flag if output variable is found
+    REAL(wp),          INTENT(IN)    ::  fill_value !< ToDo: refactor
+    LOGICAL,           INTENT(OUT)   ::  resorted   !< flag if output has been resorted
+    INTEGER(iwp),      INTENT(IN)    ::  nzb_do     !< vertical output index (bottom) (usually 0)
+    INTEGER(iwp),      INTENT(IN)    ::  nzt_do     !< vertical output index (top) (usually nz_do3d)
+
+    REAL(sp), DIMENSION(nxl:nxr,nys:nyn,nzb_do:nzt_do), INTENT(OUT) ::  local_pf
+
+
+    IF ( .NOT. found  .AND.  biometeorology )  THEN
+       CALL bio_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do )
+       resorted = .FALSE.
+    ENDIF
+
+    IF ( .NOT. found  .AND.  bulk_cloud_model )  THEN
+       CALL bcm_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do )
+       resorted = .TRUE.
+    ENDIF
+
+    IF ( .NOT. found  .AND.  air_chemistry )  THEN
+       CALL chem_data_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do )
+       resorted = .TRUE.
+    ENDIF
+
+    IF ( .NOT. found  .AND.  gust_module_enabled )  THEN
+       CALL gust_data_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do )
+       resorted = .TRUE.
+    ENDIF
    
-   IF ( .NOT. found  .AND.  indoor_model )  THEN
-      CALL im_data_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do )
-      resorted = .TRUE.
-   ENDIF
-
-   IF ( .NOT. found  .AND.  ocean_mode )  THEN
-      CALL ocean_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do )
-      resorted = .TRUE.
-   ENDIF
-
-   IF ( .NOT. found  .AND.  plant_canopy )  THEN
-      CALL pcm_data_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do )
-      resorted = .TRUE.
-   ENDIF
-
-   IF ( .NOT. found  .AND.  radiation )  THEN
-      CALL radiation_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do )
-      resorted = .TRUE.
-   ENDIF
-
-   IF ( .NOT. found  .AND.  salsa )  THEN
-      CALL salsa_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do )
-      resorted = .TRUE.
-   ENDIF
-
-   IF ( .NOT. found  .AND.  user_module_enabled )  THEN
-      CALL user_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do )
-      resorted = .TRUE.
-   ENDIF
-
-
-END SUBROUTINE module_interface_data_output_3d
+    IF ( .NOT. found  .AND.  indoor_model )  THEN
+       CALL im_data_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do )
+       resorted = .TRUE.
+    ENDIF
+
+    IF ( .NOT. found  .AND.  ocean_mode )  THEN
+       CALL ocean_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do )
+       resorted = .TRUE.
+    ENDIF
+
+    IF ( .NOT. found  .AND.  plant_canopy )  THEN
+       CALL pcm_data_output_3d( av, variable, found, local_pf, fill_value, nzb_do, nzt_do )
+       resorted = .TRUE.
+    ENDIF
+
+    IF ( .NOT. found  .AND.  radiation )  THEN
+       CALL radiation_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do )
+       resorted = .TRUE.
+    ENDIF
+
+    IF ( .NOT. found  .AND.  salsa )  THEN
+       CALL salsa_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do )
+       resorted = .TRUE.
+    ENDIF
+
+    IF ( .NOT. found  .AND.  user_module_enabled )  THEN
+       CALL user_data_output_3d( av, variable, found, local_pf, nzb_do, nzt_do )
+       resorted = .TRUE.
+    ENDIF
+
+
+ END SUBROUTINE module_interface_data_output_3d
 
 
@@ -1083,18 +1090,18 @@
 !> Compute module-specific profile and timeseries data
 !------------------------------------------------------------------------------!
-SUBROUTINE module_interface_statistics( mode, sr, tn, dots_max )
-
-
-   CHARACTER (LEN=*), INTENT(IN) ::  mode     !< statistical analysis mode
-   INTEGER(iwp),      INTENT(IN) ::  sr       !<
-   INTEGER(iwp),      INTENT(IN) ::  tn       !<
-   INTEGER(iwp),      INTENT(IN) ::  dots_max !< maximum number of timeseries
-
-   IF ( gust_module_enabled )  CALL gust_statistics( mode, sr, tn, dots_max )
-   IF ( air_chemistry       )  CALL chem_statistics( mode, sr, tn )
-   IF ( user_module_enabled )  CALL user_statistics( mode, sr, tn )
-
-
-END SUBROUTINE module_interface_statistics
+ SUBROUTINE module_interface_statistics( mode, sr, tn, dots_max )
+
+
+    CHARACTER (LEN=*), INTENT(IN) ::  mode     !< statistical analysis mode
+    INTEGER(iwp),      INTENT(IN) ::  sr       !<
+    INTEGER(iwp),      INTENT(IN) ::  tn       !<
+    INTEGER(iwp),      INTENT(IN) ::  dots_max !< maximum number of timeseries
+
+    IF ( gust_module_enabled )  CALL gust_statistics( mode, sr, tn, dots_max )
+    IF ( air_chemistry       )  CALL chem_statistics( mode, sr, tn )
+    IF ( user_module_enabled )  CALL user_statistics( mode, sr, tn )
+
+
+ END SUBROUTINE module_interface_statistics
 
 
@@ -1104,22 +1111,21 @@
 !> Read module-specific restart data globaly shared by all MPI ranks
 !------------------------------------------------------------------------------!
-SUBROUTINE module_interface_rrd_global( variable, found )
-
-
-   CHARACTER (LEN=*), INTENT(IN)  ::  variable !< name of global variable
-   LOGICAL,           INTENT(OUT) ::  found    !< flag if variable was found
-
-   IF ( .NOT. found )  CALL bio_rrd_global( found ) ! ToDo: change interface to pass variable
-   IF ( .NOT. found )  CALL bcm_rrd_global( found ) ! ToDo: change interface to pass variable
-   IF ( .NOT. found )  CALL flight_rrd_global( found ) ! ToDo: change interface to pass variable
-   IF ( .NOT. found )  CALL gust_rrd_global( found ) ! ToDo: change interface to pass variable
-   IF ( .NOT. found )  CALL ocean_rrd_global( found ) ! ToDo: change interface to pass variable
-   IF ( .NOT. found )  CALL stg_rrd_global ( found ) ! ToDo: change interface to pass variable
-   IF ( .NOT. found )  CALL wtm_rrd_global( found ) ! ToDo: change interface to pass variable
-   IF ( .NOT. found )  CALL surface_data_output_rrd_global( found )
-   IF ( .NOT. found )  CALL user_rrd_global( found ) ! ToDo: change interface to pass variable
-
-
-END SUBROUTINE module_interface_rrd_global
+ SUBROUTINE module_interface_rrd_global( found )
+
+
+    LOGICAL,           INTENT(OUT) ::  found    !< flag if variable was found
+
+    IF ( .NOT. found )  CALL bio_rrd_global( found ) ! ToDo: change interface to pass variable
+    IF ( .NOT. found )  CALL bcm_rrd_global( found ) ! ToDo: change interface to pass variable
+    IF ( .NOT. found )  CALL flight_rrd_global( found ) ! ToDo: change interface to pass variable
+    IF ( .NOT. found )  CALL gust_rrd_global( found ) ! ToDo: change interface to pass variable
+    IF ( .NOT. found )  CALL ocean_rrd_global( found ) ! ToDo: change interface to pass variable
+    IF ( .NOT. found )  CALL stg_rrd_global ( found ) ! ToDo: change interface to pass variable
+    IF ( .NOT. found )  CALL wtm_rrd_global( found ) ! ToDo: change interface to pass variable
+    IF ( .NOT. found )  CALL surface_data_output_rrd_global( found )
+    IF ( .NOT. found )  CALL user_rrd_global( found ) ! ToDo: change interface to pass variable
+
+
+ END SUBROUTINE module_interface_rrd_global
 
 
@@ -1129,19 +1135,19 @@
 !> Write module-specific restart data globaly shared by all MPI ranks
 !------------------------------------------------------------------------------!
-SUBROUTINE module_interface_wrd_global
-
-
-   IF ( biometeorology )       CALL bio_wrd_global
-   IF ( bulk_cloud_model )     CALL bcm_wrd_global
-   IF ( virtual_flight )       CALL flight_wrd_global
-   IF ( gust_module_enabled )  CALL gust_wrd_global
-   IF ( ocean_mode )           CALL ocean_wrd_global
-   IF ( syn_turb_gen )         CALL stg_wrd_global
-   IF ( wind_turbine )         CALL wtm_wrd_global
-   IF ( surface_output )       CALL surface_data_output_wrd_global
-   IF ( user_module_enabled )  CALL user_wrd_global
-
-
-END SUBROUTINE module_interface_wrd_global
+ SUBROUTINE module_interface_wrd_global
+
+
+    IF ( biometeorology )       CALL bio_wrd_global
+    IF ( bulk_cloud_model )     CALL bcm_wrd_global
+    IF ( virtual_flight )       CALL flight_wrd_global
+    IF ( gust_module_enabled )  CALL gust_wrd_global
+    IF ( ocean_mode )           CALL ocean_wrd_global
+    IF ( syn_turb_gen )         CALL stg_wrd_global
+    IF ( wind_turbine )         CALL wtm_wrd_global
+    IF ( surface_output )       CALL surface_data_output_wrd_global
+    IF ( user_module_enabled )  CALL user_wrd_global
+
+
+ END SUBROUTINE module_interface_wrd_global
 
 
@@ -1151,123 +1157,122 @@
 !> Read module-specific restart data specific to local MPI ranks
 !------------------------------------------------------------------------------!
-SUBROUTINE module_interface_rrd_local( variable, file_index, map_index,        &
-                                       nxlf, nxlc, nxl_on_file,                &
-                                       nxrf, nxrc, nxr_on_file,                &
-                                       nynf, nync, nyn_on_file,                &
-                                       nysf, nysc, nys_on_file,                &
-                                       tmp_2d, tmp_3d, found )
-
-
-   CHARACTER (LEN=*), INTENT(IN)  ::  variable     !< name of global variable
-   INTEGER(iwp),      INTENT(IN)  ::  file_index   !<
-   INTEGER(iwp),      INTENT(IN)  ::  map_index    !<
-   INTEGER(iwp),      INTENT(IN)  ::  nxlc         !<
-   INTEGER(iwp),      INTENT(IN)  ::  nxlf         !<
-   INTEGER(iwp),      INTENT(IN)  ::  nxl_on_file  !<
-   INTEGER(iwp),      INTENT(IN)  ::  nxrc         !<
-   INTEGER(iwp),      INTENT(IN)  ::  nxrf         !<
-   INTEGER(iwp),      INTENT(IN)  ::  nxr_on_file  !<
-   INTEGER(iwp),      INTENT(IN)  ::  nync         !<
-   INTEGER(iwp),      INTENT(IN)  ::  nynf         !<
-   INTEGER(iwp),      INTENT(IN)  ::  nyn_on_file  !<
-   INTEGER(iwp),      INTENT(IN)  ::  nysc         !<
-   INTEGER(iwp),      INTENT(IN)  ::  nysf         !<
-   INTEGER(iwp),      INTENT(IN)  ::  nys_on_file  !<
-   LOGICAL,           INTENT(OUT) ::  found        !< flag if variable was found
-
-   REAL(wp), DIMENSION(nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp), INTENT(OUT) :: tmp_2d   !<
-   REAL(wp), DIMENSION(nzb:nzt+1,nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp), INTENT(OUT) :: tmp_3d   !<
-
-
-   IF ( .NOT. found ) CALL bio_rrd_local(                                      &
-                              found                                            &
-                           )
-
-   IF ( .NOT. found ) CALL bcm_rrd_local(                                      &
-                              file_index, map_index,                           &
-                              nxlf, nxlc, nxl_on_file,                         &
-                              nxrf, nxrc, nxr_on_file,                         &
-                              nynf, nync, nyn_on_file,                         &
-                              nysf, nysc, nys_on_file,                         &
-                              tmp_2d, tmp_3d, found                            &
-                           ) ! ToDo: change interface to pass variable
-
-   IF ( .NOT. found ) CALL chem_rrd_local(                                     &
-                              file_index, map_index,                           &
-                              nxlf, nxlc, nxl_on_file,                         &
-                              nxrf, nxrc, nxr_on_file,                         &
-                              nynf, nync, nyn_on_file,                         &
-                              nysf, nysc, nys_on_file,                         &
-                              tmp_3d, found                                    &
-                           ) ! ToDo: change interface to pass variable
-
-   IF ( .NOT. found ) CALL gust_rrd_local(                                     &
-                              file_index, map_index,                           &
-                              nxlf, nxlc, nxl_on_file,                         &
-                              nxrf, nxrc, nxr_on_file,                         &
-                              nynf, nync, nyn_on_file,                         &
-                              nysf, nysc, nys_on_file,                         &
-                              tmp_2d, tmp_3d, found                            &
-                           ) ! ToDo: change interface to pass variable
-
-   IF ( .NOT. found ) CALL lsm_rrd_local(                                      &
-                              file_index, map_index,                           &
-                              nxlf, nxlc, nxl_on_file,                         &
-                              nxrf, nxrc, nxr_on_file,                         &
-                              nynf, nync, nyn_on_file,                         &
-                              nysf, nysc, nys_on_file,                         &
-                              tmp_2d, found                                    &
-                           ) ! ToDo: change interface to pass variable
-
-   IF ( .NOT. found ) CALL ocean_rrd_local(                                    &
-                              file_index, map_index,                           &
-                              nxlf, nxlc, nxl_on_file,                         &
-                              nxrf, nxrc, nxr_on_file,                         &
-                              nynf, nync, nyn_on_file,                         &
-                              nysf, nysc, nys_on_file,                         &
-                              tmp_2d, tmp_3d, found                            &
-                           ) ! ToDo: change interface to pass variable
-
-   IF ( .NOT. found ) CALL radiation_rrd_local(                                &
-                              file_index, map_index,                           &
-                              nxlf, nxlc, nxl_on_file,                         &
-                              nxrf, nxrc, nxr_on_file,                         &
-                              nynf, nync, nyn_on_file,                         &
-                              nysf, nysc, nys_on_file,                         &
-                              tmp_2d, tmp_3d, found                            &
-                           ) ! ToDo: change interface to pass variable
-
-   IF ( .NOT. found ) CALL salsa_rrd_local(                                    &
-                              file_index, map_index,                           &
-                              nxlf, nxlc, nxl_on_file,                         &
-                              nxrf, nxrc, nxr_on_file,                         &
-                              nynf, nync, nyn_on_file,                         &
-                              nysf, nysc, nys_on_file,                         &
-                              tmp_3d, found                                    &
-                           ) ! ToDo: change interface to pass variable
-
-   IF ( .NOT. found ) CALL usm_rrd_local(                                      &
-                              file_index, map_index,                           &
-                              nxlf, nxlc, nxl_on_file,                         &
-                              nxrf, nxrc, nxr_on_file,                         &
-                              nynf, nync, nyn_on_file,                         &
-                              nysf, nysc, nys_on_file,                         &
-                              found                                            &
-                           ) ! ToDo: change interface to pass variable
-!
-!--Surface data do not need overlap data, so do not pass these information. 
-   IF ( .NOT. found ) CALL surface_data_output_rrd_local( found )
+ SUBROUTINE module_interface_rrd_local( file_index, map_index,                 &
+                                        nxlf, nxlc, nxl_on_file,               &
+                                        nxrf, nxrc, nxr_on_file,               &
+                                        nynf, nync, nyn_on_file,               &
+                                        nysf, nysc, nys_on_file,               &
+                                        tmp_2d, tmp_3d, found )
+
+
+    INTEGER(iwp),      INTENT(IN)  ::  file_index   !<
+    INTEGER(iwp),      INTENT(IN)  ::  map_index    !<
+    INTEGER(iwp),      INTENT(IN)  ::  nxlc         !<
+    INTEGER(iwp),      INTENT(IN)  ::  nxlf         !<
+    INTEGER(iwp),      INTENT(IN)  ::  nxl_on_file  !<
+    INTEGER(iwp),      INTENT(IN)  ::  nxrc         !<
+    INTEGER(iwp),      INTENT(IN)  ::  nxrf         !<
+    INTEGER(iwp),      INTENT(IN)  ::  nxr_on_file  !<
+    INTEGER(iwp),      INTENT(IN)  ::  nync         !<
+    INTEGER(iwp),      INTENT(IN)  ::  nynf         !<
+    INTEGER(iwp),      INTENT(IN)  ::  nyn_on_file  !<
+    INTEGER(iwp),      INTENT(IN)  ::  nysc         !<
+    INTEGER(iwp),      INTENT(IN)  ::  nysf         !<
+    INTEGER(iwp),      INTENT(IN)  ::  nys_on_file  !<
+    LOGICAL,           INTENT(OUT) ::  found        !< flag if variable was found
+
+    REAL(wp), DIMENSION(nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp), INTENT(OUT) :: tmp_2d   !<
+    REAL(wp), DIMENSION(nzb:nzt+1,nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp), INTENT(OUT) :: tmp_3d   !<
+
+
+    IF ( .NOT. found ) CALL bio_rrd_local(                                     &
+                               found                                           &
+                            )
+
+    IF ( .NOT. found ) CALL bcm_rrd_local(                                     &
+                               file_index, map_index,                          &
+                               nxlf, nxlc, nxl_on_file,                        &
+                               nxrf, nxrc, nxr_on_file,                        &
+                               nynf, nync, nyn_on_file,                        &
+                               nysf, nysc, nys_on_file,                        &
+                               tmp_2d, tmp_3d, found                           &
+                            ) ! ToDo: change interface to pass variable
+
+    IF ( .NOT. found ) CALL chem_rrd_local(                                    &
+                               file_index, map_index,                          &
+                               nxlf, nxlc, nxl_on_file,                        &
+                               nxrf, nxrc, nxr_on_file,                        &
+                               nynf, nync, nyn_on_file,                        &
+                               nysf, nysc, nys_on_file,                        &
+                               tmp_3d, found                                   &
+                            ) ! ToDo: change interface to pass variable
+
+    IF ( .NOT. found ) CALL gust_rrd_local(                                    &
+                               file_index, map_index,                          &
+                               nxlf, nxlc, nxl_on_file,                        &
+                               nxrf, nxrc, nxr_on_file,                        &
+                               nynf, nync, nyn_on_file,                        &
+                               nysf, nysc, nys_on_file,                        &
+                               tmp_2d, tmp_3d, found                           &
+                            ) ! ToDo: change interface to pass variable
+
+    IF ( .NOT. found ) CALL lsm_rrd_local(                                     &
+                               file_index, map_index,                          &
+                               nxlf, nxlc, nxl_on_file,                        &
+                               nxrf, nxrc, nxr_on_file,                        &
+                               nynf, nync, nyn_on_file,                        &
+                               nysf, nysc, nys_on_file,                        &
+                               tmp_2d, found                                   &
+                            ) ! ToDo: change interface to pass variable
+
+    IF ( .NOT. found ) CALL ocean_rrd_local(                                   &
+                               file_index, map_index,                          &
+                               nxlf, nxlc, nxl_on_file,                        &
+                               nxrf, nxrc, nxr_on_file,                        &
+                               nynf, nync, nyn_on_file,                        &
+                               nysf, nysc, nys_on_file,                        &
+                               tmp_2d, tmp_3d, found                           &
+                            ) ! ToDo: change interface to pass variable
+
+    IF ( .NOT. found ) CALL radiation_rrd_local(                               &
+                               file_index, map_index,                          &
+                               nxlf, nxlc, nxl_on_file,                        &
+                               nxrf, nxrc, nxr_on_file,                        &
+                               nynf, nync, nyn_on_file,                        &
+                               nysf, nysc, nys_on_file,                        &
+                               tmp_2d, tmp_3d, found                           &
+                            ) ! ToDo: change interface to pass variable
+
+    IF ( .NOT. found ) CALL salsa_rrd_local(                                   &
+                               file_index, map_index,                          &
+                               nxlf, nxlc, nxl_on_file,                        &
+                               nxrf, nxrc, nxr_on_file,                        &
+                               nynf, nync, nyn_on_file,                        &
+                               nysf, nysc, nys_on_file,                        &
+                               tmp_3d, found                                   &
+                            ) ! ToDo: change interface to pass variable
+
+    IF ( .NOT. found ) CALL usm_rrd_local(                                     &
+                               file_index, map_index,                          &
+                               nxlf, nxlc, nxl_on_file,                        &
+                               nxrf, nxrc, nxr_on_file,                        &
+                               nynf, nync, nyn_on_file,                        &
+                               nysf, nysc, nys_on_file,                        &
+                               found                                           &
+                            ) ! ToDo: change interface to pass variable
+!
+!-- Surface data do not need overlap data, so do not pass these information.
+    IF ( .NOT. found ) CALL surface_data_output_rrd_local( found )
                            
-   IF ( .NOT. found ) CALL user_rrd_local(                                     &
-                              file_index, map_index,                           &
-                              nxlf, nxlc, nxl_on_file,                         &
-                              nxrf, nxrc, nxr_on_file,                         &
-                              nynf, nync, nyn_on_file,                         &
-                              nysf, nysc, nys_on_file,                         &
-                              tmp_3d, found                                    &
-                           ) ! ToDo: change interface to pass variable
-
-
-END SUBROUTINE module_interface_rrd_local
+    IF ( .NOT. found ) CALL user_rrd_local(                                    &
+                               file_index, map_index,                          &
+                               nxlf, nxlc, nxl_on_file,                        &
+                               nxrf, nxrc, nxr_on_file,                        &
+                               nynf, nync, nyn_on_file,                        &
+                               nysf, nysc, nys_on_file,                        &
+                               tmp_3d, found                                   &
+                            ) ! ToDo: change interface to pass variable
+
+
+ END SUBROUTINE module_interface_rrd_local
 
 
@@ -1277,21 +1282,21 @@
 !> Write module-specific restart data specific to local MPI ranks
 !------------------------------------------------------------------------------!
-SUBROUTINE module_interface_wrd_local
-
-
-   IF ( biometeorology )       CALL bio_wrd_local
-   IF ( bulk_cloud_model )     CALL bcm_wrd_local
-   IF ( air_chemistry )        CALL chem_wrd_local
-   IF ( gust_module_enabled )  CALL gust_wrd_local
-   IF ( land_surface )         CALL lsm_wrd_local
-   IF ( ocean_mode )           CALL ocean_wrd_local
-   IF ( radiation )            CALL radiation_wrd_local
-   IF ( salsa )                CALL salsa_wrd_local
-   IF ( urban_surface )        CALL usm_wrd_local
-   IF ( surface_output )       CALL surface_data_output_wrd_local
-   IF ( user_module_enabled )  CALL user_wrd_local
-
-
-END SUBROUTINE module_interface_wrd_local
+ SUBROUTINE module_interface_wrd_local
+
+
+    IF ( biometeorology )       CALL bio_wrd_local
+    IF ( bulk_cloud_model )     CALL bcm_wrd_local
+    IF ( air_chemistry )        CALL chem_wrd_local
+    IF ( gust_module_enabled )  CALL gust_wrd_local
+    IF ( land_surface )         CALL lsm_wrd_local
+    IF ( ocean_mode )           CALL ocean_wrd_local
+    IF ( radiation )            CALL radiation_wrd_local
+    IF ( salsa )                CALL salsa_wrd_local
+    IF ( urban_surface )        CALL usm_wrd_local
+    IF ( surface_output )       CALL surface_data_output_wrd_local
+    IF ( user_module_enabled )  CALL user_wrd_local
+
+
+ END SUBROUTINE module_interface_wrd_local
 
 
@@ -1301,12 +1306,13 @@
 !> Perform module-specific last actions before the program terminates
 !------------------------------------------------------------------------------!
-SUBROUTINE module_interface_last_actions
-
-   IF ( virtual_measurement )  CALL vm_last_actions
-   IF ( user_module_enabled )  CALL user_last_actions
-
-
-END SUBROUTINE module_interface_last_actions
-
-
-END MODULE module_interface
+ SUBROUTINE module_interface_last_actions
+
+
+    IF ( virtual_measurement )  CALL vm_last_actions
+    IF ( user_module_enabled )  CALL user_last_actions
+
+
+ END SUBROUTINE module_interface_last_actions
+
+
+ END MODULE module_interface
Index: palm/trunk/SOURCE/multi_agent_system_mod.f90
===================================================================
--- palm/trunk/SOURCE/multi_agent_system_mod.f90	(revision 3763)
+++ palm/trunk/SOURCE/multi_agent_system_mod.f90	(revision 3766)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! save attribute added to local targets to avoid outlive pointer target warning
+! 
+! 3665 2019-01-10 08:28:24Z raasch
 ! unused variables removed
 ! 
@@ -1239,7 +1242,8 @@
 
        INTEGER(iwp), DIMENSION(0:numprocs-1) ::  noa_arr !< number of agents on each PE
-
-       TYPE(agent_type), DIMENSION(:), ALLOCATABLE, TARGET ::  trf_agents !< all agents on current PE
-       TYPE(agent_type), DIMENSION(:), ALLOCATABLE, TARGET ::  out_agents !< all agents in entire domain
+!
+!--    SAVE attribute required to avoid compiler warning about pointer outlive the pointer target
+       TYPE(agent_type), DIMENSION(:), ALLOCATABLE, TARGET, SAVE ::  trf_agents !< all agents on current PE
+       TYPE(agent_type), DIMENSION(:), ALLOCATABLE, TARGET, SAVE ::  out_agents !< all agents in entire domain
 
        LOGICAL, INTENT (INOUT) :: ftest
@@ -1445,5 +1449,5 @@
 
 #endif
-          NULLIFY( agents )
+
 #if defined( __parallel )
           IF ( ALLOCATED( out_agents ) ) DEALLOCATE( out_agents )
Index: palm/trunk/SOURCE/netcdf_interface_mod.f90
===================================================================
--- palm/trunk/SOURCE/netcdf_interface_mod.f90	(revision 3763)
+++ palm/trunk/SOURCE/netcdf_interface_mod.f90	(revision 3766)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! bugfix in im_define_netcdf_grid argument list
+! 
+! 3745 2019-02-15 18:57:56Z suehring
 ! Add indoor model
 ! 
@@ -1922,5 +1925,5 @@
                    IF ( .NOT. found .AND. indoor_model ) THEN 
                       CALL im_define_netcdf_grid( do3d(av,i), found,           &
-                                                  grid_x, grid_x, grid_z )
+                                                  grid_x, grid_y, grid_z )
                    ENDIF
 
Index: palm/trunk/SOURCE/read_restart_data_mod.f90
===================================================================
--- palm/trunk/SOURCE/read_restart_data_mod.f90	(revision 3763)
+++ palm/trunk/SOURCE/read_restart_data_mod.f90	(revision 3766)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! first argument removed from module_interface_rrd_*
+! 
+! 3668 2019-01-14 12:49:24Z maronga
 ! Removed most_method and increased binary version
 ! 
@@ -775,5 +778,5 @@
 !
 !--             Read global variables from of other modules
-                CALL module_interface_rrd_global( restart_string(1:length), found )
+                CALL module_interface_rrd_global( found )
 
                 IF ( .NOT. found )  THEN
@@ -1797,5 +1800,5 @@
 !--                Read restart data of other modules
                    IF ( .NOT. found ) CALL module_interface_rrd_local(         &
-                                           restart_string(1:length), i, k,     &
+                                           i, k,                               &
                                            nxlf, nxlc, nxl_on_file,            &
                                            nxrf, nxrc, nxr_on_file,            &
Index: palm/trunk/SOURCE/surface_data_output_mod.f90
===================================================================
--- palm/trunk/SOURCE/surface_data_output_mod.f90	(revision 3763)
+++ palm/trunk/SOURCE/surface_data_output_mod.f90	(revision 3766)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! bugfix in surface_data_output_rrd_local (variable k removed)
+! 
+! 3762 2019-02-25 16:54:16Z suehring
 ! Remove unused variables and add preprocessor directives for variables that 
 ! are used only when netcdf4 is defined 
@@ -4509,7 +4512,6 @@
        IMPLICIT NONE
 
-       INTEGER(iwp)       ::  k                 !< running index over previous input files covering current local domain
-
        LOGICAL, INTENT(OUT)  ::  found
+
 !
 !--    Here the reading of user-defined restart data follows:
@@ -4520,5 +4522,5 @@
 
           CASE ( 'surfaces%var_av' )
-             IF ( k == 1 )  READ ( 13 )  surfaces%var_av
+             READ ( 13 )  surfaces%var_av
 
           CASE DEFAULT
Index: palm/trunk/SOURCE/time_integration_spinup.f90
===================================================================
--- palm/trunk/SOURCE/time_integration_spinup.f90	(revision 3763)
+++ palm/trunk/SOURCE/time_integration_spinup.f90	(revision 3766)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! unused variable removed
+! 
+! 3719 2019-02-06 13:10:18Z kanani
 ! Removed log_point(19,54,74,50,75), since they count together with same log
 ! points in time_integration, impossible to separate the contributions.
@@ -127,5 +130,5 @@
 
     USE cpulog,                                                                &
-        ONLY:  cpu_log, log_point, log_point_s
+        ONLY:  cpu_log, log_point_s
 
     USE date_and_time_mod,                                                     &
Index: palm/trunk/SOURCE/user_init_land_surface.f90
===================================================================
--- palm/trunk/SOURCE/user_init_land_surface.f90	(revision 3763)
+++ palm/trunk/SOURCE/user_init_land_surface.f90	(revision 3766)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! unused variables commented out
+! 
+! 3700 2019-01-26 17:03:42Z knoop
 ! Corrected "Former revisions" section
 ! 
@@ -66,7 +69,7 @@
     IMPLICIT NONE
 
-    INTEGER(iwp) ::  i  !< grid index
-    INTEGER(iwp) ::  j  !< grid index
-    INTEGER(iwp) ::  m  !< running index on 1D wall-type grid
+!    INTEGER(iwp) ::  i  !< grid index
+!    INTEGER(iwp) ::  j  !< grid index
+!    INTEGER(iwp) ::  m  !< running index on 1D wall-type grid
 
 !
Index: palm/trunk/SOURCE/virtual_measurement_mod.f90
===================================================================
--- palm/trunk/SOURCE/virtual_measurement_mod.f90	(revision 3763)
+++ palm/trunk/SOURCE/virtual_measurement_mod.f90	(revision 3766)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! unused variables removed
+! 
+! 3718 2019-02-06 11:08:28Z suehring
 ! Adjust variable name connections between UC2 and chemistry variables
 ! 
@@ -414,5 +417,4 @@
     
     CHARACTER(LEN=5)    ::  dum                !< dummy string indicate station id
-    CHARACTER(LEN=5)    ::  dummy_read                !< dummy string indicate station id
     CHARACTER(LEN=10), DIMENSION(50) ::  measured_variables_file = '' !< array with all measured variables read from NetCDF
     CHARACTER(LEN=10), DIMENSION(50) ::  measured_variables      = '' !< dummy array with all measured variables that are allowed   
@@ -443,5 +445,5 @@
     INTEGER(iwp), DIMENSION(:,:,:), ALLOCATABLE ::  meas_flag !< mask array indicating measurement positions
     
-    LOGICAL ::  chem_include !< flag indicating that chemical species is considered in modelled mechanism
+!    LOGICAL ::  chem_include !< flag indicating that chemical species is considered in modelled mechanism
     LOGICAL ::  on_pe        !< flag indicating that the respective measurement coordinate is on subdomain
     
@@ -1045,6 +1047,4 @@
          
      INTEGER(iwp) ::  i         !< running index over IO blocks    
-     INTEGER(iwp) ::  l         !< running index over all stations
-     INTEGER(iwp) ::  n         !< running index over all measured variables at a station
  
      DO  i = 0, io_blocks-1
