Index: /palm/trunk/SOURCE/salsa_mod.f90
===================================================================
--- /palm/trunk/SOURCE/salsa_mod.f90	(revision 4477)
+++ /palm/trunk/SOURCE/salsa_mod.f90	(revision 4478)
@@ -26,4 +26,9 @@
 ! -----------------
 ! $Id$
+! Bug fixes:
+! - call salsa_driver in salsa_init also for the ghost points
+! - decycle flags missing from advec_s_ws call in salsa_tendency
+! 
+! 4457 2020-03-11 14:20:43Z raasch
 ! use statement for exchange horiz added
 ! 
@@ -1810,6 +1815,6 @@
 
 !-- Initalisation run of SALSA + calculate the vertical top index of the topography
-    DO  i = nxl, nxr
-       DO  j = nys, nyn
+    DO  i = nxlg, nxrg
+       DO  j = nysg, nyng
 
           k_topo_top(j,i) = MAXLOC( MERGE( 1, 0, BTEST( wall_flags_total_0(:,j,i), 12 ) ), &
@@ -8095,9 +8100,10 @@
     IF ( timestep_scheme(1:5) == 'runge' )  THEN
        IF ( ws_scheme_sca )  THEN
-          CALL advec_s_ws( salsa_advc_flags_s, i, j, rs, id, flux_s, diss_s, flux_l, diss_l,       &
-                           i_omp_start, tn, bc_dirichlet_l  .OR.  bc_radiation_l,                  &
-                           bc_dirichlet_n  .OR.  bc_radiation_n,                                   &
-                           bc_dirichlet_r  .OR.  bc_radiation_r,                                   &
-                           bc_dirichlet_s  .OR.  bc_radiation_s, monotonic_limiter_z )
+          CALL advec_s_ws( salsa_advc_flags_s, i, j, rs, id,                                       &
+                           flux_s, diss_s, flux_l, diss_l, i_omp_start, tn,                        &
+                           bc_dirichlet_l  .OR.  bc_radiation_l  .OR.  decycle_salsa_lr,           &
+                           bc_dirichlet_n  .OR.  bc_radiation_n  .OR.  decycle_salsa_ns,           &
+                           bc_dirichlet_r  .OR.  bc_radiation_r  .OR.  decycle_salsa_lr,           &
+                           bc_dirichlet_s  .OR.  bc_radiation_s  .OR.  decycle_salsa_ns )
        ELSE
           CALL advec_s_pw( i, j, rs )
@@ -8230,8 +8236,9 @@
     IF ( timestep_scheme(1:5) == 'runge' )  THEN
        IF ( ws_scheme_sca )  THEN
-          CALL advec_s_ws( salsa_advc_flags_s, rs, id, bc_dirichlet_l  .OR.  bc_radiation_l,       &
-                           bc_dirichlet_n  .OR.  bc_radiation_n,                                   &
-                           bc_dirichlet_r  .OR.  bc_radiation_r,                                   &
-                           bc_dirichlet_s  .OR.  bc_radiation_s )
+          CALL advec_s_ws( salsa_advc_flags_s, rs, id,                                             &
+                           bc_dirichlet_l  .OR.  bc_radiation_l  .OR.  decycle_salsa_lr,           &
+                           bc_dirichlet_n  .OR.  bc_radiation_n  .OR.  decycle_salsa_ns,           &
+                           bc_dirichlet_r  .OR.  bc_radiation_r  .OR.  decycle_salsa_lr,           &
+                           bc_dirichlet_s  .OR.  bc_radiation_s  .OR.  decycle_salsa_ns )
        ELSE
           CALL advec_s_pw( rs )
Index: /palm/trunk/TESTS/cases/urban_environment_salsa/INPUT/urban_environment_salsa_p3d
===================================================================
--- /palm/trunk/TESTS/cases/urban_environment_salsa/INPUT/urban_environment_salsa_p3d	(revision 4477)
+++ /palm/trunk/TESTS/cases/urban_environment_salsa/INPUT/urban_environment_salsa_p3d	(revision 4478)
@@ -20,8 +20,8 @@
 !------------------------------------------------------------------------------
     fft_method           = 'fftw',
-    monotonic_limiter_z  = .T., 
+    monotonic_limiter_z  = .T.,
 !
 !-- Mode
-!------------------------------------------------------------------------------     
+!------------------------------------------------------------------------------
     humidity             = .T.,
     q_surface            = 0.001,
@@ -30,5 +30,5 @@
 !-- Initialization
 !------------------------------------------------------------------------------
-    initializing_actions = 'inifor set_constant_profiles',   !'set_constant_profiles', or 'inifor', 
+    initializing_actions = 'inifor set_constant_profiles',   !'set_constant_profiles', or 'inifor',
                                                              ! or both (met. from inifor, chem constant profiles)
 
@@ -41,5 +41,5 @@
 !
 !-- Wall/soil spinup
-!------------------------------------------------------------------------------    
+!------------------------------------------------------------------------------
     spinup_time         = 1200.0,
     spinup_pt_mean      = 284.15,
@@ -50,5 +50,5 @@
 !
 !-- Topography
-!------------------------------------------------------------------------------    
+!------------------------------------------------------------------------------
     topography           = 'read_from_file',
 
@@ -95,13 +95,13 @@
                             'e', 'e*', '#km', '#l',
                             '#t_soil', '#m_soil', 'rad_lw_in', 'rad_lw_out',
-                            'salsa_Ntot', 'salsa_N_UFP', 'salsa_LDSA', 
-                            'salsa_PM0.1', 'salsa_PM2.5', 'salsa_PM10', 
+                            'salsa_Ntot', 'salsa_N_UFP', 'salsa_LDSA',
+                            'salsa_PM0.1', 'salsa_PM2.5', 'salsa_PM10',
 !
 !-- 2D/3D output settings
 !------------------------------------------------------------------------------
-    do3d_at_begin      = .T., 
+    do3d_at_begin      = .T.,
     do2d_at_begin      = .T.,
 
-    dt_data_output     = 60.0, 
+    dt_data_output     = 60.0,
     dt_data_output_av  = 60.0,
     averaging_interval = 60.0,
@@ -113,5 +113,5 @@
 !                   'Ntot', 'PM2.5', 'LDSA',
 !                   's_OC','g_OCNV','g_OCSV',
-!                   'N_bin3', 'm_bin4', 
+!                   'N_bin3', 'm_bin4',
 
 
@@ -143,6 +143,6 @@
 !-- LAND SURFACE MODEL PARAMETER NAMELIST
 !   Documentation: https://palm.muk.uni-hannover.de/trac/wiki/doc/app/lsmpar
-!------------------------------------------------------------------------------- 
- &land_surface_parameters 
+!-------------------------------------------------------------------------------
+ &land_surface_parameters
 
     constant_roughness     = .T.,
@@ -154,8 +154,8 @@
 
     root_fraction          = 0.49, 0.26, 0.25, 0.0, 0.0, 0.0, 0.0, 0.0,
-    soil_temperature       = 277.15, 277.0, 277.0, 277.0, 277.0, 277.0, 277.0, 277.0, 
+    soil_temperature       = 277.15, 277.0, 277.0, 277.0, 277.0, 277.0, 277.0, 277.0,
     soil_moisture          = 0.30,   0.30,  0.30,  0.30,  0.30, 0.30,  0.30,  0.30,
     deep_soil_temperature  = 277.0,
-    
+
  / ! end of lsm_par namelist
 
@@ -171,5 +171,5 @@
 
  / ! end of urban_surface_par namelist
- 
+
 
 !-------------------------------------------------------------------------------
@@ -178,15 +178,15 @@
 !-------------------------------------------------------------------------------
  &plant_canopy_parameters
- 
+
     canopy_mode       = 'read_from_file',
     canopy_drag_coeff = 0.3,
-      
+
  / ! end of canopy_par namelist
- 
+
 
 !-------------------------------------------------------------------------------
 !-- SALSA PARAMETER NAMELIST
 !-------------------------------------------------------------------------------
- &salsa_parameters  
+ &salsa_parameters
 
 !
@@ -196,35 +196,35 @@
 
 !
-!-- If initializing_actions includes 'set_constant_profiles' , 
+!-- If initializing_actions includes 'set_constant_profiles' ,
 !-- define the initial aerosol size distribution by dpg, sigmag and n_lognorm
     dpg                  = 13.5E-9, 54.0E-9, 864.1E-9, ! mean diameter per mode (in metres)
-    sigmag               =     1.8,    2.16,     2.21, ! standard deviation per mode 
+    sigmag               =     1.8,    2.16,     2.21, ! standard deviation per mode
     n_lognorm            =  1.43E9,  4.45E8,    7.0E4, ! number concentration per mode (#/m3)
 
 !
-!-- If initializing_actions includes 'set_constant_profiles', apply these initial gas concentrations			
+!-- If initializing_actions includes 'set_constant_profiles', apply these initial gas concentrations
     H2SO4_init           = 5.0E12, ! sulphuric acid (#/m3)
     HNO3_init            = 3.0E12, ! nitric acid (#/m3)
-    NH3_init             = 6.0E12, ! ammonia (#/m3)        
+    NH3_init             = 6.0E12, ! ammonia (#/m3)
     OCNV_init            = 1.0E12, ! non-volatile organic gases (#/m3)
     OCSV_init            = 1.0E12, ! non-volatile organic gases (#/m3)
 
 !
-!-- List of activated chemical components: 
+!-- List of activated chemical components:
 !-- NOTE! Chemical species have to be activated here even if they are not initially present!
-    listspec             = 'OC','NO','NH','','','','',       
-    ! listspec             = 'SO4','OC','BC','DU','SS','NO','NH', 
+    listspec             = 'OC','NO','NH','','','','',
+    ! listspec             = 'SO4','OC','BC','DU','SS','NO','NH',
 
 !
 !-- Sectional presentation of the particle size distribution
     reglim               = 3.0E-9, 1.0E-8, 2.5E-6, ! limits of the subranges (m)
-    nbin                 = 1, 7,                   ! number of bins per subrange 
+    nbin                 = 1, 7,                   ! number of bins per subrange
 !-- NOTE! Subrange 1 consists only of H2SO4 and/or OC
-    nf2a                 = 1.0,	                   ! Number fraction allocated to subrange 2a 
+    nf2a                 = 1.0,                    ! Number fraction allocated to subrange 2a
 
 !
 !-- Aerosol emissions:
     salsa_emission_mode  = 'read_from_file', ! 'no_emission','uniform' or 'read_from_file'
-!-- NOTE! chemical components of the source have to be activated in 'listspec' 
+!-- NOTE! chemical components of the source have to be activated in 'listspec'
 !--       and have to be in the same order
 
@@ -237,15 +237,11 @@
 !
 !-- Boundary conditions
-!-- Decycle at the left & right boundaries: initial concentration  
-!--   is copied to ghost and first three layers at both boundaries at the left boundary
-!--   and a zero gradient is set at the right boundary
-!-- Decycle at the north & south boundaries: initial concentration  
-!--   is copied to ghost and first three layers at both boundaries
-    decycle_salsa_lr     = .T.,         
+!-- Decycle at the left & right boundaries:
+    decycle_salsa_lr     = .T.,
     decycle_salsa_ns     = .F.,
-    decycle_method_salsa = 'dirichlet','dirichlet','dirichlet','dirichlet',  
+    decycle_method_salsa = 'dirichlet','dirichlet','dirichlet','dirichlet',
     bc_salsa_b           = 'neumann',    ! surface flux requires 'neumann'
     bc_salsa_t           = 'dirichlet',  ! top
-											   
+
 !
 !-- Switches for aerosol processes:
@@ -259,5 +255,5 @@
     nlcoag               = .F., ! Coagulation master switch
     nsnucl               =  0,  ! Nucleation scheme (0 = off)
-    nj3                  =  1,  ! J3 parametrization for nucleation 
+    nj3                  =  1,  ! J3 parametrization for nucleation
 
 !
@@ -265,10 +261,10 @@
     depo_pcm_par         = 'zhang2001',  ! plant canopy
     depo_surf_par        = 'zhang2001',  ! ground, roofs and walls
-    season_z01           = 5             ! Season for zhang2001, 
+    season_z01           = 5             ! Season for zhang2001,
                                          ! 1 = summer, 2 = autumn, 3 = late autumn
                                          ! 4 = winter, 5 = transitional spring
 !
 !-- Other switches:
-    advect_particle_water   = .T.,   ! particle water: advect or calculate at each dt_salsa 
+    advect_particle_water   = .T.,   ! particle water: advect or calculate at each dt_salsa
     feedback_to_palm        = .F.,   ! feedback to flow due to condensation of water
     nesting_salsa           = .F.,   ! apply self-nesting for salsa variables
@@ -276,6 +272,4 @@
     write_binary_salsa      = .F.,   ! skip writing restart data even if it's done for the flow
     nesting_offline_salsa   = .F.,   ! apply offline nesting for salsa
-         
+
  / ! end of salsa_par namelist
-
- 
Index: /palm/trunk/TESTS/cases/urban_environment_salsa/MONITORING/urban_environment_salsa_rc.000
===================================================================
--- /palm/trunk/TESTS/cases/urban_environment_salsa/MONITORING/urban_environment_salsa_rc.000	(revision 4477)
+++ /palm/trunk/TESTS/cases/urban_environment_salsa/MONITORING/urban_environment_salsa_rc.000	(revision 4478)
@@ -1,9 +1,9 @@
 
  ******************************    --------------------------------------------
- * PALM 6.0  Rev: 4379M       *    atmosphere - run without 1D - prerun
+ * PALM 6.0  Rev: 4477M       *    atmosphere - run without 1D - prerun
  ******************************    --------------------------------------------
 
- Date:               2020-01-17    Run:       urban_environment_salsa           
- Time:                 18:25:39    Run-No.:   00
+ Date:               2020-03-27    Run:       urban_environment_salsa           
+ Time:                 15:56:23    Run-No.:   00
  Run on host:           default
  Number of PEs:               4    Processor grid (x,y): (   2,   2) calculated
@@ -13,5 +13,5 @@
  -----------------
 
- --> Use the Moeng_Wyngaard turbulence closure (LES mode).
+ --> Use the 1.5-order turbulence closure (LES mode).
  --> Use the boussinesq approximation for the model equations.
  --> Solve perturbation pressure via FFT using fftw routines
@@ -190,5 +190,5 @@
  ---------------------------
 
-    Mixing length is limited to 1.80 * z
+    Mixing length is limited close to surfaces
 
 
