Index: palm/trunk/SOURCE/chem_gasphase_mod.f90
===================================================================
--- palm/trunk/SOURCE/chem_gasphase_mod.f90	(revision 3631)
+++ palm/trunk/SOURCE/chem_gasphase_mod.f90	(revision 3632)
@@ -1,5 +1,5 @@
 MODULE chem_gasphase_mod
  
-!   Mechanism: passive
+!   Mechanism: phstatp
 !
 !------------------------------------------------------------------------------!
@@ -44,25 +44,9 @@
 !--------------------------------------------------------------------------------!
 !
-! Current revisions:
-! ------------------
-! 
-! 
-! Former revisions:
-! -----------------
-! $Id: chem_gasphase_mod.f90 3287 2018-09-28 10:19:58Z forkel $
-! forkel June 2018: qvap,fakt added
-! forkel June 2018: reset case in  Initialize,Integrate,Update_rconst
-! 
-! 
-! 3287 2018-09-28 10:19:58Z forkel
-!
-! forkel Sept. 2017: Variables for photolyis added
-!
-!
-! Nov. 2016: Intial version (Klaus Ketelsen)
-!
-!------------------------------------------------------------------------------!
-!
-
+!
+! MODULE HEADER TEMPLATE
+!
+!  Initial version (Nov. 2016,ketelsen),for later modifications of module_header 
+!  see comments in kpp4palm/src/create_kpp_module.C
 
 ! Set kpp Double Precision to PALM Default Precision
@@ -129,6 +113,6 @@
 ! 
 ! File                 : chem_gasphase_mod_Parameters.f90
-! Time                 : Tue Sep 25 18:34:57 2018
-! Working directory    : /home/forkel-r/palmstuff/work/chemistry20180925/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Fri Nov 30 13:52:19 2018
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20181130/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
 ! Equation file        : chem_gasphase_mod.kpp
 ! Output root filename : chem_gasphase_mod
@@ -142,27 +126,27 @@
 
 ! NSPEC - Number of chemical species
-  INTEGER, PARAMETER :: nspec = 2 
+  INTEGER, PARAMETER :: nspec = 4 
 ! NVAR - Number of Variable species
-  INTEGER, PARAMETER :: nvar = 2 
+  INTEGER, PARAMETER :: nvar = 4 
 ! NVARACT - Number of Active species
-  INTEGER, PARAMETER :: nvaract = 2 
+  INTEGER, PARAMETER :: nvaract = 4 
 ! NFIX - Number of Fixed species
   INTEGER, PARAMETER :: nfix = 1 
 ! NREACT - Number of reactions
-  INTEGER, PARAMETER :: nreact = 2 
+  INTEGER, PARAMETER :: nreact = 3 
 ! NVARST - Starting of variables in conc. vect.
   INTEGER, PARAMETER :: nvarst = 1 
 ! NFIXST - Starting of fixed in conc. vect.
-  INTEGER, PARAMETER :: nfixst = 3 
+  INTEGER, PARAMETER :: nfixst = 5 
 ! NONZERO - Number of nonzero entries in Jacobian
-  INTEGER, PARAMETER :: nonzero = 2 
+  INTEGER, PARAMETER :: nonzero = 10 
 ! LU_NONZERO - Number of nonzero entries in LU factoriz. of Jacobian
-  INTEGER, PARAMETER :: lu_nonzero = 2 
+  INTEGER, PARAMETER :: lu_nonzero = 10 
 ! CNVAR - (NVAR+1) Number of elements in compressed row format
-  INTEGER, PARAMETER :: cnvar = 3 
+  INTEGER, PARAMETER :: cnvar = 5 
 ! CNEQN - (NREACT+1) Number stoicm elements in compressed col format
-  INTEGER, PARAMETER :: cneqn = 3 
+  INTEGER, PARAMETER :: cneqn = 4 
 ! NHESS - Length of Sparse Hessian
-  INTEGER, PARAMETER :: nhess = 1 
+  INTEGER, PARAMETER :: nhess = 3 
 ! NMASS - Number of atoms to check mass balance
   INTEGER, PARAMETER :: nmass = 1 
@@ -172,5 +156,7 @@
 
   INTEGER, PARAMETER, PUBLIC :: ind_pm10 = 1 
-  INTEGER, PARAMETER, PUBLIC :: ind_pm25 = 2 
+  INTEGER, PARAMETER, PUBLIC :: ind_no = 2 
+  INTEGER, PARAMETER, PUBLIC :: ind_no2 = 3 
+  INTEGER, PARAMETER, PUBLIC :: ind_o3 = 4 
 
 ! Index declaration for fixed species in C
@@ -183,8 +169,8 @@
 
 ! NJVRP - Length of sparse Jacobian JVRP
-  INTEGER, PARAMETER :: njvrp = 2 
+  INTEGER, PARAMETER :: njvrp = 4 
 
 ! NSTOICM - Length of Sparse Stoichiometric Matrix
-  INTEGER, PARAMETER :: nstoicm = 1 
+  INTEGER, PARAMETER :: nstoicm = 6 
 
 
@@ -204,6 +190,6 @@
 ! 
 ! File                 : chem_gasphase_mod_Global.f90
-! Time                 : Tue Sep 25 18:34:57 2018
-! Working directory    : /home/forkel-r/palmstuff/work/chemistry20180925/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Fri Nov 30 13:52:19 2018
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20181130/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
 ! Equation file        : chem_gasphase_mod.kpp
 ! Output root filename : chem_gasphase_mod
@@ -270,6 +256,6 @@
 ! 
 ! File                 : chem_gasphase_mod_JacobianSP.f90
-! Time                 : Tue Sep 25 18:34:57 2018
-! Working directory    : /home/forkel-r/palmstuff/work/chemistry20180925/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Fri Nov 30 13:52:19 2018
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20181130/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
 ! Equation file        : chem_gasphase_mod.kpp
 ! Output root filename : chem_gasphase_mod
@@ -285,15 +271,15 @@
 
 
-  INTEGER, PARAMETER, DIMENSION(2):: lu_irow =  (/ &
-       1, 2 /) 
-
-  INTEGER, PARAMETER, DIMENSION(2):: lu_icol =  (/ &
-       1, 2 /) 
-
-  INTEGER, PARAMETER, DIMENSION(3):: lu_crow =  (/ &
-       1, 2, 3 /) 
-
-  INTEGER, PARAMETER, DIMENSION(3):: lu_diag =  (/ &
-       1, 2, 3 /) 
+  INTEGER, PARAMETER, DIMENSION(10):: lu_irow =  (/ &
+       1, 2, 2, 2, 3, 3, 3, 4, 4, 4 /) 
+
+  INTEGER, PARAMETER, DIMENSION(10):: lu_icol =  (/ &
+       1, 2, 3, 4, 2, 3, 4, 2, 3, 4 /) 
+
+  INTEGER, PARAMETER, DIMENSION(5):: lu_crow =  (/ &
+       1, 2, 5, 8, 11 /) 
+
+  INTEGER, PARAMETER, DIMENSION(5):: lu_diag =  (/ &
+       1, 2, 6, 10, 11 /) 
 
 
@@ -314,6 +300,6 @@
 ! 
 ! File                 : chem_gasphase_mod_Monitor.f90
-! Time                 : Tue Sep 25 18:34:57 2018
-! Working directory    : /home/forkel-r/palmstuff/work/chemistry20180925/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Fri Nov 30 13:52:19 2018
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20181130/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
 ! Equation file        : chem_gasphase_mod.kpp
 ! Output root filename : chem_gasphase_mod
@@ -325,10 +311,12 @@
 
 
-  CHARACTER(len=15), PARAMETER, DIMENSION(2):: spc_names =  (/ &
-     'PM10           ','PM25           ' /)
-
-  CHARACTER(len=100), PARAMETER, DIMENSION(2):: eqn_names =  (/ &
-     'PM10 --> PM10                                                                                       ',&
-     'PM25 --> PM25                                                                                       ' /)
+  CHARACTER(len=15), PARAMETER, DIMENSION(4):: spc_names =  (/ &
+     'PM10           ','NO             ','NO2            ',&
+     'O3             ' /)
+
+  CHARACTER(len=100), PARAMETER, DIMENSION(3):: eqn_names =  (/ &
+     '    NO2 --> NO + O3                                                                                 ',&
+     'NO + O3 --> NO2                                                                                     ',&
+     '   PM10 --> PM10                                                                                    ' /)
 
 ! INLINED global variables
@@ -337,5 +325,5 @@
   !   REAL(kind=dp):: phot(nphot)must eventually be moved to global later for 
   INTEGER, PARAMETER :: nphot = 1
-  !   phot photolysis frequencies
+  !   phot photolysis frequencies 
   REAL(kind=dp):: phot(nphot)
 
@@ -374,6 +362,6 @@
 ! 
 ! File                 : chem_gasphase_mod_Initialize.f90
-! Time                 : Tue Sep 25 18:34:57 2018
-! Working directory    : /home/forkel-r/palmstuff/work/chemistry20180925/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Fri Nov 30 13:52:19 2018
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20181130/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
 ! Equation file        : chem_gasphase_mod.kpp
 ! Output root filename : chem_gasphase_mod
@@ -400,6 +388,6 @@
 ! 
 ! File                 : chem_gasphase_mod_Integrator.f90
-! Time                 : Tue Sep 25 18:34:57 2018
-! Working directory    : /home/forkel-r/palmstuff/work/chemistry20180925/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Fri Nov 30 13:52:19 2018
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20181130/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
 ! Equation file        : chem_gasphase_mod.kpp
 ! Output root filename : chem_gasphase_mod
@@ -458,6 +446,6 @@
 ! 
 ! File                 : chem_gasphase_mod_LinearAlgebra.f90
-! Time                 : Tue Sep 25 18:34:57 2018
-! Working directory    : /home/forkel-r/palmstuff/work/chemistry20180925/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Fri Nov 30 13:52:19 2018
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20181130/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
 ! Equation file        : chem_gasphase_mod.kpp
 ! Output root filename : chem_gasphase_mod
@@ -485,6 +473,6 @@
 ! 
 ! File                 : chem_gasphase_mod_Jacobian.f90
-! Time                 : Tue Sep 25 18:34:57 2018
-! Working directory    : /home/forkel-r/palmstuff/work/chemistry20180925/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Fri Nov 30 13:52:19 2018
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20181130/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
 ! Equation file        : chem_gasphase_mod.kpp
 ! Output root filename : chem_gasphase_mod
@@ -512,6 +500,6 @@
 ! 
 ! File                 : chem_gasphase_mod_Function.f90
-! Time                 : Tue Sep 25 18:34:57 2018
-! Working directory    : /home/forkel-r/palmstuff/work/chemistry20180925/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Fri Nov 30 13:52:19 2018
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20181130/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
 ! Equation file        : chem_gasphase_mod.kpp
 ! Output root filename : chem_gasphase_mod
@@ -541,6 +529,6 @@
 ! 
 ! File                 : chem_gasphase_mod_Rates.f90
-! Time                 : Tue Sep 25 18:34:57 2018
-! Working directory    : /home/forkel-r/palmstuff/work/chemistry20180925/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Fri Nov 30 13:52:19 2018
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20181130/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
 ! Equation file        : chem_gasphase_mod.kpp
 ! Output root filename : chem_gasphase_mod
@@ -567,6 +555,6 @@
 ! 
 ! File                 : chem_gasphase_mod_Util.f90
-! Time                 : Tue Sep 25 18:34:57 2018
-! Working directory    : /home/forkel-r/palmstuff/work/chemistry20180925/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Fri Nov 30 13:52:19 2018
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20181130/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
 ! Equation file        : chem_gasphase_mod.kpp
 ! Output root filename : chem_gasphase_mod
@@ -777,8 +765,12 @@
 
 ! Computation of equation rates
+  a(1) = rct(1) * v(3)
+  a(2) = rct(2) * v(2) * v(4)
 
 ! Aggregate function
   vdot(1) = 0
-  vdot(2) = 0
+  vdot(2) = a(1) - a(2)
+  vdot(3) = - a(1) + a(2)
+  vdot(4) = a(1) - a(2)
       
 END SUBROUTINE fun
@@ -791,5 +783,9 @@
   REAL(kind=dp):: x(nvar)
 
-  x(2) = x(2) / jvs(2)
+  x(3) = x(3) - jvs(5) * x(2)
+  x(4) = x(4) - jvs(8) * x(2) - jvs(9) * x(3)
+  x(4) = x(4) / jvs(10)
+  x(3) = (x(3) - jvs(7) * x(4)) /(jvs(6))
+  x(2) = (x(2) - jvs(3) * x(3) - jvs(4) * x(4)) /(jvs(2))
   x(1) = x(1) / jvs(1)
       
@@ -810,10 +806,14 @@
 ! Local variables
 ! B - Temporary array
-  REAL(kind=dp):: b(2)
-
-! B(1) = dA(1)/dV(1)
+  REAL(kind=dp):: b(4)
+
+! B(1) = dA(1)/dV(3)
   b(1) = rct(1)
 ! B(2) = dA(2)/dV(2)
-  b(2) = rct(2)
+  b(2) = rct(2) * v(4)
+! B(3) = dA(2)/dV(4)
+  b(3) = rct(2) * v(2)
+! B(4) = dA(3)/dV(1)
+  b(4) = rct(3)
 
 ! Construct the Jacobian terms from B's
@@ -821,5 +821,21 @@
   jvs(1) = 0
 ! JVS(2) = Jac_FULL(2,2)
-  jvs(2) = 0
+  jvs(2) = - b(2)
+! JVS(3) = Jac_FULL(2,3)
+  jvs(3) = b(1)
+! JVS(4) = Jac_FULL(2,4)
+  jvs(4) = - b(3)
+! JVS(5) = Jac_FULL(3,2)
+  jvs(5) = b(2)
+! JVS(6) = Jac_FULL(3,3)
+  jvs(6) = - b(1)
+! JVS(7) = Jac_FULL(3,4)
+  jvs(7) = b(3)
+! JVS(8) = Jac_FULL(4,2)
+  jvs(8) = - b(2)
+! JVS(9) = Jac_FULL(4,3)
+  jvs(9) = b(1)
+! JVS(10) = Jac_FULL(4,4)
+  jvs(10) = - b(3)
       
 END SUBROUTINE jac_sp
@@ -848,6 +864,7 @@
 ! End INLINED RCONST
 
-  rconst(1) = (1.0_dp)
-  rconst(2) = (1.0_dp)
+  rconst(1) = (phot(j_no2))
+  rconst(2) = (arr2(1.8e-12_dp , 1370.0_dp , temp))
+  rconst(3) = (1.0_dp)
       
 END SUBROUTINE update_rconst
@@ -2234,4 +2251,13 @@
 !   i = 1
 !   i = 2
+!   i = 3
+    jvs(5) = (jvs(5)) / jvs(2) 
+    jvs(6) = jvs(6) - jvs(3) * jvs(5)
+    jvs(7) = jvs(7) - jvs(4) * jvs(5)
+!   i = 4
+    jvs(8) = (jvs(8)) / jvs(2) 
+    a = 0.0; a = a  - jvs(3) * jvs(8)
+    jvs(9) = (jvs(9) + a) / jvs(6) 
+    jvs(10) = jvs(10) - jvs(4) * jvs(8) - jvs(7) * jvs(9)
     RETURN                                                            
                                                                       
Index: palm/trunk/SOURCE/data_output_mask.f90
===================================================================
--- palm/trunk/SOURCE/data_output_mask.f90	(revision 3631)
+++ palm/trunk/SOURCE/data_output_mask.f90	(revision 3632)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! Fix output time levels (use time_since_reference_point)
+! 
+! 3589 2018-11-30 15:09:51Z suehring
 ! Move the control parameter "salsa" from salsa_mod.f90 to control_parameters
 ! 
@@ -168,5 +171,7 @@
                mask_j, mask_k, mask_size, mask_size_l, mask_start_l,           &
                mask_surface,                                                   &
-               max_masks, message_string, mid, nz_do3d, salsa, simulated_time
+               max_masks, message_string, mid, nz_do3d, salsa,                 &
+               time_since_reference_point
+
     USE cpulog,                                                                &
         ONLY:  cpu_log, log_point
@@ -265,5 +270,5 @@
     IF ( myid == 0  .OR.  netcdf_data_format > 4 )  THEN
        nc_stat = NF90_PUT_VAR( id_set_mask(mid,av), id_var_time_mask(mid,av), &
-                               (/ simulated_time /),                          &
+                               (/ time_since_reference_point /),              &
                                start = (/ domask_time_count(mid,av) /),       &
                                count = (/ 1 /) )
@@ -370,5 +375,5 @@
           CASE ( 'pr' )  ! mean particle radius (effective radius)
              IF ( av == 0 )  THEN
-                IF ( simulated_time >= particle_advection_start )  THEN
+                IF ( time_since_reference_point >= particle_advection_start )  THEN
                    DO  i = nxl, nxr
                       DO  j = nys, nyn
@@ -514,5 +519,5 @@
           CASE ( 'ql_vp' )
              IF ( av == 0 )  THEN
-                IF ( simulated_time >= particle_advection_start )  THEN
+                IF ( time_since_reference_point >= particle_advection_start )  THEN
                    DO  i = nxl, nxr
                       DO  j = nys, nyn
Index: palm/trunk/TESTS/cases/urban_environment/INPUT/urban_environment_p3d
===================================================================
--- palm/trunk/TESTS/cases/urban_environment/INPUT/urban_environment_p3d	(revision 3631)
+++ palm/trunk/TESTS/cases/urban_environment/INPUT/urban_environment_p3d	(revision 3632)
@@ -30,5 +30,6 @@
 !-- Initialization
 !------------------------------------------------------------------------------
-    initializing_actions = 'inifor',   !'set_constant_profiles', or 'inifor',
+    initializing_actions = 'inifor set_constant_profiles',   !'set_constant_profiles', or 'inifor', 
+                                                             ! or both (met. from inifor, chem constant profiles)
 
     pt_surface           = 277.15,
@@ -90,9 +91,10 @@
     data_output_pr        = '#u',  'u*2',  'wu',  'w*u*',  'w"u"',
                             '#v',  'v*2',  'wv',  'w*v*',  'w"v"',
-                            'w',   'w*2',
+!                            'w',   'w*2',
                             '#theta', 'theta*2', 'wtheta', 'w*theta*', 'w"theta"',
                             '#q',  'q*2',
                             'e', 'e*', '#km', '#l',
                             '#t_soil', '#m_soil', 'rad_lw_in', 'rad_lw_out',
+                            'kc_NO', 'kc_NO2', 'kc_O3', 'kc_PM10', 
 !
 !-- 2D/3D output settings
@@ -127,7 +129,6 @@
                   'tsurf*_xy', 'tsurf*_xy_av',
                   'pcm_lad', 'pcm_heatrate',
-                  'kc_PM10', 'kc_PM25', 'kc_PM10_av', 'kc_PM25_av',
-
-
+                  'kc_NO', 'kc_NO2', 'kc_O3', 'kc_PM10', 
+                  'kc_NO_av', 'kc_NO2_av', 'kc_O3_av', 'kc_PM10_av', 
 
  / ! end of d3par namelist
@@ -206,21 +207,43 @@
  &chemistry_parameters
 
-    chem_gasphase_on           = .F.,
+    chem_gasphase_on           = .T.,
+    call_chem_at_all_substeps  = .FALSE.,
     
-    do_emis                    = .T.,
-    mode_emis                  = 'PARAMETERIZED',
-    surface_csflux_name        = 'PM10','PM25',  !"cs" stands for chemical species
-    surface_csflux             = 0.75, 0.375,    !surface emission of PM10, PM25 (arbitrary units)
-    cs_name                    = 'PM10','PM25',
-    cs_surface                 = 2.0, 1.0,       !surface concentration of PM10, PM25 (arbitrary units)
+    photolysis_scheme          = 'simple',
+
+    cs_name                    = 'NO', 'NO2', 'O3', 'PM10',
+    cs_surface                 = 0.02,  0.03, 0.02, 25.0e-9,   ! surface concentration of PM10, PM25 in kg m-3, 
+                                                               ! units for gases in ppm   
+!-- initial profiles (also for lateral boundaries if 'set_constant_profiles' is chosen)
+!-- units for PM: kg m-3, units for gases: ppm
+    cs_profile(1,:)            =  0.020, 0.020, 0.015, 0.015, 0.015, 0.010, 0.010, 0.010, 0.010, 0.010, 0.007,
+    cs_profile(2,:)            =  0.030, 0.030, 0.020, 0.020, 0.020, 0.015, 0.015, 0.015, 0.015, 0.015, 0.010,
+    cs_profile(3,:)            =  0.020, 0.020, 0.050, 0.050, 0.050, 0.050, 0.050, 0.050, 0.050, 0.050, 0.050,
+    cs_profile(1,:)            =  25.e-09, 25.e-09, 23.0e-09, 23.e-09, 23.e-09, 23.e-09, 23.e-09, 23.e-09, 22.e-09, 22.e-09, 22.0e-09, 
+
+    cs_heights(1,:)            =  0.0,   5.0,   15.0,   25.0,  35.0,  45.0,  55.0,  65.0,  75.0,  85.0, 95.0,
+    cs_heights(2,:)            =  0.0,   5.0,   15.0,   25.0,  35.0,  45.0,  55.0,  65.0,  75.0,  85.0, 95.0,
+    cs_heights(3,:)            =  0.0,   5.0,   15.0,   25.0,  35.0,  45.0,  55.0,  65.0,  75.0,  85.0, 95.0,
+    cs_heights(4,:)            =  0.0,   5.0,   15.0,   25.0,  35.0,  45.0,  55.0,  65.0,  75.0,  85.0, 95.0,
+
     bc_cs_b                    = 'neumann',
     bc_cs_t                    = 'neumann',
     
-!-- for emission depending on street type in static driver
-    emiss_factor_main = 1.667, 1.667,   !emiss_factor_main*surface_csflux for emission on main streets
-    emiss_factor_side = 0.334, 0.334,   !emiss_factor_side*surface_csflux for emission on side streets
-    main_street_id = 12,          !id is for identifying main/side streets (see chem_emissions in chemistry_model_mod.f90)
+    do_emis                    = .T.,
+    mode_emis                  = 'PARAMETERIZED',  ! emission depending on street type from static driver
+    surface_csflux_name        = 'NO',   'NO2',  'PM10',   !"cs" stands for chemical species
+    surface_csflux             = 4745.0, 1326.0, 2700.e-09,! surface emission of PM10, PM25 in kg m-2 d-1, 
+                                                           ! for gases in umol m-2 d-1 for PARAMETERIZED 
+    emiss_factor_main          = 1.667,  1.667,  1.667,    ! emiss_factor_main*surface_csflux for emission on main streets
+    emiss_factor_side          = 0.334,  0.334,  0.334,    !emiss_factor_side*surface_csflux for emission on side streets
+    main_street_id = 12,       ! id is for identifying main/side streets (see chem_emissions in chemistry_model_mod.f90)
     side_street_id =  8,
-    max_street_id = 19,
+    max_street_id  = 19,
+
+! -- KPP solver steering. For details  see comments in chem_gasphase_mod.f90, SUBROUTINE rosenbrock 
+!                         (or other solver subroutine, if another solver is chosen)
+    icntrl(3)                  = 1,   ! solver ros2
+    icntrl(4)                  = 500, ! max. number of chem-substeps
+    rcntrl(3)                  = 0.1, ! Hstart,starting value for the integration step size
 
  / ! end of chemistry_par namelist
Index: palm/trunk/TESTS/cases/urban_environment/case_config.yml
===================================================================
--- palm/trunk/TESTS/cases/urban_environment/case_config.yml	(revision 3631)
+++ palm/trunk/TESTS/cases/urban_environment/case_config.yml	(revision 3632)
@@ -16,5 +16,5 @@
 
 significant_digits_for_netcdf_checks:
-  timeseries: 6
-  profiles: 6
-  other: 8
+  timeseries: 5
+  profiles: 5
+  other: 2
Index: palm/trunk/TESTS/cases/urban_environment_restart/INPUT/urban_environment_restart_p3dr
===================================================================
--- palm/trunk/TESTS/cases/urban_environment_restart/INPUT/urban_environment_restart_p3dr	(revision 3631)
+++ palm/trunk/TESTS/cases/urban_environment_restart/INPUT/urban_environment_restart_p3dr	(revision 3632)
@@ -90,9 +90,10 @@
     data_output_pr        = '#u',  'u*2',  'wu',  'w*u*',  'w"u"',
                             '#v',  'v*2',  'wv',  'w*v*',  'w"v"',
-                            'w',   'w*2',
+!                            'w',   'w*2',
                             '#theta', 'theta*2', 'wtheta', 'w*theta*', 'w"theta"',
                             '#q',  'q*2',
                             'e', 'e*', '#km', '#l',
                             '#t_soil', '#m_soil', 'rad_lw_in', 'rad_lw_out',
+                            'kc_NO', 'kc_NO2', 'kc_O3', 'kc_PM10', 
 !
 !-- 2D/3D output settings
@@ -127,7 +128,6 @@
                   'tsurf*_xy', 'tsurf*_xy_av',
                   'pcm_lad', 'pcm_heatrate',
-                  'kc_PM10', 'kc_PM25', 'kc_PM10_av', 'kc_PM25_av',
-
-
+                  'kc_NO', 'kc_NO2', 'kc_O3', 'kc_PM10', 
+                  'kc_NO_av', 'kc_NO2_av', 'kc_O3_av', 'kc_PM10_av', 
 
  / ! end of d3par namelist
@@ -206,21 +206,43 @@
  &chemistry_parameters
 
-    chem_gasphase_on           = .F.,
+    chem_gasphase_on           = .T.,
+    call_chem_at_all_substeps  = .FALSE.,
     
-    do_emis                    = .T.,
-    mode_emis                  = 'PARAMETERIZED',
-    surface_csflux_name        = 'PM10','PM25',  !"cs" stands for chemical species
-    surface_csflux             = 0.75, 0.375,    !surface emission of PM10, PM25 (arbitrary units)
-    cs_name                    = 'PM10','PM25',
-    cs_surface                 = 2.0, 1.0,       !surface concentration of PM10, PM25 (arbitrary units)
+    photolysis_scheme          = 'simple',
+
+    cs_name                    = 'NO', 'NO2', 'O3', 'PM10',
+    cs_surface                 = 0.02,  0.03, 0.02, 25.0e-9,   ! surface concentration of PM10, PM25 in kg m-3, 
+                                                               ! units for gases in ppm   
+!-- initial profiles (also for lateral boundaries if 'set_constant_profiles' is chosen)
+!-- units for PM: kg m-3, units for gases: ppm
+    cs_profile(1,:)            =  0.020, 0.020, 0.015, 0.015, 0.015, 0.010, 0.010, 0.010, 0.010, 0.010, 0.007,
+    cs_profile(2,:)            =  0.030, 0.030, 0.020, 0.020, 0.020, 0.015, 0.015, 0.015, 0.015, 0.015, 0.010,
+    cs_profile(3,:)            =  0.020, 0.020, 0.050, 0.050, 0.050, 0.050, 0.050, 0.050, 0.050, 0.050, 0.050,
+    cs_profile(1,:)            =  25.e-09, 25.e-09, 23.0e-09, 23.e-09, 23.e-09, 23.e-09, 23.e-09, 23.e-09, 22.e-09, 22.e-09, 22.0e-09, 
+
+    cs_heights(1,:)            =  0.0,   5.0,   15.0,   25.0,  35.0,  45.0,  55.0,  65.0,  75.0,  85.0, 95.0,
+    cs_heights(2,:)            =  0.0,   5.0,   15.0,   25.0,  35.0,  45.0,  55.0,  65.0,  75.0,  85.0, 95.0,
+    cs_heights(3,:)            =  0.0,   5.0,   15.0,   25.0,  35.0,  45.0,  55.0,  65.0,  75.0,  85.0, 95.0,
+    cs_heights(4,:)            =  0.0,   5.0,   15.0,   25.0,  35.0,  45.0,  55.0,  65.0,  75.0,  85.0, 95.0,
+
     bc_cs_b                    = 'neumann',
     bc_cs_t                    = 'neumann',
     
-!-- for emission depending on street type in static driver
-    emiss_factor_main = 1.667, 1.667,   !emiss_factor_main*surface_csflux for emission on main streets
-    emiss_factor_side = 0.334, 0.334,   !emiss_factor_side*surface_csflux for emission on side streets
-    main_street_id = 12,          !id is for identifying main/side streets (see chem_emissions in chemistry_model_mod.f90)
+    do_emis                    = .T.,
+    mode_emis                  = 'PARAMETERIZED',  ! emission depending on street type from static driver
+    surface_csflux_name        = 'NO',   'NO2',  'PM10',   !"cs" stands for chemical species
+    surface_csflux             = 4745.0, 1326.0, 2700.e-09,! surface emission of PM10, PM25 in kg m-2 d-1, 
+                                                           ! for gases in umol m-2 d-1 for PARAMETERIZED 
+    emiss_factor_main          = 1.667,  1.667,  1.667,    ! emiss_factor_main*surface_csflux for emission on main streets
+    emiss_factor_side          = 0.334,  0.334,  0.334,    !emiss_factor_side*surface_csflux for emission on side streets
+    main_street_id = 12,       ! id is for identifying main/side streets (see chem_emissions in chemistry_model_mod.f90)
     side_street_id =  8,
-    max_street_id = 19,
+    max_street_id  = 19,
+
+! -- KPP solver steering. For details  see comments in chem_gasphase_mod.f90, SUBROUTINE rosenbrock 
+!                         (or other solver subroutine, if another solver is chosen)
+    icntrl(3)                  = 1,   ! solver ros2
+    icntrl(4)                  = 500, ! max. number of chem-substeps
+    rcntrl(3)                  = 0.1, ! Hstart,starting value for the integration step size
 
  / ! end of chemistry_par namelist
Index: palm/trunk/TESTS/cases/urban_environment_restart/case_config.yml
===================================================================
--- palm/trunk/TESTS/cases/urban_environment_restart/case_config.yml	(revision 3631)
+++ palm/trunk/TESTS/cases/urban_environment_restart/case_config.yml	(revision 3632)
@@ -18,5 +18,5 @@
 
 significant_digits_for_netcdf_checks:
-  timeseries: 6
-  profiles: 6
+  timeseries: 4
+  profiles: 4
   other: 8
