Index: palm/trunk/SOURCE/chem_modules.f90
===================================================================
--- palm/trunk/SOURCE/chem_modules.f90	(revision 3651)
+++ palm/trunk/SOURCE/chem_modules.f90	(revision 3652)
@@ -27,4 +27,8 @@
 ! -----------------
 ! $Id$
+! parameter chem_mechanism added (basit)
+! 
+! 
+! 3636 2018-12-19 13:48:34Z raasch
 ! nopointer option removed
 ! 
@@ -133,6 +137,8 @@
     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 che    m for profile output
+    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
Index: palm/trunk/SOURCE/chemistry_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/chemistry_model_mod.f90	(revision 3651)
+++ palm/trunk/SOURCE/chemistry_model_mod.f90	(revision 3652)
@@ -27,4 +27,8 @@
 ! -----------------
 ! $Id$
+! Checks added for chemistry mechanism, parameter chem_mechanism added (basit)
+! 
+! 
+! 3646 2018-12-28 17:58:49Z kanani
 ! Bugfix: use time_since_reference_point instead of simulated_time (relevant
 ! when using wall/soil spinup)
@@ -1120,5 +1124,12 @@
     INTEGER (iwp) ::  lsp_usr      !< running index for user defined chem spcs 
     INTEGER (iwp) ::  lsp          !< running index for chem spcs.
-
+    CHARACTER (LEN=30)       ::  cs_mech,a1,b1,string
+
+
+    OPEN (10,FILE="chem_gasphase_mod.f90")   !get the chem_mechanism name from the file.
+    READ (10, 100) a1,b1,string
+    cs_mech = trim(string(16:))
+ 100    FORMAT(a)
+        CLOSE(10)
 
 !
@@ -1153,9 +1164,15 @@
        CALL message( 'chem_check_parameters', 'CM0426', 1, 2, 0, 6, 0 )
     ENDIF
+!-- check for chemical mechanism used 
+    IF (chem_mechanism /= trim(cs_mech) )  THEN
+       message_string = 'Incorrect chemical mechanism selected, please check spelling and/or chem_gasphase_mod'
+       CALL message( 'chem_check_parameters', 'CM0462', 1, 2, 0, 6, 0 )
+    ENDIF
+
 
 !---------------------
 !-- chem_check_parameters is called before the array chem_species is allocated!
 !-- temporary switch of this part of the check
-    RETURN
+!    RETURN                !bK commented
 !---------------------
 
@@ -1173,5 +1190,5 @@
        IF ( .not. found ) THEN
           message_string = 'Unused/incorrect input for initial surface value: ' // TRIM(cs_name(lsp_usr))
-          CALL message( 'chem_check_parameters', 'CM0427', 0, 1, 0, 6, 0 )
+          CALL message( 'chem_check_parameters', 'CM0427', 1, 2, 0, 6, 0 )
        ENDIF
        lsp_usr = lsp_usr + 1
@@ -1193,5 +1210,5 @@
           message_string = 'Unused/incorrect input of chemical species for surface emission fluxes: '  &
                             // TRIM(surface_csflux_name(lsp_usr))
-          CALL message( 'chem_check_parameters', 'CM0428', 0, 1, 0, 6, 0 )
+          CALL message( 'chem_check_parameters', 'CM0428', 1, 2, 0, 6, 0 )
        ENDIF
        lsp_usr = lsp_usr + 1
@@ -1590,6 +1607,13 @@
     CHARACTER (LEN=80)       :: docsflux_chr
     CHARACTER (LEN=80)       :: docsinit_chr
-
-!
+    CHARACTER (LEN=30)       ::  cs_mech,a1,b1,string
+
+!
+    OPEN (10,FILE="chem_gasphase_mod.f90")   !get the chem_mechanism name from the file.
+    READ (10, 100) a1,b1,string
+    cs_mech = trim(string(16:))
+100 FORMAT(a)   
+    CLOSE(10)
+
 !-- Write chemistry model  header
     WRITE( io, 1 )
@@ -1658,4 +1682,6 @@
 !-- number of variable and fix chemical species and number of reactions
     cs_fixed = nspec - nvar
+
+    WRITE ( io, * ) '   --> Chemical Mechanism        : ', cs_mech 
     WRITE ( io, * ) '   --> Chemical species, variable: ', nvar
     WRITE ( io, * ) '   --> Chemical species, fixed   : ', cs_fixed
@@ -1960,5 +1986,5 @@
     REAL(wp), PARAMETER              ::  t_std   = 273.15_wp                 !< standard pressure (Pa)
     REAL(wp), PARAMETER              ::  p_std   = 101325.0_wp               !< standard pressure (Pa)
-    REAL(wp), PARAMETER              ::  vmolcm  = 22.414e3_wp               !< Mole volume (22.414 l) in cm^{-3}
+    REAL(wp), PARAMETER              ::  vmolcm  = 22.414e3_wp               !< Mole volume (22.414 l) in cm^3
     REAL(wp), PARAMETER              ::  xna     = 6.022e23_wp               !< Avogadro number (molecules/mol)
 
@@ -2076,4 +2102,5 @@
          chem_debug2,                      &
          chem_gasphase_on,                 &
+         chem_mechanism,                   &          
          cs_heights,                       &
          cs_name,                          &
@@ -2560,4 +2587,6 @@
     INTEGER(iwp) ::  m    !<
     INTEGER(iwp) ::  lpr  !< running index chem spcs
+    LOGICAL      ::  ts_calc = .TRUE.
+
     !    REAL(wp),                                                                                      &
     !    DIMENSION(dots_num_palm+1:dots_max) ::                                                         &
@@ -2589,6 +2618,7 @@
           ENDDO
        ENDDO
-    ELSEIF ( mode == 'time_series' )  THEN
+    ELSEIF ( mode == 'time_series' .and. ts_calc )  THEN
        CALL location_message( 'Time series not calculated for chemistry', .TRUE. )
+       ts_calc = .FALSE.
     ENDIF
 
