Index: palm/trunk/SOURCE/chem_gasphase_mod.f90
===================================================================
--- palm/trunk/SOURCE/chem_gasphase_mod.f90	(revision 3819)
+++ palm/trunk/SOURCE/chem_gasphase_mod.f90	(revision 3820)
@@ -82,5 +82,5 @@
   PUBLIC :: chem_gasphase_integrate
   PUBLIC :: initialize_kpp_ctrl
-  PUBLIC :: get_mechanismname
+  PUBLIC :: get_mechanism_name
 
 ! END OF MODULE HEADER TEMPLATE
@@ -114,6 +114,6 @@
 ! 
 ! File                 : chem_gasphase_mod_Parameters.f90
-! Time                 : Fri Mar 15 16:28:29 2019
-! Working directory    : /home/forkel-r/palmstuff/work/trunk20190315/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Wed Mar 27 09:51:40 2019
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20190327/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
 ! Equation file        : chem_gasphase_mod.kpp
 ! Output root filename : chem_gasphase_mod
@@ -191,6 +191,6 @@
 ! 
 ! File                 : chem_gasphase_mod_Global.f90
-! Time                 : Fri Mar 15 16:28:29 2019
-! Working directory    : /home/forkel-r/palmstuff/work/trunk20190315/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Wed Mar 27 09:51:40 2019
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20190327/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
 ! Equation file        : chem_gasphase_mod.kpp
 ! Output root filename : chem_gasphase_mod
@@ -256,6 +256,6 @@
 ! 
 ! File                 : chem_gasphase_mod_JacobianSP.f90
-! Time                 : Fri Mar 15 16:28:29 2019
-! Working directory    : /home/forkel-r/palmstuff/work/trunk20190315/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Wed Mar 27 09:51:40 2019
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20190327/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
 ! Equation file        : chem_gasphase_mod.kpp
 ! Output root filename : chem_gasphase_mod
@@ -300,6 +300,6 @@
 ! 
 ! File                 : chem_gasphase_mod_Monitor.f90
-! Time                 : Fri Mar 15 16:28:29 2019
-! Working directory    : /home/forkel-r/palmstuff/work/trunk20190315/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Wed Mar 27 09:51:40 2019
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20190327/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
 ! Equation file        : chem_gasphase_mod.kpp
 ! Output root filename : chem_gasphase_mod
@@ -362,6 +362,6 @@
 ! 
 ! File                 : chem_gasphase_mod_Initialize.f90
-! Time                 : Fri Mar 15 16:28:29 2019
-! Working directory    : /home/forkel-r/palmstuff/work/trunk20190315/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Wed Mar 27 09:51:40 2019
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20190327/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
 ! Equation file        : chem_gasphase_mod.kpp
 ! Output root filename : chem_gasphase_mod
@@ -388,6 +388,6 @@
 ! 
 ! File                 : chem_gasphase_mod_Integrator.f90
-! Time                 : Fri Mar 15 16:28:29 2019
-! Working directory    : /home/forkel-r/palmstuff/work/trunk20190315/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Wed Mar 27 09:51:40 2019
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20190327/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
 ! Equation file        : chem_gasphase_mod.kpp
 ! Output root filename : chem_gasphase_mod
@@ -446,6 +446,6 @@
 ! 
 ! File                 : chem_gasphase_mod_LinearAlgebra.f90
-! Time                 : Fri Mar 15 16:28:29 2019
-! Working directory    : /home/forkel-r/palmstuff/work/trunk20190315/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Wed Mar 27 09:51:40 2019
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20190327/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
 ! Equation file        : chem_gasphase_mod.kpp
 ! Output root filename : chem_gasphase_mod
@@ -473,6 +473,6 @@
 ! 
 ! File                 : chem_gasphase_mod_Jacobian.f90
-! Time                 : Fri Mar 15 16:28:29 2019
-! Working directory    : /home/forkel-r/palmstuff/work/trunk20190315/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Wed Mar 27 09:51:40 2019
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20190327/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
 ! Equation file        : chem_gasphase_mod.kpp
 ! Output root filename : chem_gasphase_mod
@@ -500,6 +500,6 @@
 ! 
 ! File                 : chem_gasphase_mod_Function.f90
-! Time                 : Fri Mar 15 16:28:29 2019
-! Working directory    : /home/forkel-r/palmstuff/work/trunk20190315/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Wed Mar 27 09:51:40 2019
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20190327/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
 ! Equation file        : chem_gasphase_mod.kpp
 ! Output root filename : chem_gasphase_mod
@@ -529,6 +529,6 @@
 ! 
 ! File                 : chem_gasphase_mod_Rates.f90
-! Time                 : Fri Mar 15 16:28:29 2019
-! Working directory    : /home/forkel-r/palmstuff/work/trunk20190315/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Wed Mar 27 09:51:40 2019
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20190327/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
 ! Equation file        : chem_gasphase_mod.kpp
 ! Output root filename : chem_gasphase_mod
@@ -555,6 +555,6 @@
 ! 
 ! File                 : chem_gasphase_mod_Util.f90
-! Time                 : Fri Mar 15 16:28:29 2019
-! Working directory    : /home/forkel-r/palmstuff/work/trunk20190315/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Wed Mar 27 09:51:40 2019
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20190327/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
 ! Equation file        : chem_gasphase_mod.kpp
 ! Output root filename : chem_gasphase_mod
@@ -662,7 +662,7 @@
   END INTERFACE        kppdecomp
  
-  INTERFACE            get_mechanismname
-    MODULE PROCEDURE   get_mechanismname
-  END INTERFACE        get_mechanismname
+  INTERFACE            get_mechanism_name
+    MODULE PROCEDURE   get_mechanism_name
+  END INTERFACE        get_mechanism_name
  
   INTERFACE            chem_gasphase_integrate
@@ -690,5 +690,5 @@
 !  
 ! Following line is just to avoid compiler message about unused variables
-IF ( lu_crow(1) == 1  .OR.  lu_icol(1) == 1  .OR.  lu_irow(1) == 1 )  CONTINUE 
+   IF ( lu_crow(1) == 1  .OR.  lu_icol(1) == 1  .OR.  lu_irow(1) == 1 )  CONTINUE 
 !  
 
@@ -778,5 +778,5 @@
 
 ! Following line is just to avoid compiler message about unused variables
-IF ( f(nfix) > 0.0_dp )  CONTINUE
+   IF ( f(nfix) > 0.0_dp )  CONTINUE
 !  
 ! Computation of equation rates
@@ -825,5 +825,5 @@
 !
 ! Following line is just to avoid compiler message about unused variables
-IF ( f(nfix) > 0.0_dp )  CONTINUE
+   IF ( f(nfix) > 0.0_dp )  CONTINUE
 
 ! B(1) = dA(1)/dV(3)
@@ -972,5 +972,5 @@
 !  
 ! Following line is just to avoid compiler message about unused variables
-IF ( incx == 0 )  CONTINUE
+   IF ( incx == 0 )  CONTINUE
 
       IF (alpha .eq. one)RETURN
@@ -1038,5 +1038,5 @@
 !  
 ! Following line is just to avoid compiler message about unused variables
-IF ( incx == 0  .OR.  incy == 0 )  CONTINUE
+   IF ( incx == 0  .OR.  incy == 0 )  CONTINUE
       IF (alpha .eq. zero)RETURN
       IF (n .le. 0)RETURN
@@ -1773,5 +1773,5 @@
 !  
 ! Following line is just to avoid compiler message about unused variables
-IF ( pivot(1) == 0 )  CONTINUE
+   IF ( pivot(1) == 0 )  CONTINUE
 
 #ifdef full_algebra    
@@ -2291,5 +2291,5 @@
   END SUBROUTINE kppdecomp                                            
  
-SUBROUTINE get_mechanismname                                        
+SUBROUTINE get_mechanism_name                                       
                                                                     
   IMPLICIT NONE                                                     
@@ -2299,5 +2299,5 @@
                                                                     
   RETURN                                                            
-END SUBROUTINE get_mechanismname                                    
+END SUBROUTINE get_mechanism_name                                   
                                                                     
  
Index: palm/trunk/SOURCE/chem_modules.f90
===================================================================
--- palm/trunk/SOURCE/chem_modules.f90	(revision 3819)
+++ palm/trunk/SOURCE/chem_modules.f90	(revision 3820)
@@ -27,10 +27,12 @@
 ! -----------------
 ! $Id$
+! renamed do_emis to emissions_anthropogenic, removed USE statistics, variables sorted by type 
+!
+! 
+! 3780 2019-03-05 11:19:45Z forkel
 ! added cs_mech
-! 
 ! 
 ! 3652 2019-01-07 15:29:59Z forkel
 ! parameter chem_mechanism added (basit)
-! 
 ! 
 ! 3636 2018-12-19 13:48:34Z raasch
@@ -60,4 +62,5 @@
 ! @author Sabine Banzhaf
 ! @author Emmanuele Russo
+! @author Edward C. Chan
 !
 !------------------------------------------------------------------------------!
@@ -77,8 +80,4 @@
     USE kinds
 
-    USE statistics,                                                            &
-        ONLY: pr_palm
-
-
     IMPLICIT NONE
 
@@ -88,123 +87,99 @@
     PUBLIC spc_names
 
-    INTEGER(iwp), DIMENSION(99) :: cs_pr_index            = 0
-    INTEGER(iwp) ::  ibc_cs_b                                                      !< integer flag for bc_cs_b
-    INTEGER(iwp) ::  ibc_cs_t                                                      !< integer flag for bc_cs_t
-    INTEGER(iwp) ::  cs_pr_count                           = 0 
-    INTEGER(iwp) ::  max_pr_cs                             = 0
-    INTEGER(iwp) ::  cs_vertical_gradient_level_ind(99,10) = -9999                 !< grid index values of cs_vertical_gradient_level_ind(s)
+    CHARACTER (LEN=20)                ::  bc_cs_b             = 'dirichlet'         !< namelist parameter
+    CHARACTER (LEN=20)                ::  bc_cs_t             = 'initial_gradient'  !< namelist parameter
+    CHARACTER (LEN=30)                ::  chem_mechanism      = 'phstatp'           !< KPP chmical mechanism
+    CHARACTER (LEN=11), DIMENSION(99) ::  cs_name             = 'novalue'           !< Namelist parameter: chem spcs names 
+    CHARACTER (LEN=11), DIMENSION(99) ::  cs_profile_name     = 'novalue'           !< Namelist parameter: Names of the chem for profiles
+    CHARACTER (LEN=11), DIMENSION(99) ::  data_output_pr_cs   = 'novalue'           !< Namelist parameter: Names of the chem species for profile output
+                                                                                    !< by cs_name for each height lvls defined by cs_heights
+    CHARACTER (LEN=80)                ::  daytype_mdh         ='workday'            !< Type of day in the MDH case: workday, weekend, holiday
+    CHARACTER (LEN=80)                ::  mode_emis           ='PARAMETERIZED'      !< Mode of chemistry emissions: DEFAULT .OR. EXPERT .OR. 
+                                                                                    !< PARAMETERIZED
+    CHARACTER (LEN=11), DIMENSION(99) ::  surface_csflux_name = 'novalue'           !< Namelist parameter: chem species names with surface fluxes specified
+                                                                                    !< active chem spcs, default is 'novalue')  ????
+    CHARACTER (LEN=80)                ::  time_fac_type       ='MDH'                !< Type of time treatment in the emis DEFAULT mode: HOUR .OR. MDH 
 
-    LOGICAL      ::  constant_top_csflux(99)               = .TRUE.                !< chem spcs at the top  orig .TRUE.
-    LOGICAL      ::  constant_csflux(99)                   = .TRUE.                !< chem spcs at namelist parameter   orig TRUE
-    LOGICAL      ::  call_chem_at_all_substeps             = .FALSE.               !< namelist parameter 
-    LOGICAL      ::  chem_debug0                           = .FALSE.               !< namelist parameter flag for minimum print output
-    LOGICAL      ::  chem_debug1                           = .FALSE.               !< namelist parameter flag for print output
-    LOGICAL      ::  chem_debug2                           = .FALSE.               !< namelist parameter flag for further print output
-    LOGICAL      ::  chem_gasphase_on                      = .TRUE.                !< namelist parameter 
-    LOGICAL      ::  emission_output_required              = .TRUE.                !< Logical Variable for requiring Emission Outputs
-    LOGICAL      ::  do_emis                               = .FALSE.               !< Flag for turning on chemistry emissions 
-    LOGICAL      ::  cs_pr_namelist_found                  = .FALSE.               !< Namelist parameter: Names of t
-    LOGICAL      ::  do_depo                               = .FALSE.               !< namelist parameter for activation of deposition calculation
+    INTEGER(iwp), DIMENSION(99)            ::  cs_pr_index                           = 0      !< index for chemical species profile (ecc)
+    INTEGER(iwp)                           ::  cs_pr_count                           = 0      !< namelist parameter : No. of species profiles (ecc)
+    INTEGER(iwp)                           ::  cs_vertical_gradient_level_ind(99,10) = -9999  !< grid index values of cs_vertical_gradient_level_ind(s)
+    INTEGER(iwp)                           ::  ibc_cs_b                                       !< integer flag for bc_cs_b
+    INTEGER(iwp)                           ::  ibc_cs_t                                       !< integer flag for bc_cs_t
+    INTEGER(iwp),ALLOCATABLE,DIMENSION(:)  ::  match_spec_input                               !< Index of Input chem species for matching routine 
+    INTEGER(iwp),ALLOCATABLE,DIMENSION(:)  ::  match_spec_model                               !< Index of Model chem species for matching routine
+    INTEGER(iwp),DIMENSION(:)              ::  match_spec_nox(1:2)                            !< results of matching the input and model's NOx
+    INTEGER(iwp),DIMENSION(:)              ::  match_spec_pm(1:3)                             !< results of matching the input and model's PMs
+    INTEGER(iwp),DIMENSION(:)              ::  match_spec_sox(1:2)                            !< results of matching the input and model's SOx! 
+    INTEGER(iwp),ALLOCATABLE,DIMENSION(:)  ::  match_spec_voc_input                           !< index of VOC input components matching the model's VOCs
+    INTEGER(iwp),ALLOCATABLE,DIMENSION(:)  ::  match_spec_voc_model                           !< index of VOC model species matching the input VOCs comp.
+    INTEGER(iwp)                           ::  main_street_id                        = 0      !< namelist parameter for chem_emissions : ID for main streets  
+    INTEGER(iwp)                           ::  max_pr_cs                             = 0      !< namelist parameter : Max no. of species profiles (ecc)
+    INTEGER(iwp)                           ::  max_street_id                         = 0      !< namelist parameter for chem_emissions : maximum street IDs      
+    INTEGER(iwp)                           ::  nspec_out                                      !< Output of routine chem_emis_matching with 
+    INTEGER(iwp)                           ::  side_street_id                        = 0      !< namelist paramtger for chem_emissions : ID for side streets
 
-
+    LOGICAL      ::  constant_top_csflux(99)               = .TRUE.   !< chem spcs at the top  orig .TRUE.
+    LOGICAL      ::  constant_csflux(99)                   = .TRUE.   !< chem spcs at namelist parameter   orig TRUE
+    LOGICAL      ::  call_chem_at_all_substeps             = .FALSE.  !< namelist parameter 
+    LOGICAL      ::  chem_debug0                           = .FALSE.  !< namelist parameter flag for minimum print output
+    LOGICAL      ::  chem_debug1                           = .FALSE.  !< namelist parameter flag for print output
+    LOGICAL      ::  chem_debug2                           = .FALSE.  !< namelist parameter flag for further print output
+    LOGICAL      ::  chem_gasphase_on                      = .TRUE.   !< namelist parameter 
+    LOGICAL      ::  emission_output_required              = .TRUE.   !< Logical Variable for requiring Emission Outputs
+    LOGICAL      ::  cs_pr_namelist_found                  = .FALSE.  !< Namelist parameter: Names of t
+    LOGICAL      ::  deposition_dry                        = .FALSE.  !< namelist parameter for activation of deposition calculation
+    LOGICAL      ::  emissions_anthropogenic               = .FALSE.  !< Flag for turning on anthropogenic emissions
 !
 !-- Namelist parameters for creating initial chemistry profiles
-    REAL(wp) ::  wall_csflux (99,0:5)               = 0.0_wp                        !< namelist parameter
-    REAL(wp) ::  cs_vertical_gradient (99,10)       = 0.0_wp                        !< namelist parameter
-    REAL(wp) ::  cs_vertical_gradient_level (99,10) = -999999.9_wp                  !< namelist parameter
-    REAL(wp) ::  top_csflux ( 99 )                  = 0.0_wp                        !< namelist parameter 
-    REAL(wp) ::  cs_surface_initial_change(99)      = 0.0_wp                        !< namelist parameter
-    REAL(wp) ::  surface_csflux(99 )                = 0.0_wp                        !< namelist parameter: fluxes where 'surface_csflux_name' is in the namelist
+    REAL(wp)                                          ::  cs_surface_initial_change(99)     = 0.0_wp        !< namelist parameter : initial surface flux difference
+    REAL(wp)                                          ::  cs_vertical_gradient(99,10)       = 0.0_wp        !< namelist parameter : vertical gradient
+    REAL(wp)                                          ::  cs_vertical_gradient_level(99,10) = -999999.9_wp  !< namelist parameter : vertical gradient level
+    REAL(wp)                                          ::  surface_csflux(99)                = 0.0_wp        !< namelist parameter : fluxes where 'surface_csflux_name' is
+                                                                                                            !< in the namelist
+    REAL(wp)                                          ::  top_csflux(99)                    = 0.0_wp        !< namelist parameter : chemical species flux at ceiling
+    REAL(wp)                                          ::  wall_csflux(99,0:5)               = 0.0_wp        !< namelist parameter : chemical species flux lateral
+    REAL(wp), DIMENSION(:), ALLOCATABLE               ::  bc_cs_t_val                                       !< chemical specices time value at BC
+    REAL(wp), DIMENSION(:,:,:), POINTER               ::  cs                                                !< pointer: sgs chem spcs)
+    REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE, TARGET ::  cs_1                                              !< pointer for swapping of timelevels for respective quantity
+    REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE, TARGET ::  cs_2                                              !< pointer for swapping of timelevels for respective quantity
+    REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE, TARGET ::  cs_3                                              !< pointer for swapping of timelevels for respective quantity
+    REAL(wp), DIMENSION(:,:,:), POINTER               ::  cs_p                                              !< pointer: prognostic value of sgs chem spcs 
+    REAL(wp), DIMENSION(:), ALLOCATABLE               ::  css                                               !< scaling parameter for chem spcs
+    REAL(wp), DIMENSION(99,100)                       ::  cs_profile                        = 9999999.9_wp  !< Namelist parameter: Chem conc for each spcs defined
+    REAL(wp), DIMENSION(99,100)                       ::  cs_heights                        = 9999999.9_wp  !< Namelist parameter: Height lvls(m) for cs_profiles
+    REAL(wp), DIMENSION(99)                           ::  cs_surface                        = 0.0_wp        !< Namelist parameter: Surface conc of chem spcs'
+    REAL(wp),ALLOCATABLE, DIMENSION(:,:,:,:)          ::  emis_distribution                                 !< Emissions Final Values (main module output)
+    REAL(wp)                                          ::  emiss_factor_main(99)             = -9999.0_wp    !< emission factor for main streets
+    REAL(wp)                                          ::  emiss_factor_side(99)             = -9999.0_wp    !< emission factor for side streets
+    REAL(wp), DIMENSION(:,:,:), POINTER               ::  tcs_m                                             !< pointer: to tcs array (temp)
+!
+!-- molecular weights
+    REAL, PARAMETER        ::  xm_air   =   28.964e-3             !< air      molecular weight (kg/mol)
+    REAL, PARAMETER        ::  xm_C     =   12.01115e-3           !< C        molecular weight (kg/mol)
+    REAL, PARAMETER        ::  xm_Ca    =   40.07800e-3           !< Ca       molecular weight (kg/mol)
+    REAL, PARAMETER        ::  xm_Cd    =  112.41000e-3           !< Cd       molecular weight (kg/mol)
+    REAL, PARAMETER        ::  xm_Cl    =   35.45300e-3           !< Cl       molecular weight (kg/mol)
+    REAL, PARAMETER        ::  xm_dummy = 1000.0e-3               !< dummy    molecular weight (kg/mol)
+    REAL, PARAMETER        ::  xm_F     =   18.99840e-3           !< F        molecular weight (kg/mol)
+    REAL, PARAMETER        ::  xm_H     =    1.00790e-3           !< H        molecular weight (kg/mol)
+    REAL, PARAMETER        ::  xm_K     =   39.09800e-3           !< K        molecular weight (kg/mol)
+    REAL, PARAMETER        ::  xm_Mg    =   24.30500e-3           !< Mg       molecular weight (kg/mol)
+    REAL, PARAMETER        ::  xm_N     =   14.00670e-3           !< N        molecular weight (kg/mol)
+    REAL, PARAMETER        ::  xm_Na    =   22.98977e-3           !< Na       molecular weight (kg/mol)
+    REAL, PARAMETER        ::  xm_O     =   15.99940e-3           !< O        molecular weight (kg/mol)
+    REAL, PARAMETER        ::  xm_Pb    =  207.20000e-3           !< Pb       molecular weight (kg/mol)
+    REAL, PARAMETER        ::  xm_Pb210 =  210.00000e-3           !< Pb (210) molecular weight (kg/mol)
+    REAL, PARAMETER        ::  xm_Rn222 =  222.00000e-3           !< Rn (222) molecular weight (kg/mol)
+    REAL, PARAMETER        ::  xm_S     =   32.06400e-3           !< S        molecular weight (kg/mol)
+    REAL, PARAMETER        ::  xm_CO2   = xm_C + xm_O * 2         !< CO2      molecular weight (kg/mol)
+    REAL, PARAMETER        ::  xm_h2o   = xm_H * 2 + xm_O         !< H2O      molecular weight (kg/mol)
+    REAL, PARAMETER        ::  xm_HNO3  = xm_H + xm_N + xm_O * 3  !< HNO3     molecular weight (kg/mol)
+    REAL, PARAMETER        ::  xm_o3    = xm_O * 3                !< O3       molecular weight (kg/mol)
+    REAL, PARAMETER        ::  xm_N2O5  = xm_N * 2 + xm_O * 5     !< N2O5     molecular weight (kg/mol)
+    REAL, PARAMETER        ::  xm_NH4   = xm_N + xm_H * 4         !< NH4      molecular weight (kg/mol)
+    REAL, PARAMETER        ::  xm_NO3   = xm_N + xm_O * 3         !< NO3      molecular weight (kg/mol)
+    REAL, PARAMETER        ::  xm_SO4   = xm_S + xm_O * 4         !< SO4      molecular weight (kg/mol)
 
-    REAL(wp), DIMENSION(:), ALLOCATABLE               ::  bc_cs_t_val
-    REAL(wp), DIMENSION(:), ALLOCATABLE               ::  css                       !< scaling parameter for chem spcs
-    REAL(wp), DIMENSION(99)                           ::  cs_surface = 0.0_wp       !< Namelist parameter: Surface conc of chem spcs'
-    REAL(wp), DIMENSION(99,100)                       ::  cs_heights = 9999999.9_wp !< Namelist parameter: Height lvls(m) for cs_profiles
-    REAL(wp), DIMENSION(99,100)                       ::  cs_profile = 9999999.9_wp !< Namelist parameter: Chem conc for each spcs defined
+    SAVE
 
-!
-!-- Use pointers cs, cs_p and tcs_m to point arrays cs_1, cs_2, and cs_3
-    REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE, TARGET ::  cs_1                      !< pointer for swapping of timelevels for respective quantity
-    REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE, TARGET ::  cs_2                      !< pointer for swapping of timelevels for respective quantity
-    REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE, TARGET ::  cs_3                      !< pointer for swapping of timelevels for respective quantity
-    REAL(wp), DIMENSION(:,:,:), POINTER               ::  cs                        !< pointer: sgs chem spcs)
-    REAL(wp), DIMENSION(:,:,:), POINTER               ::  cs_p                      !< pointer: prognostic value of sgs chem spcs 
-    REAL(wp), DIMENSION(:,:,:), POINTER               ::  tcs_m                     !< pointer:
- 
-    CHARACTER (LEN=20)                ::  bc_cs_b             = 'dirichlet'         !< namelist parameter
-    CHARACTER (LEN=20)                ::  bc_cs_t             = 'initial_gradient'  !< namelist parameter
-    CHARACTER (LEN=11), DIMENSION(99) ::  cs_name             = 'novalue'           !< Namelist parameter: chem spcs names 
-    CHARACTER (LEN=11), DIMENSION(99) ::  cs_profile_name     = 'novalue'           !< Namelist parameter: Names of the chem for profiles
-    CHARACTER (LEN=11), DIMENSION(99) ::  surface_csflux_name = 'novalue'           !< Namelist parameter: chem species surface fluxes names
-                                                                                    !< active chem spcs, default is 'novalue')  ????
-    CHARACTER (LEN=80)                ::  mode_emis           ='PARAMETERIZED'      !< Mode of chemistry emissions: DEFAULT .OR. EXPERT .OR. 
-                                                                                    !< PARAMETERIZED
-    CHARACTER (LEN=80)                ::  time_fac_type       ='MDH'                !< Type of time treatment in the emis DEFAULT mode: HOUR .OR. MDH 
-    CHARACTER (LEN=80)                ::  daytype_mdh         ='workday'            !< Type of day in the MDH case: workday, weekend, holiday
-    CHARACTER (LEN=11), DIMENSION(99) ::  data_output_pr_cs   = 'novalue'           !< Namelist parameter: Names of the chem species for profile output
-                                                                                    !< by cs_name for each height lvls defined by cs_heights
-    CHARACTER (LEN=30)                ::  chem_mechanism      = 'phstatp'           !< Namelist parameter: Name of chemistry mechanism
-                                                                                    !< (must match with third line in chem_gasphase_mod.f90)
-!
-!-- Namelist parameters for chem_emissions
-    INTEGER(iwp) ::  main_street_id = 0
-    INTEGER(iwp) ::  max_street_id  = 0
-    INTEGER(iwp) ::  side_street_id = 0
-!
-!-- Constant emission factors
-    REAL(wp) ::  emiss_factor_main ( 99 ) = -9999.0_wp
-    REAL(wp) ::  emiss_factor_side ( 99 ) = -9999.0_wp
-!    
-!-- Other Emissions Variables
-    INTEGER(iwp) ::  nspec_out                                                     !< Output of routine chem_emis_matching with 
-                                                                                   !< number of matched species
-    REAL(wp),ALLOCATABLE, DIMENSION(:,:,:,:) ::  emis_distribution                 !> Emissions Final Values (main module output)
-
-    INTEGER(iwp),ALLOCATABLE,DIMENSION(:)    ::  match_spec_input                  !< Index of Input chem species for matching routine 
-    INTEGER(iwp),ALLOCATABLE,DIMENSION(:)    ::  match_spec_model                  !< Index of Model chem species for matching routine
-    INTEGER(iwp),ALLOCATABLE,DIMENSION(:)    ::  match_spec_voc_input              !< index of VOC input components matching the model's VOCs
-    INTEGER(iwp),ALLOCATABLE,DIMENSION(:)    ::  match_spec_voc_model              !< index of VOC model species matching the input VOCs comp.
-    INTEGER(iwp),DIMENSION(:)                ::  match_spec_pm(1:3)                !< results of matching the input and model's PMs
-    INTEGER(iwp),DIMENSION(:)                ::  match_spec_nox(1:2)               !< results of matching the input and model's NOx
-    INTEGER(iwp),DIMENSION(:)                ::  match_spec_sox(1:2)               !< results of matching the input and model's SOx! 
-                                                                                  
-
-!
-!-- Selected atomic/molecular weights:
-    REAL, PARAMETER        ::  xm_H     =    1.00790e-3           !< kg/mol
-    REAL, PARAMETER        ::  xm_N     =   14.00670e-3           !< kg/mol
-    REAL, PARAMETER        ::  xm_C     =   12.01115e-3           !< kg/mol
-    REAL, PARAMETER        ::  xm_S     =   32.06400e-3           !< kg/mol
-    REAL, PARAMETER        ::  xm_O     =   15.99940e-3           !< kg/mol
-    REAL, PARAMETER        ::  xm_F     =   18.99840e-3           !< kg/mol
-    REAL, PARAMETER        ::  xm_Na    =   22.98977e-3           !< kg/mol
-    REAL, PARAMETER        ::  xm_Cl    =   35.45300e-3           !< kg/mol
-    REAL, PARAMETER        ::  xm_Rn222 =  222.00000e-3           !< kg/mol
-    REAL, PARAMETER        ::  xm_Pb210 =  210.00000e-3           !< kg/mol
-    REAL, PARAMETER        ::  xm_Ca    =   40.07800e-3           !< kg/mol
-    REAL, PARAMETER        ::  xm_K     =   39.09800e-3           !< kg/mol
-    REAL, PARAMETER        ::  xm_Mg    =   24.30500e-3           !< kg/mol
-    REAL, PARAMETER        ::  xm_Pb    =  207.20000e-3           !< kg/mol
-    REAL, PARAMETER        ::  xm_Cd    =  112.41000e-3           !< kg/mol
-    
-    REAL, PARAMETER        ::  xm_h2o   = xm_H * 2 + xm_O         !< kg/mol
-    REAL, PARAMETER        ::  xm_o3    = xm_O * 3                !< kg/mol
-    REAL, PARAMETER        ::  xm_N2O5  = xm_N * 2 + xm_O * 5     !< kg/mol
-    REAL, PARAMETER        ::  xm_HNO3  = xm_H + xm_N + xm_O * 3  !< kg/mol
-    REAL, PARAMETER        ::  xm_NH4   = xm_N + xm_H * 4         !< kg/mol
-    REAL, PARAMETER        ::  xm_SO4   = xm_S + xm_O * 4         !< kg/mol
-    REAL, PARAMETER        ::  xm_NO3   = xm_N + xm_O * 3         !< kg/mol
-    REAL, PARAMETER        ::  xm_CO2   = xm_C + xm_O * 2         !< kg/mol
-    
-!
-!-- mass of air
-    REAL, PARAMETER        ::  xm_air   =  28.964e-3              !< kg/mol
-        
-!
-!-- dummy weight, used for complex molecules:
-    REAL, PARAMETER        ::  xm_dummy =  1000.0e-3              ! kg/mol
-
-    
-    SAVE
  END MODULE chem_modules
-
Index: palm/trunk/SOURCE/chemistry_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/chemistry_model_mod.f90	(revision 3819)
+++ palm/trunk/SOURCE/chemistry_model_mod.f90	(revision 3820)
@@ -27,4 +27,8 @@
 ! -----------------
 ! $Id: chemistry_model_mod.f90 3784 2019-03-05 14:16:20Z banzhafs
+! renamed get_mechanismname to get_mechanism_name
+! renamed do_emiss to emissions_anthropogenic and do_depo to deposition_dry (ecc)
+! 
+! 3784 2019-03-05 14:16:20Z banzhafs
 ! Unused variables removed/taken care of
 ! 
@@ -303,5 +307,5 @@
 
     USE chem_gasphase_mod,                                                                         &
-         ONLY:  atol, chem_gasphase_integrate, get_mechanismname, nkppctrl, nmaxfixsteps,          &
+         ONLY:  atol, chem_gasphase_integrate, get_mechanism_name, nkppctrl, nmaxfixsteps,         &
          nphot, nreact, nspec, nvar, phot_names, rtol, spc_names, t_steps, vl_dim
 
@@ -1195,5 +1199,5 @@
     ENDIF
 !-- check for chemical mechanism used 
-    CALL get_mechanismname
+    CALL get_mechanism_name
     IF (chem_mechanism /= trim(cs_mech) )  THEN
        message_string = 'Incorrect chemistry mechanism selected, check spelling in namelist and/or chem_gasphase_mod'
@@ -1640,5 +1644,5 @@
 !
 ! Get name of chemical mechanism from chem_gasphase_mod
-    CALL get_mechanismname
+    CALL get_mechanism_name
 
 !-- Write chemistry model  header
@@ -1773,5 +1777,5 @@
 
 
-    IF ( do_emis )  CALL chem_emissions_init
+    IF ( emissions_anthropogenic )  CALL chem_emissions_init
 !
 !-- Chemistry variables will be initialized if availabe from dynamic 
@@ -1818,5 +1822,5 @@
     INTEGER(iwp) ::  lpr_lev           !< running index for chem spcs profile level
 
-    IF ( do_emis ) THEN
+    IF ( emissions_anthropogenic ) THEN
        CALL netcdf_data_input_chemistry_data( chem_emis_att, chem_emis )
     ENDIF
@@ -2202,8 +2206,12 @@
          cs_profile,                       &
          cs_surface,                       &
+         cs_surface_initial_change,        &
+         cs_vertical_gradient_level,       &
+         daytype_mdh,                      &
          decycle_chem_lr,                  &
          decycle_chem_ns,                  &            
          decycle_method,                   &
-         do_depo,                          &
+         deposition_dry,                   &
+         emissions_anthropogenic           &  
          emiss_factor_main,                &
          emiss_factor_side,                &                      
@@ -2211,4 +2219,5 @@
          main_street_id,                   &
          max_street_id,                    &
+         mode_emis,                        &
          my_steps,                         &
          nest_chemistry,                   &
@@ -2221,11 +2230,5 @@
          surface_csflux,                   &
          surface_csflux_name,              &
-         cs_surface_initial_change,        &
-         cs_vertical_gradient_level,       &
-         !                                       namelist parameters for emissions
-         mode_emis,                        &
-         time_fac_type,                    &
-         daytype_mdh,                      &
-         do_emis                              
+         time_fac_type,
 
     !-- analogue to chem_names(nspj) we could invent chem_surfaceflux(nspj) and chem_topflux(nspj)
@@ -3306,5 +3309,5 @@
 
           !
-          !-- Get vd
+          !-- Get deposition velocity vd
           DO  lsp = 1, nvar
              !
Index: palm/trunk/SOURCE/prognostic_equations.f90
===================================================================
--- palm/trunk/SOURCE/prognostic_equations.f90	(revision 3819)
+++ palm/trunk/SOURCE/prognostic_equations.f90	(revision 3820)
@@ -25,4 +25,7 @@
 ! -----------------
 ! $Id$
+! renamed do_depo to deposition_dry (ecc)
+! 
+! 3797 2019-03-15 11:15:38Z forkel
 ! Call chem_integegrate in OpenMP loop   (ketelsen)
 ! 
@@ -372,5 +375,6 @@
            
     USE chem_modules,                                                          &
-        ONLY:  call_chem_at_all_substeps, chem_gasphase_on, cs_name, do_depo
+        ONLY:  call_chem_at_all_substeps, chem_gasphase_on, cs_name,           &
+               deposition_dry
 
     USE chem_photolysis_mod,                                                   &
@@ -546,5 +550,5 @@
              CALL cpu_log( log_point_s(19), 'chem.reactions', 'stop' )
 
-             IF ( do_depo )  THEN
+             IF ( deposition_dry )  THEN
                 CALL cpu_log( log_point_s(24), 'chem.deposition', 'start' )
                 DO  i = nxl, nxr
Index: palm/trunk/SOURCE/time_integration.f90
===================================================================
--- palm/trunk/SOURCE/time_integration.f90	(revision 3819)
+++ palm/trunk/SOURCE/time_integration.f90	(revision 3820)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! renamed do_emiss to emissions_anthropogenic (ecc)
+! 
+! 
+! 3774 2019-03-04 10:52:49Z moh.hefny
 ! rephrase if statement to avoid unallocated array in case of
 ! nesting_offline is false (crashing during debug mode)
@@ -486,5 +490,5 @@
 
     USE chem_modules,                                                                              &
-        ONLY:  bc_cs_t_val, cs_name, do_emis, nspec, nspec_out
+        ONLY:  bc_cs_t_val, cs_name, emissions_anthropogenic, nspec, nspec_out
 
     USE chemistry_model_mod,                                                                       &
@@ -1386,5 +1390,5 @@
 !
 !--    If required, consider chemical emissions
-       IF ( air_chemistry  .AND.  do_emis )  THEN
+       IF ( air_chemistry  .AND.  emissions_anthropogenic )  THEN
 !
 !--       Update the time --> kanani: revise location of this CALL
