Index: /palm/trunk/SOURCE/advec_s_bc.f90
===================================================================
--- /palm/trunk/SOURCE/advec_s_bc.f90	(revision 3760)
+++ /palm/trunk/SOURCE/advec_s_bc.f90	(revision 3761)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! unused variables removed
+! 
+! 3655 2019-01-07 16:51:22Z knoop
 ! nopointer option removed
 ! 
@@ -155,5 +158,5 @@
 
        USE indices,                                                               &
-           ONLY:  nx, nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzt
+           ONLY:  nx, nxl, nxr, nyn, nys, nzb, nzt
 
        USE kinds
Index: /palm/trunk/SOURCE/check_parameters.f90
===================================================================
--- /palm/trunk/SOURCE/check_parameters.f90	(revision 3760)
+++ /palm/trunk/SOURCE/check_parameters.f90	(revision 3761)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! unused variables removed
+! 
+! 3735 2019-02-12 09:52:40Z dom_dwd_user
 ! Passing variable j (averaged output?) to 
 ! module_interface.f90:chem_check_data_output.
@@ -843,10 +846,8 @@
     INTEGER(iwp) ::  netcdf_data_format_save         !< initial value of netcdf_data_format
     INTEGER(iwp) ::  position                        !< index position of string
-    INTEGER(iwp) ::  lsp                             !< running index for chem spcs.
 
     LOGICAL     ::  found                            !< flag, true if output variable is already marked for averaging
 
     REAL(wp)    ::  dt_spinup_max                    !< maximum spinup timestep in nested domains
-    REAL(wp)    ::  dum                              !< dummy variable
     REAL(wp)    ::  gradient                         !< local gradient
     REAL(wp)    ::  remote = 0.0_wp                  !< MPI id of remote processor
Index: /palm/trunk/SOURCE/diffusion_s.f90
===================================================================
--- /palm/trunk/SOURCE/diffusion_s.f90	(revision 3760)
+++ /palm/trunk/SOURCE/diffusion_s.f90	(revision 3761)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! unused variables removed
+! 
+! 3655 2019-01-07 16:51:22Z knoop
 ! nopointer option removed
 ! 
@@ -151,6 +154,5 @@
        
        USE indices,                                                            &
-           ONLY:  nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb,             &
-                  nzt, wall_flags_0
+           ONLY:  nxl, nxr, nyn, nys, nzb, nzt, wall_flags_0
        
        USE kinds
@@ -481,5 +483,5 @@
        
        USE indices,                                                            &
-           ONLY:  nxlg, nxrg, nyng, nysg, nzb, nzt, wall_flags_0
+           ONLY:  nzb, nzt, wall_flags_0
        
        USE kinds
Index: /palm/trunk/SOURCE/disturb_heatflux.f90
===================================================================
--- /palm/trunk/SOURCE/disturb_heatflux.f90	(revision 3760)
+++ /palm/trunk/SOURCE/disturb_heatflux.f90	(revision 3761)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! unsed variables removed
+! 
+! 3719 2019-02-06 13:10:18Z kanani
 ! Moved log_points out of subroutine into time_integration for better overview.
 ! 
@@ -86,7 +89,4 @@
     USE control_parameters,                                                    &
         ONLY:  iran, surface_heatflux, random_generator, wall_heatflux
-        
-    USE cpulog,                                                                &
-        ONLY:  cpu_log, log_point
         
     USE kinds
Index: /palm/trunk/SOURCE/exchange_horiz.f90
===================================================================
--- /palm/trunk/SOURCE/exchange_horiz.f90	(revision 3760)
+++ /palm/trunk/SOURCE/exchange_horiz.f90	(revision 3761)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! OpenACC directives re-formatted
+! 
+! 3657 2019-01-07 20:14:18Z knoop
 ! OpenACC port for SPEC
 ! 
@@ -104,6 +107,5 @@
 
     USE control_parameters,                                                    &
-        ONLY:  bc_lr_cyc, bc_ns_cyc, grid_level, mg_switch_to_pe0,             &
-               synchronous_exchange
+        ONLY:  bc_lr_cyc, bc_ns_cyc, grid_level, mg_switch_to_pe0, synchronous_exchange
                 
     USE cpulog,                                                                &
@@ -120,7 +122,8 @@
 
 
-#ifdef _OPENACC
+#if defined( _OPENACC )
     INTEGER(iwp) ::  i           !<
 #endif
+
     INTEGER(iwp) ::  nbgp_local  !<
     
@@ -131,5 +134,5 @@
     CALL cpu_log( log_point_s(2), 'exchange_horiz', 'start' )
 
-#ifdef _OPENACC
+#if defined( _OPENACC )
     !$ACC UPDATE IF_PRESENT ASYNC(1) &
     !$ACC HOST(ar(:,:,nxr-nbgp_local+1:nxr)) &
@@ -308,5 +311,5 @@
 #endif
 
-#ifdef _OPENACC
+#if defined( _OPENACC )
     DO i = nxl-nbgp_local, nxr+nbgp_local
        !$ACC UPDATE IF_PRESENT ASYNC(2) &
Index: /palm/trunk/SOURCE/exchange_horiz_2d.f90
===================================================================
--- /palm/trunk/SOURCE/exchange_horiz_2d.f90	(revision 3760)
+++ /palm/trunk/SOURCE/exchange_horiz_2d.f90	(revision 3761)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! variables moved to serial branch to avoid compiler warnings about unused variables
+! 
+! 3655 2019-01-07 16:51:22Z knoop
 ! - New routine for exchange of 8-bit integer arrays
 ! - Set Neumann conditions also at radiation boundary
@@ -93,5 +96,5 @@
     USE control_parameters,                                                    &
         ONLY :  bc_dirichlet_l, bc_dirichlet_n, bc_dirichlet_r,                &
-                bc_dirichlet_s, bc_lr_cyc, bc_ns_cyc, bc_radiation_l,          &
+                bc_dirichlet_s, bc_radiation_l,                                &
                 bc_radiation_n, bc_radiation_r, bc_radiation_s 
                 
@@ -108,4 +111,9 @@
     USE pmc_interface,                                                         &
         ONLY : nesting_mode
+
+#if ! defined( __parallel )
+    USE control_parameters,                                                    &
+        ONLY:  bc_lr_cyc, bc_ns_cyc
+#endif
 
 
@@ -230,5 +238,5 @@
                bc_dirichlet_s, bc_radiation_l, bc_radiation_n, bc_radiation_r, &
                bc_radiation_s, bc_lr_cyc, bc_ns_cyc, bc_radiation_l,           &
-               bc_radiation_n, bc_radiation_r, bc_radiation_s, grid_level
+               bc_radiation_n, bc_radiation_r, bc_radiation_s
         
     USE cpulog,                                                                &
Index: /palm/trunk/SOURCE/header.f90
===================================================================
--- /palm/trunk/SOURCE/header.f90	(revision 3760)
+++ /palm/trunk/SOURCE/header.f90	(revision 3761)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! unused variable removed
+! 
+! 3655 2019-01-07 16:51:22Z knoop
 ! Implementation of the PALM module interface
 ! 
@@ -421,5 +424,5 @@
 
     USE basic_constants_and_equations_mod,                                     &
-        ONLY:  g, kappa, l_v
+        ONLY:  g, kappa
 
     USE bulk_cloud_model_mod,                                                  &
Index: /palm/trunk/SOURCE/init_3d_model.f90
===================================================================
--- /palm/trunk/SOURCE/init_3d_model.f90	(revision 3760)
+++ /palm/trunk/SOURCE/init_3d_model.f90	(revision 3761)
@@ -628,5 +628,5 @@
 
     USE netcdf_data_input_mod,                                                 &
-        ONLY:  chem_emis, chem_emis_att, init_3d,                              &
+        ONLY:  init_3d,                              &
                netcdf_data_input_init_3d, netcdf_data_input_interpolate
 
@@ -643,7 +643,4 @@
         ONLY:  nested_run
 #endif
-
-    USE radiation_model_mod,                                                   &
-        ONLY:  radiation, radiation_scheme
 
     USE random_function_mod 
@@ -670,5 +667,5 @@
     USE surface_mod,                                                           &
         ONLY :  init_surface_arrays, init_surfaces, surf_def_h, surf_lsm_h,    &
-                surf_usm_h, get_topography_top_index_ji, vertical_surfaces_exist
+                surf_usm_h, get_topography_top_index_ji
 
     USE surface_data_output_mod,                                               &
Index: /palm/trunk/SOURCE/init_grid.f90
===================================================================
--- /palm/trunk/SOURCE/init_grid.f90	(revision 3760)
+++ /palm/trunk/SOURCE/init_grid.f90	(revision 3761)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! unused variables removed
+! 
+! 3661 2019-01-08 18:22:50Z suehring
 ! Remove setting of nzb_max to nzt at non-cyclic boundary PEs, instead, 
 ! order degradation of advection scheme is handeled directly in advec_ws
@@ -361,7 +364,5 @@
         
     USE control_parameters,                                                    &
-        ONLY:  bc_dirichlet_l, bc_dirichlet_n, bc_dirichlet_r,                 &
-               bc_dirichlet_s, bc_lr_cyc, bc_ns_cyc, bc_radiation_l,           &
-               bc_radiation_n, bc_radiation_r, bc_radiation_s,                 &
+        ONLY:  bc_lr_cyc, bc_ns_cyc,                                           &
                constant_flux_layer, dz, dz_max, dz_stretch_factor,             &
                dz_stretch_factor_array, dz_stretch_level, dz_stretch_level_end,&
Index: /palm/trunk/SOURCE/init_pegrid.f90
===================================================================
--- /palm/trunk/SOURCE/init_pegrid.f90	(revision 3760)
+++ /palm/trunk/SOURCE/init_pegrid.f90	(revision 3761)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! unused variable removed
+! 
+! 3655 2019-01-07 16:51:22Z knoop
 ! variables documented
 ! 
@@ -258,5 +261,5 @@
                bc_radiation_s, coupling_mode, coupling_topology, gathered_size,&
                grid_level, grid_level_count, maximum_grid_level,               &
-               message_string, mg_switch_to_pe0_level, momentum_advec, neutral,&
+               message_string, mg_switch_to_pe0_level, momentum_advec,         &
                psolver, outflow_source_plane, recycling_width, scalar_advec,   &
                subdomain_size, turbulent_outflow, y_shift
Index: /palm/trunk/SOURCE/palm.f90
===================================================================
--- /palm/trunk/SOURCE/palm.f90	(revision 3760)
+++ /palm/trunk/SOURCE/palm.f90	(revision 3761)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! unused variable removed
+! 
+! 3719 2019-02-06 13:10:18Z kanani
 ! Included cpu measurement for wall/soil spinup
 ! 
@@ -281,5 +284,5 @@
 
     USE control_parameters,                                                    &
-        ONLY:  air_chemistry, constant_diffusion, child_domain,                &
+        ONLY:  constant_diffusion, child_domain,                               &
                coupling_char, do2d_at_begin, do3d_at_begin, humidity,          &
                initializing_actions, io_blocks, io_group, message_string,      &
Index: /palm/trunk/SOURCE/plant_canopy_model_mod.f90
===================================================================
--- /palm/trunk/SOURCE/plant_canopy_model_mod.f90	(revision 3760)
+++ /palm/trunk/SOURCE/plant_canopy_model_mod.f90	(revision 3761)
@@ -27,4 +27,7 @@
 ! -----------------
 ! $Id$
+! unsed variables removed
+! 
+! 3745 2019-02-15 18:57:56Z suehring
 ! Bugfix in transpiration, floating invalid when temperature 
 ! becomes > 40 degrees
@@ -905,5 +908,4 @@
        INTEGER(iwp) ::  k   !< running index
        INTEGER(iwp) ::  m   !< running index
-       INTEGER(iwp) ::  pch_index_l
 
        REAL(wp) ::  int_bpdf        !< vertical integral for lad-profile construction
Index: /palm/trunk/SOURCE/pmc_child_mod.f90
===================================================================
--- /palm/trunk/SOURCE/pmc_child_mod.f90	(revision 3760)
+++ /palm/trunk/SOURCE/pmc_child_mod.f90	(revision 3761)
@@ -26,4 +26,7 @@
 ! -----------------
 ! $Id$
+! statemnet added to avoid compiler warning
+! 
+! 3655 2019-01-07 16:51:22Z knoop
 ! explicit kind settings
 ! 
@@ -291,4 +294,5 @@
 !
 !-- Local variables
+    INTEGER ::  idum  !<
     INTEGER ::  mype  !<
     TYPE(dA_namedef) ::  myname  !<
@@ -303,4 +307,8 @@
 
     CALL pmc_bcast( myname%couple_index, mype, comm=m_to_parent_comm )
+
+!
+!-- Next statement is just to avoid compiler warnings about unused variables
+    IF ( PRESENT( lastentry ) )  idum = 1
 
  END SUBROUTINE pmc_set_dataarray_name_lastentry
Index: /palm/trunk/SOURCE/prognostic_equations.f90
===================================================================
--- /palm/trunk/SOURCE/prognostic_equations.f90	(revision 3760)
+++ /palm/trunk/SOURCE/prognostic_equations.f90	(revision 3761)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! unused variable removed
+! 
+! 3719 2019-02-06 13:10:18Z kanani
 ! Cleaned up chemistry cpu measurements
 ! 
@@ -496,7 +499,6 @@
 
     LOGICAL      ::  loop_start          !<
-    INTEGER(iwp) ::  n
-    INTEGER(iwp) :: lsp
-    INTEGER(iwp) :: lsp_usr              !< lsp running index for chem spcs
+    INTEGER(iwp) ::  lsp
+    INTEGER(iwp) ::  lsp_usr             !< lsp running index for chem spcs
 
 
Index: /palm/trunk/SOURCE/set_slicer_attributes_dvrp.f90
===================================================================
--- /palm/trunk/SOURCE/set_slicer_attributes_dvrp.f90	(revision 3760)
+++ /palm/trunk/SOURCE/set_slicer_attributes_dvrp.f90	(revision 3761)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! statements added to avoid compiler warnings about unused variables
+! 
+! 3655 2019-01-07 16:51:22Z knoop
 ! Corrected "Former revisions" section
 ! 
@@ -105,4 +108,11 @@
     dvrp_colortable_entries = 100
 
+#else
+!
+!-- These statements are just to avoid compiler warnings about unused variables
+    INTEGER ::  n_slicer  !<
+
+    IF ( n_slicer == 0 )  RETURN
+
 #endif
 
Index: /palm/trunk/SOURCE/singleton_mod.f90
===================================================================
--- /palm/trunk/SOURCE/singleton_mod.f90	(revision 3760)
+++ /palm/trunk/SOURCE/singleton_mod.f90	(revision 3761)
@@ -8,4 +8,7 @@
 ! -----------------
 ! $Id$
+! statement added to prevent compiler warning about unused variables
+! 
+! 2001 2016-08-20 18:41:22Z knoop
 !
 ! 2000 2016-08-20 18:09:15Z knoop
@@ -210,4 +213,5 @@
     COMPLEX(wp), DIMENSION(SIZE(array, 1)):: ft
 
+    INTEGER(iwp)::  idum
     INTEGER(iwp)::  ishape(1)
 
@@ -219,4 +223,7 @@
     ishape = SHAPE( array )
     CALL fftn(ft, ishape, inv = inv,  stat = stat)
+!
+!-- Next statement to prevent compiler warning about unused variable
+    IF ( PRESENT( dim ) )  idum = 1
 
  END FUNCTION fft1d
Index: /palm/trunk/SOURCE/sum_up_3d_data.f90
===================================================================
--- /palm/trunk/SOURCE/sum_up_3d_data.f90	(revision 3760)
+++ /palm/trunk/SOURCE/sum_up_3d_data.f90	(revision 3761)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! unused variables removed
+! 
+! 3655 2019-01-07 16:51:22Z knoop
 ! Implementation of the PALM module interface
 ! 
@@ -249,6 +252,6 @@
 
     USE arrays_3d,                                                             &
-        ONLY:  dzw, d_exner, e, heatflux_output_conversion, nc, nr, p, prr,    &
-               pt, q, qc, ql, ql_c, ql_v, qr, s, u, v, vpt, w,                 &
+        ONLY:  dzw, d_exner, e, heatflux_output_conversion, p,    &
+               pt, q, ql, ql_c, ql_v, s, u, v, vpt, w,                 &
                waterflux_output_conversion
 
Index: /palm/trunk/SOURCE/surface_mod.f90
===================================================================
--- /palm/trunk/SOURCE/surface_mod.f90	(revision 3760)
+++ /palm/trunk/SOURCE/surface_mod.f90	(revision 3761)
@@ -26,4 +26,8 @@
 ! -----------------
 ! $Id$
+! OpenACC directives added to avoid compiler warnings about unused variables,
+! unused variable removed
+! 
+! 3745 2019-02-15 18:57:56Z suehring
 ! +waste_heat
 ! 
@@ -617,12 +621,4 @@
     END INTERFACE init_surface_arrays
 
-    INTERFACE enter_surface_arrays
-       MODULE PROCEDURE enter_surface_arrays
-    END INTERFACE
-
-    INTERFACE exit_surface_arrays
-       MODULE PROCEDURE exit_surface_arrays
-    END INTERFACE
-
     INTERFACE surface_rrd_local
        MODULE PROCEDURE surface_rrd_local
@@ -642,17 +638,29 @@
     END INTERFACE surface_restore_elements
 
+#if defined( _OPENACC )
+    INTERFACE enter_surface_arrays
+       MODULE PROCEDURE enter_surface_arrays
+    END INTERFACE
+
+    INTERFACE exit_surface_arrays
+       MODULE PROCEDURE exit_surface_arrays
+    END INTERFACE
+#endif
+
 !
 !-- Public variables
-    PUBLIC bc_h, ind_pav_green, ind_veg_wall, ind_wat_win, ns_h_on_file,       &
-           ns_v_on_file, surf_def_h, surf_def_v, surf_lsm_h, surf_lsm_v,       &
-           surf_usm_h, surf_usm_v, surf_type, vertical_surfaces_exist,         &
-           surf_bulk_cloud_model, surf_microphysics_morrison, surf_microphysics_seifert
+    PUBLIC bc_h, ind_pav_green, ind_veg_wall, ind_wat_win, ns_h_on_file, ns_v_on_file, surf_def_h, &
+           surf_def_v, surf_lsm_h, surf_lsm_v, surf_usm_h, surf_usm_v, surf_type,                  &
+           vertical_surfaces_exist, surf_bulk_cloud_model, surf_microphysics_morrison,             &
+           surf_microphysics_seifert
 !
 !-- Public subroutines and functions
-    PUBLIC get_topography_top_index, get_topography_top_index_ji, init_bc,     &
-           init_surfaces, init_surface_arrays, enter_surface_arrays,           &
-           exit_surface_arrays, surface_rrd_local, surface_restore_elements,   &
-           surface_wrd_local, surface_last_actions
-
+    PUBLIC get_topography_top_index, get_topography_top_index_ji, init_bc, init_surfaces,          &
+           init_surface_arrays, surface_rrd_local, surface_restore_elements, surface_wrd_local,    &
+           surface_last_actions
+
+#if defined( _OPENACC )
+    PUBLIC enter_surface_arrays, exit_surface_arrays
+#endif
 
  CONTAINS
@@ -1109,4 +1117,5 @@
 !> Enter horizontal and vertical surfaces.
 !------------------------------------------------------------------------------!
+#if defined( _OPENACC )
     SUBROUTINE enter_surface_arrays
 
@@ -1146,5 +1155,5 @@
 
     END SUBROUTINE enter_surface_arrays
-
+#endif
 
 !------------------------------------------------------------------------------!
@@ -1153,4 +1162,5 @@
 !> Exit horizontal and vertical surfaces.
 !------------------------------------------------------------------------------!
+#if defined( _OPENACC )
     SUBROUTINE exit_surface_arrays
 
@@ -1190,5 +1200,5 @@
 
     END SUBROUTINE exit_surface_arrays
-
+#endif
 
 !------------------------------------------------------------------------------!
@@ -1437,4 +1447,5 @@
 !> except for top fluxes.
 !------------------------------------------------------------------------------!
+#if defined( _OPENACC )
     SUBROUTINE exit_surface_attributes_h( surfaces )
 
@@ -1470,5 +1481,5 @@
    
     END SUBROUTINE exit_surface_attributes_h
-
+#endif
 
 !------------------------------------------------------------------------------!
@@ -1478,4 +1489,5 @@
 !> except for top fluxes.
 !------------------------------------------------------------------------------!
+#if defined( _OPENACC )
     SUBROUTINE enter_surface_attributes_h( surfaces )
 
@@ -1511,5 +1523,5 @@
 
     END SUBROUTINE enter_surface_attributes_h
-
+#endif
 
 !------------------------------------------------------------------------------!
@@ -1655,4 +1667,5 @@
 !> Exit memory for model-top fluxes.
 !------------------------------------------------------------------------------!
+#if defined( _OPENACC )
     SUBROUTINE exit_surface_attributes_h_top( surfaces )
 
@@ -1678,5 +1691,5 @@
    
     END SUBROUTINE exit_surface_attributes_h_top
-
+#endif
 
 !------------------------------------------------------------------------------!
@@ -1685,4 +1698,5 @@
 !> Enter memory for model-top fluxes.
 !------------------------------------------------------------------------------!
+#if defined( _OPENACC )
     SUBROUTINE enter_surface_attributes_h_top( surfaces )
 
@@ -1708,5 +1722,5 @@
 
     END SUBROUTINE enter_surface_attributes_h_top
-
+#endif
 
 !------------------------------------------------------------------------------!
@@ -1958,4 +1972,5 @@
 !> Exit memory for vertical surface types. 
 !------------------------------------------------------------------------------!
+#if defined( _OPENACC )
     SUBROUTINE exit_surface_attributes_v( surfaces )
 
@@ -1982,5 +1997,5 @@
 
     END SUBROUTINE exit_surface_attributes_v
-
+#endif
 
 !------------------------------------------------------------------------------!
@@ -1989,4 +2004,5 @@
 !> Enter memory for vertical surface types. 
 !------------------------------------------------------------------------------!
+#if defined( _OPENACC )
     SUBROUTINE enter_surface_attributes_v( surfaces )
    
@@ -2013,5 +2029,5 @@
    
     END SUBROUTINE enter_surface_attributes_v
-
+#endif
 
 !------------------------------------------------------------------------------!
@@ -2773,5 +2789,4 @@
              INTEGER(iwp)  ::  j               !< running index x-direction
              INTEGER(iwp)  ::  k               !< running index x-direction
-             INTEGER(iwp)  ::  l               !< index variable for the surface type, indicating the facing 
              INTEGER(iwp)  ::  num_v           !< current number of surface element
              INTEGER(iwp)  ::  num_v_kji       !< current number of surface element at (j,i)
Index: /palm/trunk/SOURCE/swap_timelevel.f90
===================================================================
--- /palm/trunk/SOURCE/swap_timelevel.f90	(revision 3760)
+++ /palm/trunk/SOURCE/swap_timelevel.f90	(revision 3761)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! unused variables removed
+! 
+! 3655 2019-01-07 16:51:22Z knoop
 ! Implementation of the PALM module interface
 ! 
@@ -148,25 +151,23 @@
  
 
-    USE arrays_3d,                                                             &
-        ONLY:  nc, nc_1, nc_2, nc_p, nr, nr_1, nr_2, nr_p, pt, pt_1, pt_2,     &
-               pt_p, q, q_1, q_2, q_p, qc, qc_1, qc_2, qc_p, qr, qr_1, qr_2,   &
-               qr_p, s, s_1, s_2, s_p, sa, sa_1, sa_2, sa_p, u, u_1, u_2, u_p, &
-               v, v_1, v_2, v_p, w, w_1, w_2, w_p
-
-    USE cpulog,                                                                &
+    USE arrays_3d,                                                                                 &
+        ONLY:  pt, pt_1, pt_2, pt_p, q, q_1, q_2, q_p, s, s_1, s_2, s_p, u, u_1, u_2, u_p, v, v_1, &
+               v_2, v_p, w, w_1, w_2, w_p
+
+    USE cpulog,                                                                                    &
         ONLY: cpu_log, log_point
 
-    USE control_parameters,                                                    &
+    USE control_parameters,                                                                        &
         ONLY:  humidity, neutral, passive_scalar, timestep_count
 
     USE kinds
 
-    USE module_interface,                                                      &
+    USE module_interface,                                                                          &
         ONLY:  module_interface_swap_timelevel
 
-    USE pmc_interface,                                                         &
+    USE pmc_interface,                                                                             &
         ONLY: nested_run, pmci_set_swaplevel
 
-    USE turbulence_closure_mod,                                                &
+    USE turbulence_closure_mod,                                                                    &
         ONLY:  tcm_swap_timelevel
 
Index: /palm/trunk/SOURCE/time_integration.f90
===================================================================
--- /palm/trunk/SOURCE/time_integration.f90	(revision 3760)
+++ /palm/trunk/SOURCE/time_integration.f90	(revision 3761)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! module section re-formatted and openacc required variables moved to separate section,
+! re-formatting to 100 char line width
+! 
+! 3745 2019-02-15 18:57:56Z suehring
 ! Call indoor model after first timestep
 ! 
@@ -456,94 +460,74 @@
  
 
-    USE advec_ws,                                                              &
+    USE advec_ws,                                                                                  &
         ONLY:  ws_statistics
 
-    USE arrays_3d,                                                             &
-        ONLY:  d, diss, diss_p, ddzu, dd2zu, ddzw, drho_air, drho_air_zw, dzu, &
-               dzw, e, e_p, kh, km, nc, nc_p, nr, nr_p, p, prho, pt, pt_p,     &
-               pt_init, ptdf_x, ptdf_y, q_init, q, qc, qc_p, ql, ql_c, ql_v,   &
-               ql_vp, qr, qr_p, q_p, rdf, rdf_sc, ref_state, rho_air,          &
-               rho_air_zw, rho_ocean, s, s_p, sa_p, te_m, tend, tpt_m, tu_m,   &
-               tv_m, tw_m, u, ug, u_init, u_p, u_stokes_zu, v, vg, v_init, vpt,&
-               v_p, v_stokes_zu, w, w_p, zu, heatflux_output_conversion,       &
-               momentumflux_output_conversion
-
-    USE biometeorology_mod,                                                    &
-        ONLY:  bio_calculate_thermal_index_maps,                               &
-               thermal_comfort, uvem_calc_exposure, uv_exposure
-
-    USE bulk_cloud_model_mod,                                                  &
-        ONLY: bulk_cloud_model, calc_liquid_water_content,                     &
-              collision_turbulence, microphysics_morrison, microphysics_seifert
-
-    USE calc_mean_profile_mod,                                                 &
+    USE arrays_3d,                                                                                 &
+        ONLY:  diss, diss_p, dzu, e, e_p, nc, nc_p, nr, nr_p, prho, pt, pt_p, pt_init, q_init, q,  &
+               qc, qc_p, ql, ql_c, ql_v, ql_vp, qr, qr_p, q_p, ref_state, rho_ocean, s, s_p, sa_p, &
+               tend, u, u_p, v, vpt, v_p, w, w_p
+
+    USE biometeorology_mod,                                                                        &
+        ONLY:  bio_calculate_thermal_index_maps, thermal_comfort, uvem_calc_exposure, uv_exposure
+
+    USE bulk_cloud_model_mod,                                                                      &
+        ONLY: bulk_cloud_model, calc_liquid_water_content, collision_turbulence,                   &
+              microphysics_morrison, microphysics_seifert
+
+    USE calc_mean_profile_mod,                                                                     &
         ONLY:  calc_mean_profile
 
-    USE chem_emissions_mod,                                                    &
+    USE chem_emissions_mod,                                                                        &
         ONLY:  chem_emissions_setup
 
-    USE chem_modules,                                                          &
+    USE chem_modules,                                                                              &
         ONLY:  bc_cs_t_val, cs_name, do_emis, nspec, nspec_out
 
-    USE chemistry_model_mod,                                                   &
+    USE chemistry_model_mod,                                                                       &
         ONLY:  chem_boundary_conds, chem_species
 
-    USE control_parameters,                                                    &
-        ONLY:  advected_distance_x, advected_distance_y, air_chemistry,        &
-               average_count_3d, averaging_interval, averaging_interval_pr,    &
-               bc_lr_cyc, bc_ns_cyc, bc_pt_t_val, bc_q_t_val, biometeorology,  &
-               call_psolver_at_all_substeps,  child_domain, cloud_droplets,    &
-               constant_flux_layer, constant_heatflux,                         &
-               create_disturbances, dopr_n, constant_diffusion, coupling_mode, &
-               coupling_start_time, current_timestep_number,                   &
-               disturbance_created, disturbance_energy_limit, dist_range,      &
-               do_sum, dt_3d, dt_averaging_input, dt_averaging_input_pr,       &
-               dt_coupling, dt_data_output_av, dt_disturb, dt_do2d_xy,         &
-               dt_do2d_xz, dt_do2d_yz, dt_do3d, dt_domask,dt_dopts, dt_dopr,   &
-               dt_dopr_listing, dt_dots, dt_dvrp, dt_run_control, end_time,    &
-               first_call_lpm, first_call_mas, galilei_transformation,         &
-               humidity, indoor_model, intermediate_timestep_count,            &
-               intermediate_timestep_count_max,                                &
-               land_surface, large_scale_forcing,                              &
-               loop_optimization, lsf_surf, lsf_vert, masks, mid,              &
-               multi_agent_system_end, multi_agent_system_start,               &
-               nesting_offline, neutral, nr_timesteps_this_run, nudging,       &
-               ocean_mode, passive_scalar, pt_reference,                       &
-               pt_slope_offset, random_heatflux, rans_mode,                    &
-               rans_tke_e, run_coupled, salsa,                                 &
-               simulated_time, simulated_time_chr,                             &
-               skip_time_do2d_xy, skip_time_do2d_xz, skip_time_do2d_yz,        &
-               skip_time_do3d, skip_time_domask, skip_time_dopr,               &
-               skip_time_data_output_av, sloping_surface, stop_dt,             &
-               surface_output, terminate_coupled, terminate_run,               &
-               timestep_scheme,                                                &
-               time_coupling, time_do2d_xy, time_do2d_xz, time_do2d_yz,        &
-               time_do3d, time_domask, time_dopr, time_dopr_av,                &
-               time_dopr_listing, time_dopts, time_dosp, time_dosp_av,         &
-               time_dots, time_do_av, time_do_sla, time_disturb, time_dvrp,    &
-               time_run_control, time_since_reference_point, tsc,              &
-               turbulent_inflow, turbulent_outflow, urban_surface,             &
-               use_initial_profile_as_reference,                               &
-               use_single_reference_value, u_gtrans, v_gtrans,                 &
-               virtual_flight, virtual_measurement, wind_turbine,              &
-               ws_scheme_mom, ws_scheme_sca 
-
-    USE cpulog,                                                                &
+    USE control_parameters,                                                                        &
+        ONLY:  advected_distance_x, advected_distance_y, air_chemistry, average_count_3d,          &
+               averaging_interval, averaging_interval_pr, bc_lr_cyc, bc_ns_cyc, bc_pt_t_val,       &
+               bc_q_t_val, biometeorology, call_psolver_at_all_substeps,  child_domain,            &
+               cloud_droplets, constant_flux_layer, constant_heatflux, create_disturbances,        &
+               dopr_n, constant_diffusion, coupling_mode, coupling_start_time,                     &
+               current_timestep_number, disturbance_created, disturbance_energy_limit, dist_range, &
+               do_sum, dt_3d, dt_averaging_input, dt_averaging_input_pr, dt_coupling,              &
+               dt_data_output_av, dt_disturb, dt_do2d_xy, dt_do2d_xz, dt_do2d_yz, dt_do3d,         &
+               dt_domask,dt_dopts, dt_dopr, dt_dopr_listing, dt_dots, dt_dvrp, dt_run_control,     &
+               end_time, first_call_lpm, first_call_mas, galilei_transformation, humidity,         &
+               indoor_model, intermediate_timestep_count, intermediate_timestep_count_max,         &
+               land_surface, large_scale_forcing, loop_optimization, lsf_surf, lsf_vert, masks,    &
+               mid, multi_agent_system_end, multi_agent_system_start, nesting_offline, neutral,    &
+               nr_timesteps_this_run, nudging, ocean_mode, passive_scalar, pt_reference,           &
+               pt_slope_offset, random_heatflux, rans_mode, rans_tke_e, run_coupled, salsa,        &
+               simulated_time, simulated_time_chr, skip_time_do2d_xy, skip_time_do2d_xz,           &
+               skip_time_do2d_yz, skip_time_do3d, skip_time_domask, skip_time_dopr,                &
+               skip_time_data_output_av, sloping_surface, stop_dt, surface_output,                 &
+               terminate_coupled, terminate_run, timestep_scheme, time_coupling, time_do2d_xy,     &
+               time_do2d_xz, time_do2d_yz, time_do3d, time_domask, time_dopr, time_dopr_av,        &
+               time_dopr_listing, time_dopts, time_dosp, time_dosp_av, time_dots, time_do_av,      &
+               time_do_sla, time_disturb, time_dvrp, time_run_control, time_since_reference_point, &
+               turbulent_inflow, turbulent_outflow, urban_surface,                                 &
+               use_initial_profile_as_reference, use_single_reference_value, u_gtrans, v_gtrans,   &
+               virtual_flight, virtual_measurement, wind_turbine, ws_scheme_mom, ws_scheme_sca
+
+    USE cpulog,                                                                                    &
         ONLY:  cpu_log, log_point, log_point_s
 
-    USE date_and_time_mod,                                                     &
+    USE date_and_time_mod,                                                                         &
         ONLY:  calc_date_and_time, hour_call_emis, hour_of_year
 
-    USE flight_mod,                                                            &
+    USE flight_mod,                                                                                &
         ONLY:  flight_measurement
 
-    USE indices,                                                               &
-        ONLY:  nbgp, nx, nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzt, &
-               nz, nzb_max, advc_flags_1, advc_flags_2, wall_flags_0
-
-    USE indoor_model_mod,                                                      &
-        ONLY:  dt_indoor, im_main_heatcool, skip_time_do_indoor, time_indoor
-
-    USE interaction_droplets_ptq_mod,                                          &
+    USE indices,                                                                                   &
+        ONLY:  nbgp, nx, nxl, nxlg, nxr, nxrg, nzb, nzt
+
+    USE indoor_model_mod,                                                                          &
+        ONLY:  dt_indoor, im_main_heatcool, time_indoor
+
+    USE interaction_droplets_ptq_mod,                                                              &
         ONLY:  interaction_droplets_ptq
 
@@ -552,109 +536,117 @@
     USE kinds
 
-    USE land_surface_model_mod,                                                &
-        ONLY:  lsm_boundary_condition, lsm_energy_balance, lsm_soil_model,     &
-               skip_time_do_lsm
-
-    USE lsf_nudging_mod,                                                       &
+    USE land_surface_model_mod,                                                                    &
+        ONLY:  lsm_boundary_condition, lsm_energy_balance, lsm_soil_model, skip_time_do_lsm
+
+    USE lpm_mod,                                                                                   &
+        ONLY:  lpm
+
+    USE lsf_nudging_mod,                                                                           &
         ONLY:  calc_tnudge, ls_forcing_surf, ls_forcing_vert, nudge_ref
 
-    USE module_interface,                                                      &
+    USE module_interface,                                                                          &
         ONLY:  module_interface_actions
 
-    USE multi_agent_system_mod,                                                &
+    USE multi_agent_system_mod,                                                                    &
         ONLY:  agents_active, multi_agent_system
 
-    USE nesting_offl_mod,                                                      &
+    USE nesting_offl_mod,                                                                          &
         ONLY:  nesting_offl_bc, nesting_offl_mass_conservation
         
-    USE netcdf_data_input_mod,                                                 &
-        ONLY:  chem_emis, chem_emis_att, nest_offl,                            &
-               netcdf_data_input_offline_nesting
-
-    USE ocean_mod,                                                             &
+    USE netcdf_data_input_mod,                                                                     &
+        ONLY:  chem_emis, chem_emis_att, nest_offl, netcdf_data_input_offline_nesting
+
+    USE ocean_mod,                                                                                 &
         ONLY:  prho_reference
 
-    USE particle_attributes,                                                   &
-        ONLY:  particle_advection, particle_advection_start,                   &
-               use_sgs_for_particles, wang_kernel
+    USE particle_attributes,                                                                       &
+        ONLY:  particle_advection, particle_advection_start, use_sgs_for_particles, wang_kernel
 
     USE pegrid
 
-    USE pmc_interface,                                                         &
-        ONLY:  nested_run, nesting_mode, pmci_boundary_conds, pmci_datatrans,  &
-               pmci_synchronize
-
-    USE progress_bar,                                                          &
+    USE pmc_interface,                                                                             &
+        ONLY:  nested_run, nesting_mode, pmci_boundary_conds, pmci_datatrans, pmci_synchronize
+
+    USE progress_bar,                                                                              &
         ONLY:  finish_progress_bar, output_progress_bar
 
-    USE prognostic_equations_mod,                                              &
+    USE prognostic_equations_mod,                                                                  &
         ONLY:  prognostic_equations_cache, prognostic_equations_vector
 
-    USE radiation_model_mod,                                                   &
-        ONLY: dt_radiation, force_radiation_call, radiation, radiation_control,&
-              radiation_interaction, radiation_interactions,                   &
-              skip_time_do_radiation, time_radiation
+    USE radiation_model_mod,                                                                       &
+        ONLY: dt_radiation, force_radiation_call, radiation, radiation_control,                    &
+              radiation_interaction, radiation_interactions, skip_time_do_radiation, time_radiation
          
-    USE salsa_mod,                                                             &
-        ONLY: aerosol_number, aerosol_mass, nbins, ncc_tot, ngast,             &
-              salsa_boundary_conds, salsa_gas, salsa_gases_from_chem,          &
-              skip_time_do_salsa                      
-    
-    USE salsa_util_mod,                                                        &
-           ONLY:  sums_salsa_ws_l      
-
-    USE spectra_mod,                                                           &
-        ONLY: average_count_sp, averaging_interval_sp, calc_spectra, dt_dosp,  &
-              skip_time_dosp
-
-    USE statistics,                                                            &
-        ONLY:  flow_statistics_called, hom, pr_palm, sums_ls_l,                &
-               rmask, statistic_regions, weight_substep, sums_l, sums_l_l,     &
-               sums_us2_ws_l, sums_wsus_ws_l, sums_vs2_ws_l, sums_wsvs_ws_l,   &
-               sums_ws2_ws_l, sums_wspts_ws_l, sums_wsqs_ws_l, sums_wssas_ws_l,&
-               sums_wsqcs_ws_l, sums_wsqrs_ws_l, sums_wsncs_ws_l,              &
-               sums_wsnrs_ws_l, sums_wsss_ws_l
-
-    USE surface_layer_fluxes_mod,                                              &
+    USE salsa_mod,                                                                                 &
+        ONLY: aerosol_number, aerosol_mass, nbins, ncc_tot, ngast, salsa_boundary_conds,           &
+              salsa_gas, salsa_gases_from_chem, skip_time_do_salsa
+
+    USE spectra_mod,                                                                               &
+        ONLY: average_count_sp, averaging_interval_sp, calc_spectra, dt_dosp, skip_time_dosp
+
+    USE statistics,                                                                                &
+        ONLY:  flow_statistics_called, hom, pr_palm, sums_ls_l
+
+
+    USE surface_layer_fluxes_mod,                                                                  &
         ONLY:  surface_layer_fluxes
 
-    USE surface_mod,                                                           &
-        ONLY:  bc_h, surf_def_h, surf_lsm_h, surf_usm_h,                       &
-               enter_surface_arrays, exit_surface_arrays
-
-    USE surface_data_output_mod,                                               &
-        ONLY:  average_count_surf, averaging_interval_surf, dt_dosurf,         &
-               dt_dosurf_av, surface_data_output,                              &
-               surface_data_output_averaging, skip_time_dosurf,                &
+    USE surface_data_output_mod,                                                                   &
+        ONLY:  average_count_surf, averaging_interval_surf, dt_dosurf, dt_dosurf_av,               &
+               surface_data_output, surface_data_output_averaging, skip_time_dosurf,               &
                skip_time_dosurf_av, time_dosurf, time_dosurf_av
 
-    USE turbulence_closure_mod,                                                &
+    USE surface_mod,                                                                               &
+        ONLY:  surf_def_h, surf_lsm_h, surf_usm_h
+
+    USE synthetic_turbulence_generator_mod,                                                        &
+        ONLY:  dt_stg_call, dt_stg_adjust, parametrize_inflow_turbulence, stg_adjust, stg_main,    &
+               time_stg_adjust, time_stg_call, use_syn_turb_gen
+
+    USE turbulence_closure_mod,                                                                    &
         ONLY:  tcm_diffusivities, production_e_init
 
-    USE urban_surface_mod,                                                     &
-        ONLY:  usm_boundary_condition, usm_material_heat_model,                &
-               usm_material_model,                                             &
+    USE urban_surface_mod,                                                                         &
+        ONLY:  usm_boundary_condition, usm_material_heat_model, usm_material_model,                &
                usm_surface_energy_balance, usm_green_heat_model
 
-    USE synthetic_turbulence_generator_mod,                                    &
-        ONLY:  dt_stg_call, dt_stg_adjust, parametrize_inflow_turbulence,      &
-               stg_adjust, stg_main, time_stg_adjust, time_stg_call,           &
-               use_syn_turb_gen
-
-
-    USE wind_turbine_model_mod,                                                &
-        ONLY:  wtm_forces
-
-    USE lpm_mod,                                                               &
-        ONLY:  lpm
-
-    USE vertical_nesting_mod,                                                  &
-        ONLY:  vnested, vnest_anterpolate, vnest_anterpolate_e,                &
-               vnest_boundary_conds, vnest_boundary_conds_khkm,                & 
-               vnest_deallocate, vnest_init, vnest_init_fine,                  &
+    USE vertical_nesting_mod,                                                                      &
+        ONLY:  vnested, vnest_anterpolate, vnest_anterpolate_e, vnest_boundary_conds,              &
+               vnest_boundary_conds_khkm, vnest_deallocate, vnest_init, vnest_init_fine,           &
                vnest_start_time
                
-    USE virtual_measurement_mod,                                               &
+    USE virtual_measurement_mod,                                                                   &
         ONLY:  vm_data_output, vm_sampling, vm_time_start
+
+    USE wind_turbine_model_mod,                                                                    &
+        ONLY:  wtm_forces
+
+
+#if defined( _OPENACC )
+    USE arrays_3d,                                                             &
+        ONLY:  d, dd2zu, ddzu, ddzw, drho_air, drho_air_zw, dzw, heatflux_output_conversion, kh,   &
+               km, momentumflux_output_conversion, p, ptdf_x, ptdf_y, rdf, rdf_sc, rho_air,        &
+               rho_air_zw, te_m, tpt_m, tu_m, tv_m, tw_m, ug, u_init, u_stokes_zu, vg, v_init,     &
+               v_stokes_zu, zu
+
+    USE control_parameters,                                                                        &
+        ONLY:  tsc
+
+    USE indices,                                                                                   &
+        ONLY:  advc_flags_1, advc_flags_2, nyn, nyng, nys, nysg, nz, nzb_max, wall_flags_0
+
+    USE statistics,                                                                                &
+        ONLY:  rmask, statistic_regions, sums_l, sums_l_l, sums_us2_ws_l,                          &
+               sums_wsus_ws_l, sums_vs2_ws_l, sums_wsvs_ws_l, sums_ws2_ws_l, sums_wspts_ws_l,      &
+               sums_wsqs_ws_l, sums_wssas_ws_l, sums_wsqcs_ws_l, sums_wsqrs_ws_l, sums_wsncs_ws_l, &
+               sums_wsnrs_ws_l, sums_wsss_ws_l, weight_substep
+
+    USE salsa_util_mod,                                                                            &
+           ONLY:  sums_salsa_ws_l
+
+    USE surface_mod,                                                                               &
+        ONLY:  bc_h, enter_surface_arrays, exit_surface_arrays
+#endif
+
 
     IMPLICIT NONE
@@ -675,5 +667,6 @@
 
 
-! Copy data from arrays_3d
+!
+!-- Copy data from arrays_3d
 !$ACC DATA & 
 !$ACC COPY(d(nzb+1:nzt,nys:nyn,nxl:nxr)) &
@@ -717,9 +710,11 @@
 !$ACC COPYIN(ug(0:nz+1), vg(0:nz+1))
 
-! Copy data from control_parameters
+!
+!-- Copy data from control_parameters
 !$ACC DATA &
 !$ACC COPYIN(tsc(1:5))
 
-! Copy data from indices
+!
+!-- Copy data from indices
 !$ACC DATA &
 !$ACC COPYIN(advc_flags_1(nzb:nzt+1,nysg:nyng,nxlg:nxrg)) &
@@ -727,5 +722,6 @@
 !$ACC COPYIN(wall_flags_0(nzb:nzt+1,nysg:nyng,nxlg:nxrg))
 
-! Copy data from surface_mod
+!
+!-- Copy data from surface_mod
 !$ACC DATA &
 !$ACC COPYIN(bc_h(0:1)) &
@@ -737,5 +733,6 @@
 !$ACC COPYIN(bc_h(1)%k(1:bc_h(1)%ns))
 
-! Copy data from statistics
+!
+!-- Copy data from statistics
 !$ACC DATA &
 !$ACC COPYIN(hom(0:nz+1,1:2,1:4,0)) &
@@ -759,5 +756,5 @@
 !$ACC COPY(sums_salsa_ws_l(nzb:nzt+1,0))
 
-#ifdef _OPENACC
+#if defined( _OPENACC )
     CALL enter_surface_arrays
 #endif
@@ -784,5 +781,5 @@
 !-- Data exchange between coupled models in case that a call has been omitted 
 !-- at the end of the previous run of a job chain.
-    IF ( coupling_mode /= 'uncoupled'  .AND.  run_coupled .AND. .NOT. vnested)  THEN
+    IF ( coupling_mode /= 'uncoupled'  .AND.  run_coupled  .AND. .NOT. vnested )  THEN
 !
 !--    In case of model termination initiated by the local model the coupler 
@@ -792,7 +789,5 @@
           time_coupling = time_coupling - dt_coupling
        ENDDO
-       IF (time_coupling == 0.0_wp  .AND.                                      &
-           time_since_reference_point < dt_coupling )                          &
-       THEN
+       IF (time_coupling == 0.0_wp  .AND.  time_since_reference_point < dt_coupling )  THEN
           time_coupling = time_since_reference_point
        ENDIF
@@ -806,8 +801,8 @@
 
     CALL location_message( 'starting timestep-sequence', .TRUE. )
+
 !
 !-- Start of the time loop
-    DO  WHILE ( simulated_time < end_time  .AND.  .NOT. stop_dt  .AND. &
-                .NOT. terminate_run )
+    DO  WHILE ( simulated_time < end_time  .AND.  .NOT. stop_dt  .AND. .NOT. terminate_run )
 
        CALL cpu_log( log_point_s(10), 'timesteps', 'start' )
@@ -842,6 +837,6 @@
            IF ( air_chemistry )  THEN
               DO  lsp = 1, nspec
-                 bc_cs_t_val = (  chem_species(lsp)%conc_pr_init(nzt+1)       &
-                                - chem_species(lsp)%conc_pr_init(nzt) )       &
+                 bc_cs_t_val = (  chem_species(lsp)%conc_pr_init(nzt+1)                            &
+                                - chem_species(lsp)%conc_pr_init(nzt) )                            &
                                / dzu(nzt+1)
               ENDDO
@@ -851,6 +846,6 @@
 !--    If forcing by larger-scale models is applied, check if new data
 !--    at domain boundaries need to be read.
-       IF ( nesting_offline )  THEN
-          IF ( nest_offl%time(nest_offl%tind_p) <= time_since_reference_point )&
+       IF ( nesting_offline .AND. nest_offl%time(nest_offl%tind_p) <= time_since_reference_point ) &
+       THEN
              CALL netcdf_data_input_offline_nesting
        ENDIF
@@ -867,6 +862,5 @@
 !--    Start of intermediate step loop
        intermediate_timestep_count = 0
-       DO  WHILE ( intermediate_timestep_count < &
-                   intermediate_timestep_count_max )
+       DO  WHILE ( intermediate_timestep_count < intermediate_timestep_count_max )
 
           intermediate_timestep_count = intermediate_timestep_count + 1
@@ -880,6 +874,6 @@
 !--       Calculate those variables needed in the tendency terms which need
 !--       global communication
-          IF ( .NOT. use_single_reference_value  .AND. &
-               .NOT. use_initial_profile_as_reference )  THEN
+          IF ( .NOT. use_single_reference_value  .AND.  .NOT. use_initial_profile_as_reference )   &
+          THEN
 !
 !--          Horizontally averaged profiles to be used as reference state in
@@ -902,11 +896,12 @@
 !--          ( might be the case if a vertical level is completely occupied 
 !--            with topography ).
-             ref_state = MERGE( MAXVAL(ref_state), ref_state,                  &
-                                ref_state == 0.0_wp )
+             ref_state = MERGE( MAXVAL(ref_state), ref_state, ref_state == 0.0_wp )
           ENDIF
 
           IF ( .NOT. constant_diffusion )  CALL production_e_init
-          IF ( ( ws_scheme_mom .OR. ws_scheme_sca )  .AND.  &
-               intermediate_timestep_count == 1 )  CALL ws_statistics
+          IF ( ( ws_scheme_mom .OR. ws_scheme_sca )  .AND.  intermediate_timestep_count == 1 )     &
+          THEN
+             CALL ws_statistics
+          ENDIF
 !
 !--       In case of nudging calculate current nudging time scale and horizontal
@@ -937,7 +932,7 @@
 !--       ### particle model should be moved before prognostic_equations, in order
 !--       to regard droplet interactions directly
-          IF ( particle_advection  .AND.                         &
-               time_since_reference_point >= particle_advection_start  .AND. &
-               intermediate_timestep_count == 1 )  THEN
+          IF ( particle_advection  .AND.  time_since_reference_point >= particle_advection_start   &
+               .AND.  intermediate_timestep_count == 1 )                                           &
+          THEN
              CALL lpm
              first_call_lpm = .FALSE.
@@ -948,6 +943,5 @@
 !--       Droplet condensation and evaporation is calculated within
 !--       advec_particles.
-          IF ( cloud_droplets  .AND.  &
-               intermediate_timestep_count == intermediate_timestep_count_max )&
+          IF ( cloud_droplets  .AND.  intermediate_timestep_count == intermediate_timestep_count_max ) &
           THEN
              CALL interaction_droplets_ptq
@@ -956,8 +950,8 @@
 !
 !--       Movement of agents in multi agent system
-          IF ( agents_active  .AND.                                            &
-               time_since_reference_point >= multi_agent_system_start  .AND.   &
-               time_since_reference_point <= multi_agent_system_end    .AND.   &
-               intermediate_timestep_count == 1 )  THEN
+          IF ( agents_active  .AND.  time_since_reference_point >= multi_agent_system_start  .AND. &
+               time_since_reference_point <= multi_agent_system_end  .AND.                         &
+               intermediate_timestep_count == 1 )                                                  &
+          THEN
              CALL multi_agent_system
              first_call_mas = .FALSE.
@@ -973,5 +967,5 @@
           CALL exchange_horiz( pt_p, nbgp )
           IF ( .NOT. constant_diffusion )  CALL exchange_horiz( e_p, nbgp )
-          IF ( rans_tke_e  .OR.  wang_kernel  .OR.  collision_turbulence       &
+          IF ( rans_tke_e  .OR.  wang_kernel  .OR.  collision_turbulence                           &
                .OR.  use_sgs_for_particles )  THEN
              IF ( rans_tke_e )  THEN
@@ -1012,5 +1006,5 @@
                 DO WHILE ( TRIM( cs_name( lsp_usr ) ) /= 'novalue' )
                    IF ( TRIM(chem_species(lsp)%name) == TRIM(cs_name(lsp_usr)) )  THEN
-                      CALL chem_boundary_conds( chem_species(lsp)%conc_p,              &
+                      CALL chem_boundary_conds( chem_species(lsp)%conc_p,                          &
                                                 chem_species(lsp)%conc_pr_init )
                    ENDIF
@@ -1026,12 +1020,10 @@
                 CALL exchange_horiz( aerosol_number(b)%conc_p, nbgp )
                 CALL cpu_log( log_point_s(93), 'salsa decycle', 'start' )
-                CALL salsa_boundary_conds( aerosol_number(b)%conc_p,           &
-                                           aerosol_number(b)%init )
+                CALL salsa_boundary_conds( aerosol_number(b)%conc_p, aerosol_number(b)%init )
                 CALL cpu_log( log_point_s(93), 'salsa decycle', 'stop' )
                 DO  c = 1, ncc_tot
-                   CALL exchange_horiz( aerosol_mass((c-1)*nbins+b)%conc_p,    &
-                                        nbgp )
+                   CALL exchange_horiz( aerosol_mass((c-1)*nbins+b)%conc_p, nbgp )
                    CALL cpu_log( log_point_s(93), 'salsa decycle', 'start' )
-                   CALL salsa_boundary_conds( aerosol_mass((c-1)*nbins+b)%conc_p,&
+                   CALL salsa_boundary_conds( aerosol_mass((c-1)*nbins+b)%conc_p,                  &
                                               aerosol_mass((c-1)*nbins+b)%init )
                    CALL cpu_log( log_point_s(93), 'salsa decycle', 'stop' )
@@ -1042,6 +1034,5 @@
                    CALL exchange_horiz( salsa_gas(g)%conc_p, nbgp ) 
                    CALL cpu_log( log_point_s(93), 'salsa decycle', 'start' )
-                   CALL salsa_boundary_conds( salsa_gas(g)%conc_p,             &
-                                              salsa_gas(g)%init )
+                   CALL salsa_boundary_conds( salsa_gas(g)%conc_p, salsa_gas(g)%init )
                    CALL cpu_log( log_point_s(93), 'salsa decycle', 'stop' )
              ENDDO
@@ -1078,6 +1069,5 @@
              CALL pmci_datatrans( nesting_mode )
 
-             IF ( TRIM( nesting_mode ) == 'two-way' .OR.                       &
-                  nesting_mode == 'vertical' )  THEN
+             IF ( TRIM( nesting_mode ) == 'two-way' .OR.  nesting_mode == 'vertical' )  THEN
 !
 !--             Exchange_horiz is needed for all parent-domains after the
@@ -1107,7 +1097,7 @@
                 IF ( .NOT. constant_diffusion )  CALL exchange_horiz( e, nbgp )
 
-                IF ( .NOT. constant_diffusion  .AND.  rans_mode  .AND.         &
-                                                      rans_tke_e )             &
+                IF ( .NOT. constant_diffusion  .AND.  rans_mode  .AND.  rans_tke_e )  THEN
                    CALL exchange_horiz( diss, nbgp )
+                ENDIF
 
                 IF ( air_chemistry )  THEN
@@ -1130,8 +1120,6 @@
 !--       when a sloping surface is used
           IF ( sloping_surface )  THEN
-             IF ( nxl ==  0 )  pt(:,:,nxlg:nxl-1) = pt(:,:,nxlg:nxl-1) - &
-                                                    pt_slope_offset
-             IF ( nxr == nx )  pt(:,:,nxr+1:nxrg) = pt(:,:,nxr+1:nxrg) + &
-                                                    pt_slope_offset
+             IF ( nxl ==  0 )  pt(:,:,nxlg:nxl-1) = pt(:,:,nxlg:nxl-1) - pt_slope_offset
+             IF ( nxr == nx )  pt(:,:,nxr+1:nxrg) = pt(:,:,nxr+1:nxrg) + pt_slope_offset
           ENDIF
 
@@ -1146,18 +1134,16 @@
 !
 !--       Impose a random perturbation on the horizontal velocity field
-          IF ( create_disturbances  .AND.                                      &
-               ( call_psolver_at_all_substeps  .AND.                           &
-               intermediate_timestep_count == intermediate_timestep_count_max )&
-          .OR. ( .NOT. call_psolver_at_all_substeps  .AND.                     &
-               intermediate_timestep_count == 1 ) )                            &
+          IF ( create_disturbances  .AND.  ( call_psolver_at_all_substeps  .AND.                   &
+               intermediate_timestep_count == intermediate_timestep_count_max )                    &
+               .OR. ( .NOT. call_psolver_at_all_substeps  .AND.  intermediate_timestep_count == 1 ) ) &
           THEN
              time_disturb = time_disturb + dt_3d
              IF ( time_disturb >= dt_disturb )  THEN
-                IF ( disturbance_energy_limit /= 0.0_wp  .AND.                 &
+                IF ( disturbance_energy_limit /= 0.0_wp  .AND.                                     &
                      hom(nzb+5,1,pr_palm,0) < disturbance_energy_limit )  THEN
                    CALL disturb_field( 'u', tend, u )
                    CALL disturb_field( 'v', tend, v )
-                ELSEIF ( ( .NOT. bc_lr_cyc  .OR.  .NOT. bc_ns_cyc )            &
-                     .AND. .NOT. child_domain  .AND.  .NOT.  nesting_offline )  &
+                ELSEIF ( ( .NOT. bc_lr_cyc  .OR.  .NOT. bc_ns_cyc )                                &
+                         .AND. .NOT. child_domain  .AND.  .NOT.  nesting_offline )                 &
                 THEN
 !
@@ -1176,11 +1162,11 @@
 !--       Map forcing data derived from larger scale model onto domain 
 !--       boundaries. 
-          IF ( nesting_offline  .AND.  intermediate_timestep_count ==          &
-                                       intermediate_timestep_count_max  )      &
+          IF ( nesting_offline  .AND.  intermediate_timestep_count ==                              &
+                                       intermediate_timestep_count_max  )                          &
              CALL nesting_offl_bc
 !
 !--       Impose a turbulent inflow using synthetic generated turbulence, 
 !--       only once per time step.
-          IF ( use_syn_turb_gen  .AND.  time_stg_call >= dt_stg_call  .AND.    &
+          IF ( use_syn_turb_gen  .AND.  time_stg_call >= dt_stg_call  .AND.                        &
              intermediate_timestep_count == intermediate_timestep_count_max )  THEN
              CALL cpu_log( log_point(57), 'synthetic_turbulence_gen', 'start' )
@@ -1244,6 +1230,6 @@
 !--          pt_surface and q_surface in dependence on data from external 
 !--          file LSF_DATA respectively
-             IF ( ( large_scale_forcing .AND. lsf_surf ) .AND. &
-                 intermediate_timestep_count == intermediate_timestep_count_max )&
+             IF ( ( large_scale_forcing .AND. lsf_surf ) .AND.                                     &
+                 intermediate_timestep_count == intermediate_timestep_count_max )                  &
              THEN
                 CALL ls_forcing_surf( simulated_time )
@@ -1335,12 +1321,10 @@
 !
 !--       If required, calculate radiative fluxes and heating rates
-          IF ( radiation .AND. intermediate_timestep_count                     &
-               == intermediate_timestep_count_max .AND. time_since_reference_point >    &
-               skip_time_do_radiation )  THEN
+          IF ( radiation  .AND.  intermediate_timestep_count == intermediate_timestep_count_max    &
+               .AND. time_since_reference_point > skip_time_do_radiation )  THEN
 
                time_radiation = time_radiation + dt_3d
 
-             IF ( time_radiation >= dt_radiation .OR. force_radiation_call )   &
-             THEN
+             IF ( time_radiation >= dt_radiation  .OR.  force_radiation_call )  THEN
 
                 CALL cpu_log( log_point(50), 'radiation', 'start' )
@@ -1355,13 +1339,10 @@
 !--             solar positions
                 time_since_reference_point_save = time_since_reference_point
-                time_since_reference_point =                                   &
-                                    REAL( FLOOR( time_since_reference_point /  &
-                                                 dt_radiation), wp )           &
-                                             * dt_radiation
+                time_since_reference_point = REAL( FLOOR( time_since_reference_point /             &
+                                                          dt_radiation), wp ) * dt_radiation
 
                 CALL radiation_control
 
-                IF ( ( urban_surface  .OR.  land_surface )  .AND.               &
-                     radiation_interactions )  THEN
+                IF ( ( urban_surface  .OR.  land_surface )  .AND.  radiation_interactions )  THEN
                    CALL cpu_log( log_point_s(46), 'radiation_interaction', 'start' )
                    CALL radiation_interaction
@@ -1423,6 +1404,5 @@
           time_indoor = time_indoor + dt_3d
 
-          IF ( time_indoor >= dt_indoor  .OR.  current_timestep_number == 0 )  &
-          THEN
+          IF ( time_indoor >= dt_indoor  .OR.  current_timestep_number == 0 )  THEN
 
              time_indoor = time_indoor - dt_indoor
@@ -1506,6 +1486,5 @@
 !
 !--    Data exchange between coupled models
-       IF ( coupling_mode /= 'uncoupled'  .AND.  run_coupled                   &
-                                          .AND. .NOT. vnested )  THEN
+       IF ( coupling_mode /= 'uncoupled'  .AND.  run_coupled  .AND.  .NOT. vnested )  THEN
           time_coupling = time_coupling + dt_3d
 
@@ -1516,5 +1495,5 @@
 !--       If necessary, the coupler will be called at the beginning of the 
 !--       next restart run.
-          DO WHILE ( time_coupling >= dt_coupling .AND. terminate_coupled == 0 )
+          DO WHILE ( time_coupling >= dt_coupling  .AND.  terminate_coupled == 0 )
              CALL surface_coupler
              time_coupling = time_coupling - dt_coupling
@@ -1528,8 +1507,8 @@
 !--                   and then we might get trouble with the biomet output,
 !--                   because we can have 2d and/or 3d biomet output!!
-       IF (         biometeorology  &
-             .AND.  ( ( time_do3d >= dt_do3d  .AND.  time_since_reference_point >= skip_time_do3d )          &
-                      .OR.                                                                                   &
-                      ( time_do2d_xy >= dt_do2d_xy  .AND.  time_since_reference_point >= skip_time_do2d_xy ) &
+       IF ( biometeorology                                                                         &
+            .AND. ( ( time_do3d >= dt_do3d  .AND.  time_since_reference_point >= skip_time_do3d )  &
+                  .OR.                                                                             &
+            ( time_do2d_xy >= dt_do2d_xy  .AND.  time_since_reference_point >= skip_time_do2d_xy ) &
                     ) )  THEN
 !
@@ -1576,12 +1555,11 @@
 !
 !--    If required, call flow_statistics for averaging in time
-       IF ( averaging_interval_pr /= 0.0_wp  .AND.  &
-            ( dt_dopr - time_dopr ) <= averaging_interval_pr  .AND.  &
+       IF ( averaging_interval_pr /= 0.0_wp  .AND.                                                 &
+            ( dt_dopr - time_dopr ) <= averaging_interval_pr  .AND.                                &
             time_since_reference_point >= skip_time_dopr )  THEN
           time_dopr_av = time_dopr_av + dt_3d
           IF ( time_dopr_av >= dt_averaging_input_pr )  THEN
              do_sum = .TRUE.
-             time_dopr_av = MOD( time_dopr_av, &
-                                    MAX( dt_averaging_input_pr, dt_3d ) )
+             time_dopr_av = MOD( time_dopr_av, MAX( dt_averaging_input_pr, dt_3d ) )
           ENDIF
        ENDIF
@@ -1590,7 +1568,7 @@
 !
 !--    Sum-up 3d-arrays for later output of time-averaged 2d/3d/masked data
-       IF ( averaging_interval /= 0.0_wp  .AND.                                &
-            ( dt_data_output_av - time_do_av ) <= averaging_interval  .AND.    &
-            time_since_reference_point >= skip_time_data_output_av )           &
+       IF ( averaging_interval /= 0.0_wp  .AND.                                                    &
+            ( dt_data_output_av - time_do_av ) <= averaging_interval  .AND.                        &
+            time_since_reference_point >= skip_time_data_output_av )                               &
        THEN
           time_do_sla = time_do_sla + dt_3d
@@ -1604,6 +1582,6 @@
 !--    Average surface data
        IF ( surface_output )  THEN
-          IF (         averaging_interval_surf /= 0.0_wp                               &
-                .AND.  ( dt_dosurf_av - time_dosurf_av ) <= averaging_interval_surf    &
+          IF ( averaging_interval_surf /= 0.0_wp                                                   &
+                .AND.  ( dt_dosurf_av - time_dosurf_av ) <= averaging_interval_surf                &
                 .AND.  time_since_reference_point >= skip_time_dosurf_av )  THEN
              IF ( time_dosurf_av >= dt_averaging_input )  THEN        
@@ -1616,12 +1594,10 @@
 !
 !--    Calculate spectra for time averaging
-       IF ( averaging_interval_sp /= 0.0_wp  .AND.  &
-            ( dt_dosp - time_dosp ) <= averaging_interval_sp  .AND.  &
-            time_since_reference_point >= skip_time_dosp )  THEN
+       IF ( averaging_interval_sp /= 0.0_wp  .AND. ( dt_dosp - time_dosp ) <= averaging_interval_sp&
+            .AND.  time_since_reference_point >= skip_time_dosp )  THEN
           time_dosp_av = time_dosp_av + dt_3d
           IF ( time_dosp_av >= dt_averaging_input_pr )  THEN
              CALL calc_spectra
-             time_dosp_av = MOD( time_dosp_av, &
-                                 MAX( dt_averaging_input_pr, dt_3d ) )
+             time_dosp_av = MOD( time_dosp_av, MAX( dt_averaging_input_pr, dt_3d ) )
           ENDIF
        ENDIF
@@ -1635,6 +1611,5 @@
 !
 !--    Take virtual measurements
-       IF ( virtual_measurement  .AND.                                         &
-            vm_time_start <= time_since_reference_point )  THEN
+       IF ( virtual_measurement  .AND.  vm_time_start <= time_since_reference_point )  THEN
           CALL vm_sampling
           CALL vm_data_output
@@ -1645,12 +1620,10 @@
        IF ( time_dopr_listing >= dt_dopr_listing )  THEN
           CALL print_1d
-          time_dopr_listing = MOD( time_dopr_listing, MAX( dt_dopr_listing,    &
-                                                           dt_3d ) )
+          time_dopr_listing = MOD( time_dopr_listing, MAX( dt_dopr_listing, dt_3d ) )
        ENDIF
 
 !
 !--    Graphic output for PROFIL
-       IF (        time_dopr >= dt_dopr                                        &
-            .AND.  time_since_reference_point >= skip_time_dopr )  THEN
+       IF ( time_dopr >= dt_dopr  .AND.  time_since_reference_point >= skip_time_dopr )  THEN
           IF ( dopr_n /= 0 )  CALL data_output_profiles
           time_dopr = MOD( time_dopr, MAX( dt_dopr, dt_3d ) )
@@ -1668,6 +1641,5 @@
 !--    Output of spectra (formatted for use with PROFIL), in case of no
 !--    time averaging, spectra has to be calculated before
-       IF (         time_dosp >= dt_dosp                                       &
-             .AND.  time_since_reference_point >= skip_time_dosp )  THEN
+       IF ( time_dosp >= dt_dosp  .AND.  time_since_reference_point >= skip_time_dosp )  THEN
           IF ( average_count_sp == 0 )  CALL calc_spectra
           CALL data_output_spectra
@@ -1677,16 +1649,13 @@
 !
 !--    2d-data output (cross-sections)
-       IF (         time_do2d_xy >= dt_do2d_xy                                 &
-             .AND.  time_since_reference_point >= skip_time_do2d_xy )  THEN
+       IF ( time_do2d_xy >= dt_do2d_xy  .AND.  time_since_reference_point >= skip_time_do2d_xy )  THEN
           CALL data_output_2d( 'xy', 0 )
           time_do2d_xy = MOD( time_do2d_xy, MAX( dt_do2d_xy, dt_3d ) )
        ENDIF
-       IF (         time_do2d_xz >= dt_do2d_xz                                 &
-             .AND.  time_since_reference_point >= skip_time_do2d_xz )  THEN
+       IF ( time_do2d_xz >= dt_do2d_xz  .AND.  time_since_reference_point >= skip_time_do2d_xz )  THEN
           CALL data_output_2d( 'xz', 0 )
           time_do2d_xz = MOD( time_do2d_xz, MAX( dt_do2d_xz, dt_3d ) )
        ENDIF
-       IF (         time_do2d_yz >= dt_do2d_yz                                 &
-             .AND.  time_since_reference_point >= skip_time_do2d_yz )  THEN
+       IF ( time_do2d_yz >= dt_do2d_yz  .AND.  time_since_reference_point >= skip_time_do2d_yz )  THEN
           CALL data_output_2d( 'yz', 0 )
           time_do2d_yz = MOD( time_do2d_yz, MAX( dt_do2d_yz, dt_3d ) )
@@ -1695,6 +1664,5 @@
 !
 !--    3d-data output (volume data)
-       IF (         time_do3d >= dt_do3d                                       &
-             .AND.  time_since_reference_point >= skip_time_do3d )  THEN
+       IF ( time_do3d >= dt_do3d  .AND.  time_since_reference_point >= skip_time_do3d )  THEN
           CALL data_output_3d( 0 )
           time_do3d = MOD( time_do3d, MAX( dt_do3d, dt_3d ) )
@@ -1704,9 +1672,8 @@
 !--    Masked data output
        DO  mid = 1, masks
-          IF (         time_domask(mid) >= dt_domask(mid)                      &
-                .AND.  time_since_reference_point >= skip_time_domask(mid) )  THEN
+          IF ( time_domask(mid) >= dt_domask(mid)                                                  &
+               .AND.  time_since_reference_point >= skip_time_domask(mid) )  THEN
              CALL data_output_mask( 0 )
-             time_domask(mid) = MOD( time_domask(mid),                         &
-                                     MAX( dt_domask(mid), dt_3d ) )
+             time_domask(mid) = MOD( time_domask(mid), MAX( dt_domask(mid), dt_3d ) )
           ENDIF
        ENDDO
@@ -1714,6 +1681,6 @@
 !
 !--    Output of time-averaged 2d/3d/masked data
-       IF (         time_do_av >= dt_data_output_av                            &
-             .AND.  time_since_reference_point >= skip_time_data_output_av )  THEN
+       IF ( time_do_av >= dt_data_output_av                                                        &
+            .AND.  time_since_reference_point >= skip_time_data_output_av )  THEN
           CALL average_3d_data
 !
@@ -1734,11 +1701,9 @@
 !--    Output of surface data, instantaneous and averaged data
        IF ( surface_output )  THEN
-          IF (         time_dosurf >= dt_dosurf                                &
-                .AND.  time_since_reference_point >= skip_time_dosurf )  THEN
+          IF ( time_dosurf >= dt_dosurf  .AND.  time_since_reference_point >= skip_time_dosurf )  THEN
              CALL surface_data_output( 0 )
              time_dosurf = MOD( time_dosurf, MAX( dt_dosurf, dt_3d ) )
           ENDIF
-          IF (         time_dosurf_av >= dt_dosurf_av                          &
-                .AND.  time_since_reference_point >= skip_time_dosurf_av )  THEN
+          IF ( time_dosurf_av >= dt_dosurf_av  .AND.  time_since_reference_point >= skip_time_dosurf_av )  THEN
              CALL surface_data_output( 1 )
              time_dosurf_av = MOD( time_dosurf_av, MAX( dt_dosurf_av, dt_3d ) )
@@ -1749,6 +1714,6 @@
 !--    Output of particle time series
        IF ( particle_advection )  THEN
-          IF ( time_dopts >= dt_dopts  .OR.                                    &
-               ( time_since_reference_point >= particle_advection_start  .AND. &
+          IF ( time_dopts >= dt_dopts  .OR.                                                        &
+               ( time_since_reference_point >= particle_advection_start  .AND.                     &
                  first_call_lpm ) )  THEN
              CALL data_output_ptseries
@@ -1813,11 +1778,10 @@
 !--    Computation and output of run control parameters.
 !--    This is also done whenever perturbations have been imposed
-       IF ( time_run_control >= dt_run_control  .OR.                     &
-            timestep_scheme(1:5) /= 'runge'  .OR.  disturbance_created ) &
+       IF ( time_run_control >= dt_run_control  .OR.                                               &
+            timestep_scheme(1:5) /= 'runge'  .OR.  disturbance_created )                           &
        THEN
           CALL run_control
           IF ( time_run_control >= dt_run_control )  THEN
-             time_run_control = MOD( time_run_control, &
-                                     MAX( dt_run_control, dt_3d_old ) )
+             time_run_control = MOD( time_run_control, MAX( dt_run_control, dt_3d_old ) )
           ENDIF
        ENDIF
@@ -1832,5 +1796,5 @@
     ENDDO   ! time loop
 
-#ifdef _OPENACC
+#if defined( _OPENACC )
     CALL exit_surface_arrays
 #endif
Index: /palm/trunk/SOURCE/tridia_solver_mod.f90
===================================================================
--- /palm/trunk/SOURCE/tridia_solver_mod.f90	(revision 3760)
+++ /palm/trunk/SOURCE/tridia_solver_mod.f90	(revision 3761)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! OpenACC modification to prevent compiler warning about unused variable
+! 
+! 3690 2019-01-22 22:56:42Z knoop
 ! OpenACC port for SPEC
 ! 
@@ -156,5 +159,10 @@
 
        USE arrays_3d,                                                          &
-           ONLY:  ddzu_pres, ddzw, rho_air_zw, tri
+           ONLY:  ddzu_pres, ddzw, rho_air_zw
+
+#if defined( _OPENACC )
+       USE arrays_3d,                                                          &
+           ONLY:  tri
+#endif
 
        IMPLICIT NONE
