Index: palm/trunk/SOURCE/chemistry_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/chemistry_model_mod.f90	(revision 3927)
+++ palm/trunk/SOURCE/chemistry_model_mod.f90	(revision 3929)
@@ -26,5 +26,10 @@
 ! Former revisions:
 ! -----------------
-! $Id: chemistry_model_mod.f90 3784 2019-03-05 14:16:20Z banzhafs
+! $Id$
+! Correct/complete module_interface introduction for chemistry model
+! Add subroutine chem_exchange_horiz_bounds
+! Bug fix deposition
+!
+! 3784 2019-03-05 14:16:20Z banzhafs
 ! 2D output of emission fluxes
 ! 
@@ -324,5 +329,5 @@
                 debug_output,                                                                      &
                 dt_3d, humidity, initializing_actions, message_string,                             &
-         omega, tsc, intermediate_timestep_count, intermediate_timestep_count_max,                 &
+                omega, tsc, intermediate_timestep_count, intermediate_timestep_count_max,          &
          max_pr_user, timestep_scheme, use_prescribed_profile_data, ws_scheme_sca, air_chemistry
 
@@ -458,9 +463,6 @@
     INTERFACE chem_boundary_conds
        MODULE PROCEDURE chem_boundary_conds
+       MODULE PROCEDURE chem_boundary_conds_decycle
     END INTERFACE chem_boundary_conds
-
-    INTERFACE chem_boundary_conds_decycle
-       MODULE PROCEDURE chem_boundary_conds_decycle
-    END INTERFACE chem_boundary_conds_decycle
 
     INTERFACE chem_check_data_output
@@ -526,7 +528,7 @@
     END INTERFACE chem_non_transport_physics
     
-    INTERFACE chem_exchange_horiz
-       MODULE PROCEDURE chem_exchange_horiz
-    END INTERFACE chem_exchange_horiz    
+    INTERFACE chem_exchange_horiz_bounds
+       MODULE PROCEDURE chem_exchange_horiz_bounds
+    END INTERFACE chem_exchange_horiz_bounds    
 
     INTERFACE chem_prognostic_equations
@@ -629,5 +631,5 @@
          chem_actions, chem_prognostic_equations, chem_rrd_local,             &
          chem_statistics, chem_swap_timelevel, chem_wrd_local, chem_depo,     &
-         chem_non_transport_physics, chem_exchange_horiz
+         chem_non_transport_physics, chem_exchange_horiz_bounds
 
  CONTAINS
@@ -902,172 +904,151 @@
 !> Dirichlet boundary conditions
 !------------------------------------------------------------------------------!
- SUBROUTINE chem_boundary_conds_decycle()
-
-
-    INTEGER(iwp) ::  boundary  !< 
-    INTEGER(iwp) ::  ee        !<
-    INTEGER(iwp) ::  copied    !< 
-    INTEGER(iwp) ::  i         !< 
-    INTEGER(iwp) ::  j         !< 
-    INTEGER(iwp) ::  k         !< 
-    INTEGER(iwp) ::  ss        !< 
-    INTEGER(iwp) ::  lsp       !<
-    INTEGER(iwp) ::  lsp_usr   !<
-    REAL(wp), DIMENSION(nzb:nzt+1) ::  cs_pr_init
-    REAL(wp), DIMENSION(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ::  cs_3d
-    REAL(wp) ::  flag !< flag to mask topography grid points
-
-    CALL cpu_log( log_point_s(84), 'chem.exch-horiz', 'start' )
-
-    DO  lsp = 1, nspec
-
-       CALL exchange_horiz( chem_species(lsp)%conc, nbgp )
-       lsp_usr = 1
-       DO WHILE ( TRIM( cs_name( lsp_usr ) ) /= 'novalue' )
-          IF ( TRIM(chem_species(lsp)%name) == TRIM(cs_name(lsp_usr)) )  THEN
-
-             cs_3d = chem_species(lsp)%conc_p
-             cs_pr_init = chem_species(lsp)%conc_pr_init
-
-             flag = 0.0_wp
-         !
-         !-- Left and right boundaries
-             IF ( decycle_chem_lr  .AND.  bc_lr_cyc )  THEN
-
-                DO  boundary = 1, 2
-
-                   IF ( decycle_method(boundary) == 'dirichlet' )  THEN
-         !
-         !--          Initial profile is copied to ghost and first three layers
-                      ss = 1
-                      ee = 0
-                      IF ( boundary == 1  .AND.  nxl == 0 )  THEN
-                         ss = nxlg
-                         ee = nxl+2
-                      ELSEIF ( boundary == 2  .AND.  nxr == nx )  THEN
-                         ss = nxr-2
-                         ee = nxrg
-                      ENDIF
-
-                      DO  i = ss, ee
-                         DO  j = nysg, nyng
-                            DO  k = nzb+1, nzt
-                               flag = MERGE( 1.0_wp, 0.0_wp,                            &
-                                             BTEST( wall_flags_0(k,j,i), 0 ) )
-                               cs_3d(k,j,i) = cs_pr_init(k) * flag
-                            ENDDO
-                         ENDDO
-                      ENDDO
-
-                 ELSEIF ( decycle_method(boundary) == 'neumann' )  THEN
-         !
-         !--          The value at the boundary is copied to the ghost layers to simulate
-         !--          an outlet with zero gradient
-                      ss = 1
-                      ee = 0
-                      IF ( boundary == 1  .AND.  nxl == 0 )  THEN
-                         ss = nxlg
-                         ee = nxl-1
-                         copied = nxl
-                      ELSEIF ( boundary == 2  .AND.  nxr == nx )  THEN
-                         ss = nxr+1
-                         ee = nxrg
-                         copied = nxr
-                      ENDIF
-
-                       DO  i = ss, ee
-                         DO  j = nysg, nyng
-                            DO  k = nzb+1, nzt
-                               flag = MERGE( 1.0_wp, 0.0_wp,                            &
-                                             BTEST( wall_flags_0(k,j,i), 0 ) )
-                              cs_3d(k,j,i) = cs_3d(k,j,copied) * flag
-                            ENDDO
-                         ENDDO
-                      ENDDO
-
-                   ELSE
-                      WRITE(message_string,*)                                           &
-                                          'unknown decycling method: decycle_method (', &
-                              boundary, ') ="' // TRIM( decycle_method(boundary) ) // '"'
-                      CALL message( 'chem_boundary_conds_decycle', 'CM0431',           &
-                                    1, 2, 0, 6, 0 )
-                   ENDIF
-                ENDDO
-             ENDIF
-         !
-         !-- South and north boundaries
-             IF ( decycle_chem_ns  .AND.  bc_ns_cyc )  THEN
-
-                DO  boundary = 3, 4
-
-                   IF ( decycle_method(boundary) == 'dirichlet' )  THEN
-         !
-         !--          Initial profile is copied to ghost and first three layers
-                      ss = 1
-                      ee = 0
-                      IF ( boundary == 3  .AND.  nys == 0 )  THEN
-                         ss = nysg
-                         ee = nys+2
-                      ELSEIF ( boundary == 4  .AND.  nyn == ny )  THEN
-                         ss = nyn-2
-                         ee = nyng
-                      ENDIF
-
-                      DO  i = nxlg, nxrg
-                         DO  j = ss, ee
-                            DO  k = nzb+1, nzt
-                               flag = MERGE( 1.0_wp, 0.0_wp,                            &
-                                             BTEST( wall_flags_0(k,j,i), 0 ) )
-                               cs_3d(k,j,i) = cs_pr_init(k) * flag
-                            ENDDO
-                         ENDDO
-                      ENDDO
-
-
-                 ELSEIF ( decycle_method(boundary) == 'neumann' )  THEN
-         !
-         !--          The value at the boundary is copied to the ghost layers to simulate
-         !--          an outlet with zero gradient
-                      ss = 1
-                      ee = 0
-                      IF ( boundary == 3  .AND.  nys == 0 )  THEN
-                         ss = nysg
-                         ee = nys-1
-                         copied = nys
-                      ELSEIF ( boundary == 4  .AND.  nyn == ny )  THEN
-                         ss = nyn+1
-                         ee = nyng
-                         copied = nyn
-                      ENDIF
-
-                       DO  i = nxlg, nxrg
-                         DO  j = ss, ee
-                            DO  k = nzb+1, nzt
-                               flag = MERGE( 1.0_wp, 0.0_wp,                            &
-                                             BTEST( wall_flags_0(k,j,i), 0 ) )
-                               cs_3d(k,j,i) = cs_3d(k,copied,i) * flag
-                            ENDDO
-                         ENDDO
-                      ENDDO
-
-                   ELSE
-                      WRITE(message_string,*)                                           &
-                                          'unknown decycling method: decycle_method (', &
-                              boundary, ') ="' // TRIM( decycle_method(boundary) ) // '"'
-                      CALL message( 'chem_boundary_conds_decycle', 'CM0432',           &
-                                    1, 2, 0, 6, 0 )
-                   ENDIF
-                ENDDO
-             ENDIF
-
-          ENDIF
-
-          lsp_usr = lsp_usr + 1
-
-       ENDDO
-
-    ENDDO
-
-    CALL cpu_log( log_point_s(84), 'chem.exch-horiz', 'stop' )
+ SUBROUTINE chem_boundary_conds_decycle( cs_3d, cs_pr_init )
+
+
+   INTEGER(iwp) ::  boundary  !< 
+   INTEGER(iwp) ::  ee        !<
+   INTEGER(iwp) ::  copied    !< 
+   INTEGER(iwp) ::  i         !< 
+   INTEGER(iwp) ::  j         !< 
+   INTEGER(iwp) ::  k         !< 
+   INTEGER(iwp) ::  ss        !<
+
+   REAL(wp), DIMENSION(nzb:nzt+1) ::  cs_pr_init
+   REAL(wp), DIMENSION(nzb:nzt+1,nysg:nyng,nxlg:nxrg) ::  cs_3d
+   REAL(wp) ::  flag          !< flag to mask topography grid points
+
+
+   flag = 0.0_wp
+   !
+   !-- Left and right boundaries
+   IF ( decycle_chem_lr  .AND.  bc_lr_cyc )  THEN
+
+      DO  boundary = 1, 2
+
+         IF ( decycle_method(boundary) == 'dirichlet' )  THEN
+            !
+            !--          Initial profile is copied to ghost and first three layers
+            ss = 1
+            ee = 0
+            IF ( boundary == 1  .AND.  nxl == 0 )  THEN
+               ss = nxlg
+               ee = nxl+2
+            ELSEIF ( boundary == 2  .AND.  nxr == nx )  THEN
+               ss = nxr-2
+               ee = nxrg
+            ENDIF
+
+            DO  i = ss, ee
+               DO  j = nysg, nyng
+                  DO  k = nzb+1, nzt
+                     flag = MERGE( 1.0_wp, 0.0_wp,                            &
+                          BTEST( wall_flags_0(k,j,i), 0 ) )
+                     cs_3d(k,j,i) = cs_pr_init(k) * flag
+                  ENDDO
+               ENDDO
+            ENDDO
+
+         ELSEIF ( decycle_method(boundary) == 'neumann' )  THEN
+            !
+            !--          The value at the boundary is copied to the ghost layers to simulate
+            !--          an outlet with zero gradient
+            ss = 1
+            ee = 0
+            IF ( boundary == 1  .AND.  nxl == 0 )  THEN
+               ss = nxlg
+               ee = nxl-1
+               copied = nxl
+            ELSEIF ( boundary == 2  .AND.  nxr == nx )  THEN
+               ss = nxr+1
+               ee = nxrg
+               copied = nxr
+            ENDIF
+
+            DO  i = ss, ee
+               DO  j = nysg, nyng
+                  DO  k = nzb+1, nzt
+                     flag = MERGE( 1.0_wp, 0.0_wp,                            &
+                          BTEST( wall_flags_0(k,j,i), 0 ) )
+                     cs_3d(k,j,i) = cs_3d(k,j,copied) * flag
+                  ENDDO
+               ENDDO
+            ENDDO
+
+         ELSE
+            WRITE(message_string,*)                                           &
+                 'unknown decycling method: decycle_method (', &
+                 boundary, ') ="' // TRIM( decycle_method(boundary) ) // '"'
+            CALL message( 'chem_boundary_conds_decycle', 'CM0431',           &
+                 1, 2, 0, 6, 0 )
+         ENDIF
+      ENDDO
+   ENDIF
+   !
+   !-- South and north boundaries
+   IF ( decycle_chem_ns  .AND.  bc_ns_cyc )  THEN
+
+      DO  boundary = 3, 4
+
+         IF ( decycle_method(boundary) == 'dirichlet' )  THEN
+            !
+            !--          Initial profile is copied to ghost and first three layers
+            ss = 1
+            ee = 0
+            IF ( boundary == 3  .AND.  nys == 0 )  THEN
+               ss = nysg
+               ee = nys+2
+            ELSEIF ( boundary == 4  .AND.  nyn == ny )  THEN
+               ss = nyn-2
+               ee = nyng
+            ENDIF
+
+            DO  i = nxlg, nxrg
+               DO  j = ss, ee
+                  DO  k = nzb+1, nzt
+                     flag = MERGE( 1.0_wp, 0.0_wp,                            &
+                          BTEST( wall_flags_0(k,j,i), 0 ) )
+                     cs_3d(k,j,i) = cs_pr_init(k) * flag
+                  ENDDO
+               ENDDO
+            ENDDO
+
+
+         ELSEIF ( decycle_method(boundary) == 'neumann' )  THEN
+            !
+            !--          The value at the boundary is copied to the ghost layers to simulate
+            !--          an outlet with zero gradient
+            ss = 1
+            ee = 0
+            IF ( boundary == 3  .AND.  nys == 0 )  THEN
+               ss = nysg
+               ee = nys-1
+               copied = nys
+            ELSEIF ( boundary == 4  .AND.  nyn == ny )  THEN
+               ss = nyn+1
+               ee = nyng
+               copied = nyn
+            ENDIF
+
+            DO  i = nxlg, nxrg
+               DO  j = ss, ee
+                  DO  k = nzb+1, nzt
+                     flag = MERGE( 1.0_wp, 0.0_wp,                            &
+                          BTEST( wall_flags_0(k,j,i), 0 ) )
+                     cs_3d(k,j,i) = cs_3d(k,copied,i) * flag
+                  ENDDO
+               ENDDO
+            ENDDO
+
+         ELSE
+            WRITE(message_string,*)                                           &
+                 'unknown decycling method: decycle_method (', &
+                 boundary, ') ="' // TRIM( decycle_method(boundary) ) // '"'
+            CALL message( 'chem_boundary_conds_decycle', 'CM0432',           &
+                 1, 2, 0, 6, 0 )
+         ENDIF
+      ENDDO
+   ENDIF
+
 
  END SUBROUTINE chem_boundary_conds_decycle
@@ -2422,42 +2403,44 @@
 !> Call for all grid points
 !------------------------------------------------------------------------------!
- SUBROUTINE chem_non_transport_physics()
-
-
-    INTEGER(iwp) ::  i  !<
-    INTEGER(iwp) ::  j  !<
-
-!
-!-- Calculation of chemical reactions and deposition.
-    IF ( chem_gasphase_on ) THEN
-
-       IF ( intermediate_timestep_count == 1 .OR. call_chem_at_all_substeps )  THEN
-
-          CALL cpu_log( log_point_s(19), 'chem.reactions', 'start' )
-          !$OMP PARALLEL PRIVATE (i,j)
-          !$OMP DO schedule(static,1)
-          DO  i = nxl, nxr
-             DO  j = nys, nyn
-                CALL chem_integrate( i, j )
-             ENDDO
-          ENDDO
-          !$OMP END PARALLEL
-          CALL cpu_log( log_point_s(19), 'chem.reactions', 'stop' )
-
-          IF ( deposition_dry )  THEN
-             CALL cpu_log( log_point_s(24), 'chem.deposition', 'start' )
-             DO  i = nxl, nxr
-                DO  j = nys, nyn
-                   CALL chem_depo( i, j )
-                ENDDO
-             ENDDO
-             CALL cpu_log( log_point_s(24), 'chem.deposition', 'stop' )
-          ENDIF
-
-       ENDIF
-
-    ENDIF
-
- END SUBROUTINE chem_non_transport_physics
+    SUBROUTINE chem_non_transport_physics()
+
+
+      INTEGER(iwp) ::  i  !<
+      INTEGER(iwp) ::  j  !<
+
+      !
+      !-- Calculation of chemical reactions and deposition.
+
+
+      IF ( intermediate_timestep_count == 1 .OR. call_chem_at_all_substeps )  THEN
+
+         IF ( chem_gasphase_on ) THEN
+            CALL cpu_log( log_point_s(19), 'chem.reactions', 'start' )
+            !$OMP PARALLEL PRIVATE (i,j)
+            !$OMP DO schedule(static,1)
+            DO  i = nxl, nxr
+               DO  j = nys, nyn
+                  CALL chem_integrate( i, j )
+               ENDDO
+            ENDDO
+            !$OMP END PARALLEL
+            CALL cpu_log( log_point_s(19), 'chem.reactions', 'stop' )
+         ENDIF
+
+         IF ( deposition_dry )  THEN
+            CALL cpu_log( log_point_s(24), 'chem.deposition', 'start' )
+            DO  i = nxl, nxr
+               DO  j = nys, nyn
+                  CALL chem_depo( i, j )
+               ENDDO
+            ENDDO
+            CALL cpu_log( log_point_s(24), 'chem.deposition', 'stop' )
+         ENDIF
+
+      ENDIF
+
+
+
+    END SUBROUTINE chem_non_transport_physics
 
 
@@ -2470,26 +2453,28 @@
 
 
-    INTEGER(iwp), INTENT(IN) ::  i  !< grid index in x-direction
-    INTEGER(iwp), INTENT(IN) ::  j  !< grid index in y-direction
+   INTEGER(iwp), INTENT(IN) ::  i  !< grid index in x-direction
+   INTEGER(iwp), INTENT(IN) ::  j  !< grid index in y-direction
 
 !
 !-- Calculation of chemical reactions and deposition.
-    IF ( chem_gasphase_on ) THEN
-
-       IF ( intermediate_timestep_count == 1 .OR. call_chem_at_all_substeps )  THEN
-
-          CALL cpu_log( log_point_s(19), 'chem.reactions', 'start' )
-          CALL chem_integrate( i, j )
-          CALL cpu_log( log_point_s(19), 'chem.reactions', 'stop' )
-
-          IF ( deposition_dry )  THEN
-             CALL cpu_log( log_point_s(24), 'chem.deposition', 'start' )
-             CALL chem_depo( i, j )
-             CALL cpu_log( log_point_s(24), 'chem.deposition', 'stop' )
-          ENDIF
-
-       ENDIF
-
-    ENDIF
+
+
+   IF ( intermediate_timestep_count == 1 .OR. call_chem_at_all_substeps )  THEN
+
+      IF ( chem_gasphase_on ) THEN
+         CALL cpu_log( log_point_s(19), 'chem.reactions', 'start' )
+         CALL chem_integrate( i, j )
+         CALL cpu_log( log_point_s(19), 'chem.reactions', 'stop' )
+      ENDIF
+
+      IF ( deposition_dry )  THEN
+         CALL cpu_log( log_point_s(24), 'chem.deposition', 'start' )
+         CALL chem_depo( i, j )
+         CALL cpu_log( log_point_s(24), 'chem.deposition', 'stop' )
+      ENDIF
+
+   ENDIF
+
+
 
  END SUBROUTINE chem_non_transport_physics_ij
@@ -2500,8 +2485,31 @@
 !> routine for exchange horiz of chemical quantities  
 !------------------------------------------------------------------------------! 
- SUBROUTINE chem_exchange_horiz
-
-
- END SUBROUTINE chem_exchange_horiz
+ SUBROUTINE chem_exchange_horiz_bounds
+  
+   INTEGER(iwp) ::  lsp       !<
+   INTEGER(iwp) ::  lsp_usr   !<
+ 
+!
+!--    Loop over chemical species       
+       CALL cpu_log( log_point_s(84), 'chem.exch-horiz', 'start' )
+       DO  lsp = 1, nvar
+          CALL exchange_horiz( chem_species(lsp)%conc, nbgp )    
+          lsp_usr = 1  
+          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,                     &
+                                                  chem_species(lsp)%conc_pr_init ) 
+             
+             ENDIF
+             lsp_usr = lsp_usr +1
+          ENDDO
+
+
+       ENDDO
+       CALL cpu_log( log_point_s(84), 'chem.exch-horiz', 'stop' )
+
+
+ END SUBROUTINE chem_exchange_horiz_bounds
 
  
@@ -2526,5 +2534,5 @@
     CALL cpu_log( log_point_s(25), 'chem.advec+diff+prog', 'start' )
 
-    DO  ilsp = 1, nspec
+    DO  ilsp = 1, nvar
 !
 !--    Tendency terms for chemical species
@@ -2631,5 +2639,5 @@
     INTEGER :: k
 
-    DO  ilsp = 1, nspec
+    DO  ilsp = 1, nvar
 !
 !--    Tendency-terms for chem spcs.
@@ -2878,43 +2886,4 @@
 
 
-!!! sB remove blanks again later !!!
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
 !-------------------------------------------------------------------------------!
 ! Description:
@@ -2953,5 +2922,5 @@
     INTEGER(iwp) ::  k                             !< matching k to surface m at i,j
     INTEGER(iwp) ::  lsp                           !< running index for chem spcs.
-    INTEGER(iwp) ::  lu_palm                       !< index of PALM LSM vegetation_type at current surface element
+    INTEGER(iwp) ::  luv_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
     INTEGER(iwp) ::  luw_palm                      !< index of PALM LSM water_type at current surface element
@@ -2959,5 +2928,5 @@
     INTEGER(iwp) ::  lug_palm                      !< index of PALM USM green walls/roofs at current surface element
     INTEGER(iwp) ::  lud_palm                      !< index of PALM USM windows at current surface element
-    INTEGER(iwp) ::  lu_dep                        !< matching DEPAC LU to lu_palm
+    INTEGER(iwp) ::  luv_dep                       !< matching DEPAC LU to luv_palm
     INTEGER(iwp) ::  lup_dep                       !< matching DEPAC LU to lup_palm
     INTEGER(iwp) ::  luw_dep                       !< matching DEPAC LU to luw_palm
@@ -3254,6 +3223,6 @@
 !
 !--    Initialize lu's
-       lu_palm = 0
-       lu_dep = 0
+       luv_palm = 0
+       luv_dep = 0
        lup_palm = 0
        lup_dep = 0
@@ -3268,44 +3237,44 @@
 !--    Get land use for i,j and assign to DEPAC lu
        IF ( surf_lsm_h%frac(ind_veg_wall,m) > 0 )  THEN
-          lu_palm = surf_lsm_h%vegetation_type(m)
-          IF ( lu_palm == ind_luv_user )  THEN
+          luv_palm = surf_lsm_h%vegetation_type(m)
+          IF ( luv_palm == ind_luv_user )  THEN
              message_string = 'No vegetation type defined. Please define vegetation type to enable deposition calculation'
              CALL message( 'chem_depo', 'CM0451', 1, 2, 0, 6, 0 )
-          ELSEIF ( lu_palm == ind_luv_b_soil )  THEN
-             lu_dep = 9
-          ELSEIF ( lu_palm == ind_luv_mixed_crops )  THEN
-             lu_dep = 2
-          ELSEIF ( lu_palm == ind_luv_s_grass )  THEN
-             lu_dep = 1
-          ELSEIF ( lu_palm == ind_luv_ev_needle_trees )  THEN
-             lu_dep = 4
-          ELSEIF ( lu_palm == ind_luv_de_needle_trees )  THEN
-             lu_dep = 4
-          ELSEIF ( lu_palm == ind_luv_ev_broad_trees )  THEN
-             lu_dep = 12
-          ELSEIF ( lu_palm == ind_luv_de_broad_trees )  THEN
-             lu_dep = 5
-          ELSEIF ( lu_palm == ind_luv_t_grass )  THEN
-             lu_dep = 1
-          ELSEIF ( lu_palm == ind_luv_desert )  THEN
-             lu_dep = 9
-          ELSEIF ( lu_palm == ind_luv_tundra )  THEN
-             lu_dep = 8
-          ELSEIF ( lu_palm == ind_luv_irr_crops )  THEN
-             lu_dep = 2
-          ELSEIF ( lu_palm == ind_luv_semidesert )  THEN
-             lu_dep = 8
-          ELSEIF ( lu_palm == ind_luv_ice )  THEN
-             lu_dep = 10
-          ELSEIF ( lu_palm == ind_luv_marsh )  THEN
-             lu_dep = 8
-          ELSEIF ( lu_palm == ind_luv_ev_shrubs )  THEN
-             lu_dep = 14
-          ELSEIF ( lu_palm == ind_luv_de_shrubs )  THEN
-             lu_dep = 14
-          ELSEIF ( lu_palm == ind_luv_mixed_forest )  THEN
-             lu_dep = 4
-          ELSEIF ( lu_palm == ind_luv_intrup_forest )  THEN
-             lu_dep = 8      
+          ELSEIF ( luv_palm == ind_luv_b_soil )  THEN
+             luv_dep = 9
+          ELSEIF ( luv_palm == ind_luv_mixed_crops )  THEN
+             luv_dep = 2
+          ELSEIF ( luv_palm == ind_luv_s_grass )  THEN
+             luv_dep = 1
+          ELSEIF ( luv_palm == ind_luv_ev_needle_trees )  THEN
+             luv_dep = 4
+          ELSEIF ( luv_palm == ind_luv_de_needle_trees )  THEN
+             luv_dep = 4
+          ELSEIF ( luv_palm == ind_luv_ev_broad_trees )  THEN
+             luv_dep = 12
+          ELSEIF ( luv_palm == ind_luv_de_broad_trees )  THEN
+             luv_dep = 5
+          ELSEIF ( luv_palm == ind_luv_t_grass )  THEN
+             luv_dep = 1
+          ELSEIF ( luv_palm == ind_luv_desert )  THEN
+             luv_dep = 9
+          ELSEIF ( luv_palm == ind_luv_tundra )  THEN
+             luv_dep = 8
+          ELSEIF ( luv_palm == ind_luv_irr_crops )  THEN
+             luv_dep = 2
+          ELSEIF ( luv_palm == ind_luv_semidesert )  THEN
+             luv_dep = 8
+          ELSEIF ( luv_palm == ind_luv_ice )  THEN
+             luv_dep = 10
+          ELSEIF ( luv_palm == ind_luv_marsh )  THEN
+             luv_dep = 8
+          ELSEIF ( luv_palm == ind_luv_ev_shrubs )  THEN
+             luv_dep = 14
+          ELSEIF ( luv_palm == ind_luv_de_shrubs )  THEN
+             luv_dep = 14
+          ELSEIF ( luv_palm == ind_luv_mixed_forest )  THEN
+             luv_dep = 4
+          ELSEIF ( luv_palm == ind_luv_intrup_forest )  THEN
+             luv_dep = 8      
           ENDIF
        ENDIF
@@ -3320,7 +3289,7 @@
           ELSEIF ( lup_palm == ind_lup_asph )  THEN
              lup_dep = 9
-          ELSEIF ( lup_palm ==  ind_lup_conc )  THEN
+          ELSEIF ( lup_palm == ind_lup_conc )  THEN
              lup_dep = 9
-          ELSEIF ( lup_palm ==  ind_lup_sett )  THEN
+          ELSEIF ( lup_palm == ind_lup_sett )  THEN
              lup_dep = 9
           ELSEIF ( lup_palm == ind_lup_pav_stones )  THEN
@@ -3411,4 +3380,15 @@
        IF ( surf_lsm_h%frac(ind_veg_wall,m) > 0 )  THEN
 
+!
+!--       No vegetation on bare soil, desert or ice:
+          IF ( ( luv_palm == ind_luv_b_soil ) .OR. &
+                ( luv_palm == ind_luv_desert ) .OR. &
+                 ( luv_palm == ind_luv_ice ) ) THEN
+
+             lai = 0.0_wp
+             sai = 0.0_wp
+
+          ENDIF
+          
           slinnfac = 1.0_wp
 !
@@ -3436,5 +3416,5 @@
                      particle_pars(ind_p_slip, part_type), &
                      nwet, temp_tmp, dens, visc, &
-                     lu_dep,  &
+                     luv_dep,  &
                      r_aero_surf, ustar_surf )
 
@@ -3457,5 +3437,5 @@
                      particle_pars(ind_p_slip, part_type), &
                      nwet, temp_tmp, dens, visc, &
-                     lu_dep , &
+                     luv_dep , &
                      r_aero_surf, ustar_surf )
 
@@ -3508,5 +3488,5 @@
 !
 !--             Get quasi-laminar boundary layer resistance rb:
-                CALL get_rb_cell( (lu_dep == ilu_water_sea) .OR. (lu_dep == ilu_water_inland), &
+                CALL get_rb_cell( (luv_dep == ilu_water_sea) .OR. (luv_dep == ilu_water_inland), &
                      z0h_surf, ustar_surf, diffusivity, &
                      rb )
@@ -3514,5 +3494,5 @@
 !--             Get rc_tot
                 CALL drydepos_gas_depac( spc_names(lsp), day_of_year, latitude, ts, ustar_surf, solar_rad, cos_zenith, &
-                     rh_surf, lai, sai, nwet, lu_dep, 2, rc_tot, ccomp_tot(lsp), hyp(nzb), conc_ijk_ugm3, diffusivity, &
+                     rh_surf, lai, sai, nwet, luv_dep, 2, rc_tot, ccomp_tot(lsp), hyp(nzb), conc_ijk_ugm3, diffusivity, &
                      r_aero_surf , rb )
 !
@@ -4151,4 +4131,16 @@
        IF ( surf_usm_h%frac(ind_pav_green,m) > 0 )  THEN
 
+!
+!--       No vegetation on bare soil, desert or ice:
+          IF ( ( lug_palm == ind_luv_b_soil ) .OR. &
+                ( lug_palm == ind_luv_desert ) .OR. &
+                 ( lug_palm == ind_luv_ice ) ) THEN
+
+             lai = 0.0_wp
+             sai = 0.0_wp
+
+          ENDIF
+
+          
           slinnfac = 1.0_wp
 !
Index: palm/trunk/SOURCE/module_interface.f90
===================================================================
--- palm/trunk/SOURCE/module_interface.f90	(revision 3927)
+++ palm/trunk/SOURCE/module_interface.f90	(revision 3929)
@@ -25,8 +25,11 @@
 ! -----------------
 ! $Id$
+! Correct/complete module_interface introduction for chemistry model
+!
+! 3887 2019 -04-12 08:47:41Z schwenkel
 ! Changes related to global restructuring of location messages and introduction 
 ! of additional debug messages
-! 
-! 3880 2019-04-08 21:43:02Z knoop
+!  
+! 3880 2019 -04-08 21:43:02Z knoop
 ! Add a call for salsa_prognostic_equations
 ! 
@@ -168,4 +171,5 @@
               chem_check_data_output_pr,                                       &
               chem_check_data_output,                                          &
+              chem_exchange_horiz_bounds,                                      &
               chem_init_arrays,                                                &
               chem_init,                                                       &
@@ -988,5 +992,5 @@
 
     IF ( bulk_cloud_model    )  CALL bcm_exchange_horiz()
-
+    IF ( air_chemistry       )  CALL chem_exchange_horiz_bounds()
 
  END SUBROUTINE module_interface_exchange_horiz
Index: palm/trunk/SOURCE/prognostic_equations.f90
===================================================================
--- palm/trunk/SOURCE/prognostic_equations.f90	(revision 3927)
+++ palm/trunk/SOURCE/prognostic_equations.f90	(revision 3929)
@@ -25,7 +25,10 @@
 ! -----------------
 ! $Id$
+! Correct/complete module_interface introduction for chemistry model
+! 
+! 3899 2019-04-16 14:05:27Z monakurppa
 ! Corrections in the OpenMP version of salsa
-! 
-! 3887 2019-04-12 08:47:41Z schwenkel
+!
+! 3887 2019 -04-12 08:47:41Z schwenkel
 ! Implicit Bugfix for chemistry model, loop for non_transport_physics over 
 ! ghost points is avoided. Instead introducing module_interface_exchange_horiz.
@@ -401,9 +404,6 @@
         ONLY:  buoyancy
 
-    USE chemistry_model_mod,                                                   &
-        ONLY:  chem_boundary_conds_decycle
-
     USE control_parameters,                                                    &
-        ONLY:  air_chemistry, constant_diffusion,                              &
+        ONLY:  constant_diffusion,                                             &
                debug_output, debug_string,                                     &
                dp_external, dp_level_ind_b, dp_smooth_factor, dpdxy, dt_3d,    &
@@ -554,5 +554,4 @@
     !$OMP END PARALLEL
 
-    IF ( air_chemistry )  CALL chem_boundary_conds_decycle
 !
 !-- Run SALSA and aerosol dynamic processes. SALSA is run with a longer time 
Index: palm/trunk/SOURCE/time_integration.f90
===================================================================
--- palm/trunk/SOURCE/time_integration.f90	(revision 3927)
+++ palm/trunk/SOURCE/time_integration.f90	(revision 3929)
@@ -25,7 +25,12 @@
 ! -----------------
 ! $Id$
+! Reverse changes back from revision 3878: use chem_boundary_conds instead of
+! chem_boundary_conds_decycle
+! 
+! 
+! 3885 2019-04-11 11:29:34Z kanani
 ! Changes related to global restructuring of location messages and introduction 
 ! of additional debug messages
-! 
+!
 ! 3879 2019-04-08 20:25:23Z knoop
 ! Moved wtm_forces to module_interface_actions
@@ -510,11 +515,11 @@
 
     USE chem_gasphase_mod,                                                                         &
-        ONLY:  nspec
+        ONLY:  nvar
 
     USE chem_modules,                                                                              &
-        ONLY:  bc_cs_t_val, emissions_anthropogenic, nspec_out, chem_species
+        ONLY:  bc_cs_t_val, chem_species, cs_name, emissions_anthropogenic, nspec_out
 
     USE chemistry_model_mod,                                                                       &
-        ONLY:  chem_boundary_conds_decycle
+        ONLY:  chem_boundary_conds
 
     USE control_parameters,                                                                        &
@@ -684,4 +689,6 @@
     INTEGER(iwp)      ::  icc       !< additional index for aerosol mass bins
     INTEGER(iwp)      ::  ig        !< index for salsa gases
+    INTEGER(iwp)      ::  lsp
+    INTEGER(iwp)      ::  lsp_usr   !<
     INTEGER(iwp)      ::  n         !< loop counter for chemistry species
 
@@ -861,7 +868,7 @@
            bc_q_t_val  = ( q_init(nzt+1) - q_init(nzt) ) / dzu(nzt+1)
            IF ( air_chemistry )  THEN
-              DO  n = 1, nspec
-                 bc_cs_t_val = (  chem_species(n)%conc_pr_init(nzt+1)                            &
-                                - chem_species(n)%conc_pr_init(nzt) )                            &
+              DO  lsp = 1, nvar
+                 bc_cs_t_val = (  chem_species(lsp)%conc_pr_init(nzt+1)                            &
+                                - chem_species(lsp)%conc_pr_init(nzt) )                            &
                                / dzu(nzt+1)
               ENDDO
@@ -1038,5 +1045,19 @@
           ENDIF
           IF ( passive_scalar )  CALL exchange_horiz( s_p, nbgp )
-          IF ( air_chemistry  )  CALL chem_boundary_conds_decycle
+          IF ( air_chemistry )  THEN
+             DO  lsp = 1, nvar
+                CALL exchange_horiz( chem_species(lsp)%conc_p, nbgp )
+!
+!--             kanani: Push chem_boundary_conds after CALL boundary_conds
+                lsp_usr = 1
+                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,                          &
+                                                chem_species(lsp)%conc_pr_init )
+                   ENDIF
+                   lsp_usr = lsp_usr + 1
+                ENDDO
+             ENDDO
+          ENDIF
 
           IF ( salsa  .AND.  time_since_reference_point >= skip_time_do_salsa )  THEN
@@ -1121,5 +1142,5 @@
 
                 IF ( air_chemistry )  THEN
-                   DO  n = 1, nspec
+                   DO  n = 1, nvar
                       CALL exchange_horiz( chem_species(n)%conc, nbgp ) 
                    ENDDO
