Index: palm/trunk/SOURCE/user_module.f90
===================================================================
--- palm/trunk/SOURCE/user_module.f90	(revision 3767)
+++ palm/trunk/SOURCE/user_module.f90	(revision 3768)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! variables commented + statements added to avoid compiler warnings about unused variables
+!
+! 3767 2019-02-27 08:18:02Z raasch
 ! unused variable for file index removed from rrd-subroutines parameter list
 ! 
@@ -247,4 +250,10 @@
 
 !
+!-- Next statement is to avoid compiler warnings about unused variables. Please remove in case
+!-- that you are using them.
+    IF ( dots_num_palm == 0  .OR.  dots_num_user == 0  .OR.  user_idummy == 0  .OR.                &
+         user_rdummy == 0.0_wp )  CONTINUE
+
+!
 !-- Set revision number of this default interface version. It will be checked within
 !-- the main program (palm). Please change the revision number in case that the
@@ -325,10 +334,14 @@
 
 
-   INTEGER(iwp),      INTENT(IN)     ::  dots_max
-   INTEGER(iwp),      INTENT(INOUT)  ::  dots_num
-   CHARACTER (LEN=*), DIMENSION(dots_max), INTENT(INOUT)  :: dots_label
-   CHARACTER (LEN=*), DIMENSION(dots_max), INTENT(INOUT)  :: dots_unit
-
-
+    INTEGER(iwp),      INTENT(IN)     ::  dots_max
+    INTEGER(iwp),      INTENT(INOUT)  ::  dots_num
+    CHARACTER (LEN=*), DIMENSION(dots_max), INTENT(INOUT)  :: dots_label
+    CHARACTER (LEN=*), DIMENSION(dots_max), INTENT(INOUT)  :: dots_unit
+
+!
+!-- Next line is to avoid compiler warning about unused variables. Please remove.
+    IF ( dots_num == 0  .OR.  dots_label(1)(1:1) == ' '  .OR.  dots_unit(1)(1:1) == ' ' )  CONTINUE
+
+!
 !-- Sample for user-defined time series
 !-- For each time series quantity you have to give a label and a unit,
@@ -373,6 +386,10 @@
     CHARACTER (LEN=*) ::  dopr_unit !< local value of dopr_unit
 
-    INTEGER(iwp) ::  user_pr_index !< 
-    INTEGER(iwp) ::  var_count     !< 
+!    INTEGER(iwp) ::  user_pr_index !<
+    INTEGER(iwp) ::  var_count     !<
+
+!
+!-- Next line is to avoid compiler warning about unused variables. Please remove.
+    IF ( unit(1:1) == ' '  .OR.  dopr_unit(1:1) == ' '  .OR.  var_count == 0 )  CONTINUE
 
     SELECT CASE ( TRIM( variable ) )
@@ -448,7 +465,7 @@
 
 
-    INTEGER(iwp) :: i       !< loop index
-    INTEGER(iwp) :: j       !< loop index
-    INTEGER(iwp) :: region  !< index for loop over statistic regions
+!    INTEGER(iwp) :: i       !< loop index
+!    INTEGER(iwp) :: j       !< loop index
+!    INTEGER(iwp) :: region  !< index for loop over statistic regions
 
 !
@@ -487,5 +504,5 @@
 
 
-    CHARACTER (LEN=20) :: field_char   !< 
+!    CHARACTER (LEN=20) :: field_char   !<
 !
 !-- Here the user-defined initializing actions follow:
@@ -598,7 +615,7 @@
     CHARACTER (LEN=*) ::  location !< 
 
-    INTEGER(iwp) ::  i !< 
-    INTEGER(iwp) ::  j !< 
-    INTEGER(iwp) ::  k !< 
+!    INTEGER(iwp) ::  i !<
+!    INTEGER(iwp) ::  j !<
+!    INTEGER(iwp) ::  k !<
 
     CALL cpu_log( log_point(24), 'user_actions', 'start' )
@@ -688,9 +705,8 @@
 
 
-       CHARACTER (LEN=*) ::  location
-
-       INTEGER(iwp) ::  i
-       INTEGER(iwp) ::  idum
-       INTEGER(iwp) ::  j
+    CHARACTER (LEN=*) ::  location
+
+    INTEGER(iwp) ::  i
+    INTEGER(iwp) ::  j
 
 !
@@ -699,4 +715,9 @@
 
        CASE ( 'u-tendency' )
+
+!
+!--       Next line is to avoid compiler warning about unused variables. Please remove.
+          IF ( i == 0  .OR.  j == 0 )  CONTINUE
+
 !
 !--       Enter actions to be done in the u-tendency term here
@@ -752,7 +773,7 @@
     CHARACTER (LEN=*) :: variable !< 
 
-    INTEGER(iwp) ::  i !< 
-    INTEGER(iwp) ::  j !< 
-    INTEGER(iwp) ::  k !< 
+!    INTEGER(iwp) ::  i !<
+!    INTEGER(iwp) ::  j !<
+!    INTEGER(iwp) ::  k !<
 
     IF ( mode == 'allocate' )  THEN
@@ -843,8 +864,8 @@
 
     INTEGER(iwp) ::  av     !< flag to control data output of instantaneous or time-averaged data
-    INTEGER(iwp) ::  i      !< grid index along x-direction
-    INTEGER(iwp) ::  j      !< grid index along y-direction
-    INTEGER(iwp) ::  k      !< grid index along z-direction
-    INTEGER(iwp) ::  m      !< running index surface elements
+!    INTEGER(iwp) ::  i      !< grid index along x-direction
+!    INTEGER(iwp) ::  j      !< grid index along y-direction
+!    INTEGER(iwp) ::  k      !< grid index along z-direction
+!    INTEGER(iwp) ::  m      !< running index surface elements
     INTEGER(iwp) ::  nzb_do !< lower limit of the domain (usually nzb)
     INTEGER(iwp) ::  nzt_do !< upper limit of the domain (usually nzt+1)
@@ -853,7 +874,11 @@
     LOGICAL      ::  two_d !< flag parameter that indicates 2D variables (horizontal cross sections)
 
-    REAL(wp) ::  fill_value = -999.0_wp    !< value for the _FillValue attribute
+!    REAL(wp) ::  fill_value = -999.0_wp    !< value for the _FillValue attribute
 
     REAL(wp), DIMENSION(nxl:nxr,nys:nyn,nzb_do:nzt_do) ::  local_pf !< 
+
+!
+!-- Next line is to avoid compiler warning about unused variables. Please remove.
+    IF ( av == 0  .OR.  local_pf(nxl,nys,nzb_do) == 0.0_wp  .OR.  two_d )  CONTINUE
 
 
@@ -948,7 +973,7 @@
 
     INTEGER(iwp) ::  av    !< 
-    INTEGER(iwp) ::  i     !< 
-    INTEGER(iwp) ::  j     !< 
-    INTEGER(iwp) ::  k     !< 
+!    INTEGER(iwp) ::  i     !<
+!    INTEGER(iwp) ::  j     !<
+!    INTEGER(iwp) ::  k     !<
     INTEGER(iwp) ::  nzb_do !< lower limit of the data output (usually 0)
     INTEGER(iwp) ::  nzt_do !< vertical upper limit of the data output (usually nz_do3d)
@@ -956,7 +981,11 @@
     LOGICAL      ::  found !< 
 
-    REAL(wp) ::  fill_value = -999.0_wp    !< value for the _FillValue attribute
+!    REAL(wp) ::  fill_value = -999.0_wp    !< value for the _FillValue attribute
 
     REAL(sp), DIMENSION(nxl:nxr,nys:nyn,nzb_do:nzt_do) ::  local_pf !< 
+
+!
+!-- Next line is to avoid compiler warning about unused variables. Please remove.
+    IF ( av == 0  .OR.  local_pf(nxl,nys,nzb_do) == 0.0_wp )  CONTINUE
 
 
@@ -1017,11 +1046,15 @@
 
     CHARACTER (LEN=*) ::  mode   !< 
-    INTEGER(iwp) ::  i    !< 
-    INTEGER(iwp) ::  j    !< 
-    INTEGER(iwp) ::  k    !< 
+!    INTEGER(iwp) ::  i    !<
+!    INTEGER(iwp) ::  j    !<
+!    INTEGER(iwp) ::  k    !<
     INTEGER(iwp) ::  sr   !< 
     INTEGER(iwp) ::  tn   !< 
 
-    REAL(wp), DIMENSION(:), ALLOCATABLE ::  ts_value_l   !<
+!    REAL(wp), DIMENSION(:), ALLOCATABLE ::  ts_value_l   !<
+
+!
+!-- Next line is to avoid compiler warning about unused variables. Please remove.
+    IF ( sr == 0  .OR.  tn == 0 )  CONTINUE
 
     IF ( mode == 'profiles' )  THEN
@@ -1096,30 +1129,30 @@
 !> Reading global restart data that has been defined by the user.
 !------------------------------------------------------------------------------!
-    SUBROUTINE user_rrd_global( found )
-
-
-       USE control_parameters,                                                 &
-           ONLY: length, restart_string
-
-
-       LOGICAL, INTENT(OUT)  ::  found 
-
-
-       found = .TRUE.
-
-
-       SELECT CASE ( restart_string(1:length) )
-
-          CASE ( 'global_paramter' )
-!             READ ( 13 )  global_parameter
-
-          CASE DEFAULT
+ SUBROUTINE user_rrd_global( found )
+
+
+    USE control_parameters,                                                 &
+        ONLY: length, restart_string
+
+
+    LOGICAL, INTENT(OUT)  ::  found
+
+
+    found = .TRUE.
+
+
+    SELECT CASE ( restart_string(1:length) )
+
+       CASE ( 'global_paramter' )
+!          READ ( 13 )  global_parameter
+
+       CASE DEFAULT
  
-             found = .FALSE.
-
-       END SELECT
-
-
-    END SUBROUTINE user_rrd_global
+          found = .FALSE.
+
+    END SELECT
+
+
+ END SUBROUTINE user_rrd_global
 
 
@@ -1134,26 +1167,32 @@
 !> calculated in routine rrd_local.
 !------------------------------------------------------------------------------!
-    SUBROUTINE user_rrd_local( k, nxlf, nxlc, nxl_on_file, nxrf, nxrc,         &
-                               nxr_on_file, nynf, nync, nyn_on_file, nysf,     & 
-                               nysc, nys_on_file, tmp_3d, found )
-
-
-       INTEGER(iwp) ::  k               !< 
-       INTEGER(iwp) ::  nxlc            !< 
-       INTEGER(iwp) ::  nxlf            !< 
-       INTEGER(iwp) ::  nxl_on_file     !< 
-       INTEGER(iwp) ::  nxrc            !< 
-       INTEGER(iwp) ::  nxrf            !< 
-       INTEGER(iwp) ::  nxr_on_file     !< 
-       INTEGER(iwp) ::  nync            !< 
-       INTEGER(iwp) ::  nynf            !< 
-       INTEGER(iwp) ::  nyn_on_file     !< 
-       INTEGER(iwp) ::  nysc            !< 
-       INTEGER(iwp) ::  nysf            !< 
-       INTEGER(iwp) ::  nys_on_file     !< 
-
-       LOGICAL, INTENT(OUT)  ::  found 
-
-       REAL(wp), DIMENSION(nzb:nzt+1,nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp) :: tmp_3d   !< 
+ SUBROUTINE user_rrd_local( k, nxlf, nxlc, nxl_on_file, nxrf, nxrc,         &
+                            nxr_on_file, nynf, nync, nyn_on_file, nysf,     &
+                            nysc, nys_on_file, tmp_3d, found )
+
+
+    INTEGER(iwp) ::  idum            !<
+    INTEGER(iwp) ::  k               !<
+    INTEGER(iwp) ::  nxlc            !<
+    INTEGER(iwp) ::  nxlf            !<
+    INTEGER(iwp) ::  nxl_on_file     !<
+    INTEGER(iwp) ::  nxrc            !<
+    INTEGER(iwp) ::  nxrf            !<
+    INTEGER(iwp) ::  nxr_on_file     !<
+    INTEGER(iwp) ::  nync            !<
+    INTEGER(iwp) ::  nynf            !<
+    INTEGER(iwp) ::  nyn_on_file     !<
+    INTEGER(iwp) ::  nysc            !<
+    INTEGER(iwp) ::  nysf            !<
+    INTEGER(iwp) ::  nys_on_file     !<
+
+    LOGICAL, INTENT(OUT)  ::  found
+
+    REAL(wp), DIMENSION(nzb:nzt+1,nys_on_file-nbgp:nyn_on_file+nbgp,nxl_on_file-nbgp:nxr_on_file+nbgp) :: tmp_3d   !<
+
+!
+!-- Next line is to avoid compiler warning about unused variables. Please remove.
+    idum = k + nxlc + nxlf + nxrc + nxrf + nync + nynf + nysc + nysf +                             &
+           INT( tmp_3d(nzb,nys_on_file,nxl_on_file) )
 
 !
@@ -1161,26 +1200,23 @@
 !-- Sample for user-defined output
 
-
-       found = .TRUE.
-
-
-          SELECT CASE ( restart_string(1:length) )
-
-             CASE ( 'u2_av' )
-!                IF ( .NOT. ALLOCATED( u2_av ) ) THEN
-!                     ALLOCATE( u2_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
-!                ENDIF
-!                IF ( k == 1 )  READ ( 13 )  tmp_3d
-!                   u2_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =         &
-!                      tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
-!
-             CASE DEFAULT
-
-                found = .FALSE.
-
-             END SELECT
-
-
-    END SUBROUTINE user_rrd_local
+    found = .TRUE.
+
+    SELECT CASE ( restart_string(1:length) )
+
+       CASE ( 'u2_av' )
+!          IF ( .NOT. ALLOCATED( u2_av ) ) THEN
+!               ALLOCATE( u2_av(nzb:nzt+1,nysg:nyng,nxlg:nxrg) )
+!          ENDIF
+!          IF ( k == 1 )  READ ( 13 )  tmp_3d
+!             u2_av(:,nysc-nbgp:nync+nbgp,nxlc-nbgp:nxrc+nbgp) =         &
+!                tmp_3d(:,nysf-nbgp:nynf+nbgp,nxlf-nbgp:nxrf+nbgp)
+!
+       CASE DEFAULT
+
+          found = .FALSE.
+
+    END SELECT
+
+ END SUBROUTINE user_rrd_local
 
 
@@ -1191,12 +1227,10 @@
 !> runs.
 !------------------------------------------------------------------------------!
-    SUBROUTINE user_wrd_global
-
-
-!       CALL wrd_write_string( 'global_parameter' )
-!       WRITE ( 14 )  global_parameter
-
-
-    END SUBROUTINE user_wrd_global    
+ SUBROUTINE user_wrd_global
+
+!    CALL wrd_write_string( 'global_parameter' )
+!    WRITE ( 14 )  global_parameter
+
+ END SUBROUTINE user_wrd_global
 
 
@@ -1207,18 +1241,15 @@
 !> for restart runs.
 !------------------------------------------------------------------------------!
-    SUBROUTINE user_wrd_local
-
+ SUBROUTINE user_wrd_local
 
 !
 !-- Here the user-defined actions at the end of a job follow.
 !-- Sample for user-defined output:
-!          IF ( ALLOCATED( u2_av ) )  THEN
-!             CALL wrd_write_string( 'u2_av' )  
-!             WRITE ( 14 )  u2_av
-!          ENDIF
-
-
-
-    END SUBROUTINE user_wrd_local
+!    IF ( ALLOCATED( u2_av ) )  THEN
+!       CALL wrd_write_string( 'u2_av' )
+!       WRITE ( 14 )  u2_av
+!    ENDIF
+
+ END SUBROUTINE user_wrd_local
 
 
@@ -1236,4 +1267,3 @@
  END SUBROUTINE user_last_actions
 
-
  END MODULE user
