Index: palm/trunk/SOURCE/chemistry_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/chemistry_model_mod.f90	(revision 3784)
+++ palm/trunk/SOURCE/chemistry_model_mod.f90	(revision 3796)
@@ -26,8 +26,12 @@
 ! Former revisions:
 ! -----------------
-! $Id$
+! $Id: chemistry_model_mod.f90 3784 2019-03-05 14:16:20Z banzhafs
+! Unused variables removed/taken care of
+! 
+!
+! 3784 2019-03-05 14:16:20Z forkel
 ! Replaced READ from unit 10 by CALL get_mechanismname also in chem_header
-! 
-! 
+!
+!
 ! 3783 2019-03-05 13:23:50Z forkel
 ! Removed forgotte write statements an some unused variables (did not touch the 
@@ -578,7 +582,7 @@
     END INTERFACE rc_rctot
 
-    INTERFACE rc_comp_point_rc_eff
-       MODULE PROCEDURE rc_comp_point_rc_eff 
-    END INTERFACE rc_comp_point_rc_eff
+!    INTERFACE rc_comp_point_rc_eff
+!       MODULE PROCEDURE rc_comp_point_rc_eff 
+!    END INTERFACE rc_comp_point_rc_eff
 
     INTERFACE drydepo_aero_zhang_vd
@@ -737,6 +741,6 @@
 
     USE control_parameters,                                                    &  
-        ONLY:  air_chemistry, bc_radiation_l, bc_radiation_n, bc_radiation_r,  &
-               bc_radiation_s                
+        ONLY:  bc_radiation_l, bc_radiation_n, bc_radiation_r, bc_radiation_s
+
     USE indices,                                                               &  
         ONLY:  nxl, nxr, nzt                              
@@ -1045,4 +1049,8 @@
     CHARACTER(len=16)    ::  spec_name
 
+!
+!-- Next statement is to avoid compiler warnings about unused variables
+    IF ( ( i + ilen + k ) > 0  .OR.  var(1:1) == ' ' )  CONTINUE
+
     unit = 'illegal'
 
@@ -1278,4 +1286,9 @@
     INTEGER(iwp) ::  k               !< grid index along z-direction
     INTEGER(iwp) ::  char_len        !< length of a character string
+
+!
+!-- Next statement is to avoid compiler warnings about unused variables
+    IF ( mode(1:1) == ' '  .OR.  two_d )  CONTINUE
+
     found = .FALSE.
     char_len  = LEN_TRIM(variable)
@@ -1751,4 +1764,12 @@
     INTEGER(iwp) ::  j !< running index y dimension
     INTEGER(iwp) ::  n !< running index for chemical species
+
+!
+!-- Next statement is to avoid compiler warning about unused variables
+    IF ( ( ilu_arable + ilu_coniferous_forest + ilu_deciduous_forest + ilu_mediterrean_scrub + &
+           ilu_permanent_crops + ilu_savanna + ilu_semi_natural_veg + ilu_tropical_forest +    &
+           ilu_urban ) == 0 )  CONTINUE
+         
+
 
     IF ( do_emis )  CALL chem_emissions_init
@@ -2786,5 +2807,5 @@
     INTEGER(iwp) ::  k                             !< matching k to surface m at i,j
     INTEGER(iwp) ::  lsp                           !< running index for chem spcs.
-    INTEGER(iwp) ::  lu                            !< running index for landuse classes
+!    INTEGER(iwp) ::  lu                            !< running index for landuse classes
     INTEGER(iwp) ::  lu_palm                       !< index of PALM LSM vegetation_type at current surface element
     INTEGER(iwp) ::  lup_palm                      !< index of PALM LSM pavement_type at current surface element
@@ -4496,5 +4517,4 @@
     REAL(wp), INTENT(OUT) ::  ccomp_tot              !< total compensation point (ug/m3)
                                                      !< [= 0 for species that don't have a compensation
-
     !
     !-- Local variables:
@@ -4524,5 +4544,5 @@
     LOGICAL ::  sai_present                          !< vegetation is present for current land use type
 
-    REAL(wp) ::  laimax                              !< maximum leaf area index (-)
+!    REAL(wp) ::  laimax                              !< maximum leaf area index (-)
     REAL(wp) ::  gw                                  !< external leaf conductance (m/s)
     REAL(wp) ::  gstom                               !< stomatal conductance (m/s)
@@ -4533,4 +4553,8 @@
     REAL(wp) ::  csoil                               !< soil compensation point (ug/m3)
 
+
+!
+!-- Next statement is just to avoid compiler warning about unused variable
+    IF ( day_of_year == 0  .OR.  ( catm + lat + ra + rb ) > 0.0_wp )  CONTINUE
 
 
@@ -4661,4 +4685,8 @@
                                                  !< = 1 -> constant Rc
                                                  !< = 2 -> temperature dependent Rc
+
+!
+!-- Next line is to avoid compiler warning about unused variable
+    IF ( icmp == 0 )  CONTINUE
 
     !
@@ -4950,4 +4978,7 @@
     REAL(wp), PARAMETER ::  dO3 = 0.13e-4          !< diffusion coefficient of ozon (m2/s)
 
+!
+!-- Next line is to avoid compiler warning about unused variables
+    IF ( icmp == 0 )  CONTINUE
 
     SELECT CASE( TRIM(compnam) )
@@ -5526,45 +5557,45 @@
  ! -------------------------------------------------------------------------------------------
 
- SUBROUTINE rc_comp_point_rc_eff( ccomp_tot, catm, ra, rb, rc_tot, rc_eff )
-
-    IMPLICIT NONE
-
-    !
-    !-- Input/output variables:
-    REAL(wp), INTENT(IN) ::  ccomp_tot    !< total compensation point (weighed average of separate compensation points) (ug/m3)
-    REAL(wp), INTENT(IN) ::  catm         !< atmospheric concentration (ug/m3)
-    REAL(wp), INTENT(IN) ::  ra           !< aerodynamic resistance (s/m)
-    REAL(wp), INTENT(IN) ::  rb           !< boundary layer resistance (s/m)
-    REAL(wp), INTENT(IN) ::  rc_tot       !< total canopy resistance (s/m)
-
-    REAL(wp), INTENT(OUT) ::  rc_eff      !< effective total canopy resistance (s/m)
-
-    !
-    !-- Compute effective resistance:
-    IF (  ccomp_tot == 0.0_wp )  THEN
-       !
-       !-- trace with no compensiation point ( or compensation point equal to zero)
-       rc_eff = rc_tot
-
-    ELSE IF ( ccomp_tot > 0.0_wp .AND. ( abs( catm - ccomp_tot ) < 1.e-8 ) )  THEN
-       !
-       !--surface concentration (almost) equal to atmospheric concentration
-       !-- no exchange between surface and atmosphere, infinite RC --> vd=0
-       rc_eff = 9999999999.0_wp
-
-    ELSE IF ( ccomp_tot > 0.0_wp )  THEN
-       !
-       !-- compensation point available, calculate effective resistance
-       rc_eff = ( ( ra + rb ) * ccomp_tot + rc_tot * catm ) / ( catm - ccomp_tot )
-
-    ELSE
-       rc_eff = -999.0_wp
-       message_string = 'This should not be possible, check ccomp_tot'
-       CALL message( 'rc_comp_point_rc_eff', 'CM0461', 1, 2, 0, 6, 0 )
-    ENDIF
-
-    RETURN
-    
- END SUBROUTINE rc_comp_point_rc_eff
+! SUBROUTINE rc_comp_point_rc_eff( ccomp_tot, catm, ra, rb, rc_tot, rc_eff )
+!
+!    IMPLICIT NONE
+!
+!    !
+!    !-- Input/output variables:
+!    REAL(wp), INTENT(IN) ::  ccomp_tot    !< total compensation point (weighed average of separate compensation points) (ug/m3)
+!    REAL(wp), INTENT(IN) ::  catm         !< atmospheric concentration (ug/m3)
+!    REAL(wp), INTENT(IN) ::  ra           !< aerodynamic resistance (s/m)
+!    REAL(wp), INTENT(IN) ::  rb           !< boundary layer resistance (s/m)
+!    REAL(wp), INTENT(IN) ::  rc_tot       !< total canopy resistance (s/m)
+!
+!    REAL(wp), INTENT(OUT) ::  rc_eff      !< effective total canopy resistance (s/m)
+!
+!    !
+!    !-- Compute effective resistance:
+!    IF (  ccomp_tot == 0.0_wp )  THEN
+!       !
+!       !-- trace with no compensiation point ( or compensation point equal to zero)
+!       rc_eff = rc_tot
+!
+!    ELSE IF ( ccomp_tot > 0.0_wp .AND. ( abs( catm - ccomp_tot ) < 1.e-8 ) )  THEN
+!       !
+!       !--surface concentration (almost) equal to atmospheric concentration
+!       !-- no exchange between surface and atmosphere, infinite RC --> vd=0
+!       rc_eff = 9999999999.0_wp
+!
+!    ELSE IF ( ccomp_tot > 0.0_wp )  THEN
+!       !
+!       !-- compensation point available, calculate effective resistance
+!       rc_eff = ( ( ra + rb ) * ccomp_tot + rc_tot * catm ) / ( catm - ccomp_tot )
+!
+!    ELSE
+!       rc_eff = -999.0_wp
+!       message_string = 'This should not be possible, check ccomp_tot'
+!       CALL message( 'rc_comp_point_rc_eff', 'CM0461', 1, 2, 0, 6, 0 )
+!    ENDIF
+!
+!    RETURN
+!    
+! END SUBROUTINE rc_comp_point_rc_eff
 
 
@@ -5758,4 +5789,7 @@
     REAL(wp), PARAMETER ::  kappa_stab = 0.35     !< von Karman constant
 
+!
+!-- Next line is to avoid compiler warning about unused variable
+    IF ( is_water  .OR.  ( z0h + kappa_stab ) > 0.0_wp )  CONTINUE
 
     !
