Index: palm/trunk/SOURCE/surface_mod.f90
===================================================================
--- palm/trunk/SOURCE/surface_mod.f90	(revision 2759)
+++ palm/trunk/SOURCE/surface_mod.f90	(revision 2766)
@@ -26,4 +26,7 @@
 ! -----------------
 ! $Id$
+! Removed preprocessor directive __chem
+! 
+! 2759 2018-01-17 16:24:59Z suehring
 ! Bugfix, consider density in vertical fluxes of passive scalar as well as 
 ! chemical species.
@@ -123,7 +126,5 @@
                rho_air, rho_air_zw, zu, zw, waterflux_input_conversion 
 
-#if defined( __chem )
     USE chem_modules
-#endif
 
     USE control_parameters               
@@ -968,10 +969,8 @@
 !
 !--    Scaling parameter (cs*) and surface flux of chemical species
-#if defined ( __chem )
        IF ( air_chemistry )  THEN
           ALLOCATE ( surfaces%css(1:nvar,1:surfaces%ns)   )   
           ALLOCATE ( surfaces%cssws(1:nvar,1:surfaces%ns) ) 
        ENDIF 
-#endif 
 !
 !--    Arrays for storing potential temperature and
@@ -1052,9 +1051,7 @@
 !
 !--    Chemical species flux
-#if defined( __chem )
        IF ( air_chemistry )  THEN
           ALLOCATE ( surfaces%cssws(1:nvar,1:surfaces%ns) ) 
        ENDIF 
-#endif 
 !
 !--       
@@ -1167,10 +1164,8 @@
 !
 !--    Scaling parameter (cs*) and surface flux of chemical species
-#if defined( __chem )
        IF ( air_chemistry )  THEN
              ALLOCATE ( surfaces%css(1:nvar,1:surfaces%ns)   )   
              ALLOCATE ( surfaces%cssws(1:nvar,1:surfaces%ns) ) 
        ENDIF 
-#endif
 !
 !--    Arrays for storing potential temperature and
@@ -1737,9 +1732,7 @@
              IF ( passive_scalar )  surf%ss(num_h) = 0.0_wp
 
-#if defined( __chem )
              DO  lsp = 1, nvar
                 IF ( air_chemistry )  surf%css(lsp,num_h) = 0.0_wp
              ENDDO
-#endif
 !
 !--          Set initial value for surface temperature
@@ -1819,5 +1812,4 @@
                 ENDIF
 
-#if defined( __chem )
                 IF ( air_chemistry )  THEN
                    lsp_pr = 1
@@ -1849,5 +1841,4 @@
                    ENDDO
                 ENDIF
-#endif
 
                 IF ( ocean )  THEN
@@ -1920,5 +1911,4 @@
 !
 !--          Prescribe top chemical species' flux
-#if defined( __chem )
              DO  lsp = 1, nvar
                 IF ( air_chemistry  .AND.  constant_top_csflux(lsp) )  THEN 
@@ -1926,5 +1916,4 @@
                 ENDIF
              ENDDO
-#endif
 !
 !--          Prescribe top salinity flux
@@ -2063,5 +2052,4 @@
              ENDIF
 
-#if defined( __chem )
              IF ( air_chemistry )  THEN        
                 DO  lsp = 1, nvar
@@ -2070,5 +2058,4 @@
                 ENDDO
              ENDIF
-#endif
 
 !
@@ -2271,5 +2258,4 @@
                    IF ( ALLOCATED( surf_def_h(l)%ssws ) )                      &
                       surf_h(l)%ssws(mm(l))    = surf_def_h(l)%ssws(m)
-#if defined( __chem )
                    IF ( ALLOCATED( surf_def_h(l)%css ) )  THEN 
                       DO  lsp = 1,nvar
@@ -2282,5 +2268,4 @@
                       ENDDO
                    ENDIF
-#endif
                    IF ( ALLOCATED( surf_def_h(l)%ncsws ) )                     &
                       surf_h(l)%ncsws(mm(l))   = surf_def_h(l)%ncsws(m)
@@ -2328,5 +2313,4 @@
                       IF ( ALLOCATED( surf_lsm_h%ssws ) )                      &
                          surf_h(0)%ssws(mm(0))    = surf_lsm_h%ssws(m)
-#if defined( __chem )
                       IF ( ALLOCATED( surf_lsm_h%css ) )  THEN                  
                          DO  lsp = 1, nvar
@@ -2339,5 +2323,4 @@
                          ENDDO 
                       ENDIF
-#endif
                       IF ( ALLOCATED( surf_lsm_h%ncsws ) )                     &
                          surf_h(0)%ncsws(mm(0))   = surf_lsm_h%ncsws(m)
@@ -2385,5 +2368,4 @@
                       IF ( ALLOCATED( surf_usm_h%ssws ) )                      &
                          surf_h(0)%ssws(mm(0))    = surf_usm_h%ssws(m)
-#if defined( __chem )
                       IF ( ALLOCATED( surf_usm_h%css ) )  THEN             
                          DO lsp = 1, nvar
@@ -2396,5 +2378,4 @@
                          ENDDO
                       ENDIF
-#endif
                       IF ( ALLOCATED( surf_usm_h%ncsws ) )                     &
                          surf_h(0)%ncsws(mm(0))   = surf_usm_h%ncsws(m)
@@ -2474,5 +2455,4 @@
                    IF ( ALLOCATED( surf_def_v(l)%ssws ) )                      &
                       surf_v(l)%ssws(mm(l))    = surf_def_v(l)%ssws(m)
-#if defined( __chem )
                    IF ( ALLOCATED( surf_def_v(l)%css ) )  THEN               
                       DO  lsp = 1, nvar
@@ -2485,5 +2465,4 @@
                       ENDDO
                    ENDIF
-#endif
                    IF ( ALLOCATED( surf_def_v(l)%ncsws ) )                     &
                       surf_v(l)%ncsws(mm(l))   = surf_def_v(l)%ncsws(m)
@@ -2536,5 +2515,4 @@
                    IF ( ALLOCATED( surf_lsm_v(l)%ssws ) )                      &
                       surf_v(l)%ssws(mm(l))    = surf_lsm_v(l)%ssws(m)
-#if defined( __chem )
                    IF ( ALLOCATED( surf_lsm_v(l)%css ) )  THEN              
                       DO  lsp = 1, nvar
@@ -2547,5 +2525,4 @@
                       ENDDO
                    ENDIF
-#endif
                    IF ( ALLOCATED( surf_lsm_v(l)%ncsws ) )                     &
                       surf_v(l)%ncsws(mm(l))   = surf_lsm_v(l)%ncsws(m)
@@ -2598,5 +2575,4 @@
                    IF ( ALLOCATED( surf_usm_v(l)%ssws ) )                      &
                       surf_v(l)%ssws(mm(l))    = surf_usm_v(l)%ssws(m)
-#if defined( __chem )
                    IF ( ALLOCATED( surf_usm_v(l)%css ) )  THEN              
                       DO  lsp = 1, nvar
@@ -2609,5 +2585,4 @@
                       ENDDO
                    ENDIF
-#endif
                    IF ( ALLOCATED( surf_usm_v(l)%ncsws ) )                     &
                       surf_v(l)%ncsws(mm(l))   = surf_usm_v(l)%ncsws(m)
@@ -2717,5 +2692,4 @@
              WRITE ( 14 )  surf_h(l)%ssws
           ENDIF
-#if defined ( __chem )
           WRITE ( 14 )  'surf_h(' // dum // ')%css                 '
           IF ( ALLOCATED ( surf_h(l)%css ) )  THEN 
@@ -2726,5 +2700,4 @@
              WRITE ( 14 )  surf_h(l)%cssws
           ENDIF
-#endif
           WRITE ( 14 )  'surf_h(' // dum // ')%qcsws               '  
           IF ( ALLOCATED ( surf_h(l)%qcsws ) )  THEN
@@ -2814,5 +2787,4 @@
              WRITE ( 14 )  surf_v(l)%ssws
           ENDIF
-#if defined( __chem )
           WRITE ( 14 )  'surf_v(' // dum // ')%css                 '  
           IF ( ALLOCATED ( surf_v(l)%css ) )  THEN
@@ -2823,5 +2795,4 @@
              WRITE ( 14 )  surf_v(l)%cssws
           ENDIF
-#endif
           WRITE ( 14 )  'surf_v(' // dum // ')%qcsws               '  
           IF ( ALLOCATED ( surf_v(l)%qcsws ) )  THEN
@@ -3059,5 +3030,4 @@
                       IF ( ALLOCATED( surf_h(0)%ssws )  .AND.  kk == 1 )       &
                          READ ( 13 )  surf_h(0)%ssws
-#if defined( __chem )
                    CASE ( 'surf_h(0)%css' )
                       IF ( ALLOCATED( surf_h(0)%css )  .AND.  kk == 1 )        &
@@ -3066,5 +3036,4 @@
                       IF ( ALLOCATED( surf_h(0)%cssws )  .AND.  kk == 1 )      &
                          READ ( 13 )  surf_h(0)%cssws
-#endif
                    CASE ( 'surf_h(0)%qcsws' )         
                       IF ( ALLOCATED( surf_h(0)%qcsws )  .AND.  kk == 1 )      &
@@ -3138,5 +3107,4 @@
                       IF ( ALLOCATED( surf_h(1)%ssws )  .AND.  kk == 1 )       &
                          READ ( 13 )  surf_h(1)%ssws
-#if defined( __chem )
                    CASE ( 'surf_h(1)%css' )
                       IF ( ALLOCATED( surf_h(1)%css )  .AND.  kk == 1 )        &
@@ -3145,5 +3113,4 @@
                       IF ( ALLOCATED( surf_h(1)%cssws )  .AND.  kk == 1 )      &
                          READ ( 13 )  surf_h(1)%cssws
-#endif
                    CASE ( 'surf_h(1)%qcsws' )         
                       IF ( ALLOCATED( surf_h(1)%qcsws )  .AND.  kk == 1 )      &
@@ -3214,5 +3181,4 @@
                       IF ( ALLOCATED( surf_h(2)%ssws )  .AND.  kk == 1 )       &
                          READ ( 13 )  surf_h(2)%ssws
-#if defined( __chem )
                    CASE ( 'surf_h(2)%css' )
                       IF ( ALLOCATED( surf_h(2)%css )  .AND.  kk == 1 )        &
@@ -3221,5 +3187,4 @@
                       IF ( ALLOCATED( surf_h(2)%cssws )  .AND.  kk == 1 )      &
                          READ ( 13 )  surf_h(2)%cssws
-#endif
                    CASE ( 'surf_h(2)%qcsws' )         
                       IF ( ALLOCATED( surf_h(2)%qcsws )  .AND.  kk == 1 )      &
@@ -3289,5 +3254,4 @@
                       IF ( ALLOCATED( surf_v(0)%ssws )  .AND.  kk == 1 )       &
                          READ ( 13 )  surf_v(0)%ssws
-#if defined( __chem )
                    CASE ( 'surf_v(0)%css' ) 
                       IF ( ALLOCATED( surf_v(0)%css )  .AND.  kk == 1 )        &
@@ -3296,5 +3260,4 @@
                       IF ( ALLOCATED( surf_v(0)%cssws )  .AND.  kk == 1 )      &
                          READ ( 13 )  surf_v(0)%cssws
-#endif
                    CASE ( 'surf_v(0)%qcsws' )         
                       IF ( ALLOCATED( surf_v(0)%qcsws )  .AND.  kk == 1 )      &
@@ -3371,5 +3334,4 @@
                       IF ( ALLOCATED( surf_v(1)%ssws )  .AND.  kk == 1 )       &
                          READ ( 13 )  surf_v(1)%ssws
-#if defined( __chem )
                    CASE ( 'surf_v(1)%css' ) 
                       IF ( ALLOCATED( surf_v(1)%css )  .AND.  kk == 1 )        &
@@ -3378,5 +3340,4 @@
                       IF ( ALLOCATED( surf_v(1)%cssws )  .AND.  kk == 1 )      &
                          READ ( 13 )  surf_v(1)%cssws
-#endif
                    CASE ( 'surf_v(1)%qcsws' )         
                       IF ( ALLOCATED( surf_v(1)%qcsws )  .AND.  kk == 1 )      &
@@ -3453,5 +3414,4 @@
                       IF ( ALLOCATED( surf_v(2)%ssws )  .AND.  kk == 1 )       &
                          READ ( 13 )  surf_v(2)%ssws
-#if defined( __chem )
                    CASE ( 'surf_v(2)%css' ) 
                       IF ( ALLOCATED( surf_v(2)%css )  .AND.  kk == 1 )        &
@@ -3460,5 +3420,4 @@
                       IF ( ALLOCATED( surf_v(2)%cssws )  .AND.  kk == 1 )      &
                          READ ( 13 )  surf_v(2)%cssws
-#endif
                    CASE ( 'surf_v(2)%qcsws' )         
                       IF ( ALLOCATED( surf_v(2)%qcsws )  .AND.  kk == 1 )      &
@@ -3535,5 +3494,4 @@
                       IF ( ALLOCATED( surf_v(3)%ssws )  .AND.  kk == 1 )       &
                          READ ( 13 )  surf_v(3)%ssws
-#if defined( __chem )
                    CASE ( 'surf_v(3)%css' ) 
                       IF ( ALLOCATED( surf_v(3)%css )  .AND.  kk == 1 )        &
@@ -3542,5 +3500,4 @@
                       IF ( ALLOCATED( surf_v(3)%cssws )  .AND.  kk == 1 )      &
                          READ ( 13 )  surf_v(3)%cssws
-#endif
                    CASE ( 'surf_v(3)%qcsws' )         
                       IF ( ALLOCATED( surf_v(3)%qcsws )  .AND.  kk == 1 )      &
@@ -3762,5 +3719,4 @@
              ENDIF
 
-#if defined( __chem )
              IF ( INDEX( TRIM( field_chr ), '%css' ) /= 0 )  THEN 
                 IF ( ALLOCATED( surf_target%css )  .AND.                     &
@@ -3779,5 +3735,4 @@
                 ENDIF
              ENDIF
-#endif
 
              IF ( INDEX( TRIM( field_chr ), '%qcs' ) /= 0 )  THEN 
