Index: palm/trunk/SOURCE/chem_gasphase_mod.f90
===================================================================
--- palm/trunk/SOURCE/chem_gasphase_mod.f90	(revision 3796)
+++ palm/trunk/SOURCE/chem_gasphase_mod.f90	(revision 3797)
@@ -98,4 +98,5 @@
                                                                  
   LOGICAL                     :: data_loaded = .FALSE.             
+  REAL(dp), POINTER, DIMENSION(:), CONTIGUOUS    :: var             
 ! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ! 
@@ -113,6 +114,6 @@
 ! 
 ! File                 : chem_gasphase_mod_Parameters.f90
-! Time                 : Fri Mar  8 19:01:03 2019
-! Working directory    : /home/forkel-r/palmstuff/work/trunk20190308/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Fri Mar 15 12:08:06 2019
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20190315/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
 ! Equation file        : chem_gasphase_mod.kpp
 ! Output root filename : chem_gasphase_mod
@@ -190,6 +191,6 @@
 ! 
 ! File                 : chem_gasphase_mod_Global.f90
-! Time                 : Fri Mar  8 19:01:03 2019
-! Working directory    : /home/forkel-r/palmstuff/work/trunk20190308/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Fri Mar 15 12:08:06 2019
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20190315/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
 ! Equation file        : chem_gasphase_mod.kpp
 ! Output root filename : chem_gasphase_mod
@@ -205,11 +206,10 @@
 
 ! C - Concentration of all species
-  REAL(kind=dp):: c(nspec)
+  REAL(kind=dp), TARGET    :: c(nspec)
 ! VAR - Concentrations of variable species (global)
-  REAL(kind=dp):: var(nvar)
+! REAL(kind=dp):: var(nvar)  var is now POINTER
 ! FIX - Concentrations of fixed species (global)
   REAL(kind=dp):: fix(nfix)
 ! VAR,FIX are chunks of array C
-      EQUIVALENCE( c(1), var(1))
 ! RCONST - Rate constants (global)
   REAL(kind=dp):: rconst(nreact)
@@ -256,6 +256,6 @@
 ! 
 ! File                 : chem_gasphase_mod_JacobianSP.f90
-! Time                 : Fri Mar  8 19:01:03 2019
-! Working directory    : /home/forkel-r/palmstuff/work/trunk20190308/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Fri Mar 15 12:08:06 2019
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20190315/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  8 19:01:03 2019
-! Working directory    : /home/forkel-r/palmstuff/work/trunk20190308/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Fri Mar 15 12:08:06 2019
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20190315/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  8 19:01:03 2019
-! Working directory    : /home/forkel-r/palmstuff/work/trunk20190308/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Fri Mar 15 12:08:06 2019
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20190315/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  8 19:01:03 2019
-! Working directory    : /home/forkel-r/palmstuff/work/trunk20190308/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Fri Mar 15 12:08:06 2019
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20190315/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  8 19:01:03 2019
-! Working directory    : /home/forkel-r/palmstuff/work/trunk20190308/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Fri Mar 15 12:08:06 2019
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20190315/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  8 19:01:03 2019
-! Working directory    : /home/forkel-r/palmstuff/work/trunk20190308/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Fri Mar 15 12:08:06 2019
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20190315/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  8 19:01:03 2019
-! Working directory    : /home/forkel-r/palmstuff/work/trunk20190308/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Fri Mar 15 12:08:06 2019
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20190315/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  8 19:01:03 2019
-! Working directory    : /home/forkel-r/palmstuff/work/trunk20190308/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Fri Mar 15 12:08:06 2019
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20190315/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  8 19:01:03 2019
-! Working directory    : /home/forkel-r/palmstuff/work/trunk20190308/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
+! Time                 : Fri Mar 15 12:08:06 2019
+! Working directory    : /home/forkel-r/palmstuff/work/trunk20190315/UTIL/chemistry/gasphase_preproc/tmp_kpp4palm
 ! Equation file        : chem_gasphase_mod.kpp
 ! Output root filename : chem_gasphase_mod
@@ -670,4 +670,10 @@
   END INTERFACE        chem_gasphase_integrate
  
+ 
+  ! openmp directives generated by kp4 
+ 
+  !$OMP THREADPRIVATE (vl, vl_glo, is, ie, data_loaded)
+  !$OMP THREADPRIVATE (c, var, fix, rconst, time, temp, stepmin, cfactor)
+  !$OMP THREADPRIVATE (qvap, fakt, cs_mech, a, icntrl, rcntrl)
  
  CONTAINS
@@ -2308,4 +2314,6 @@
   IF (PRESENT (rcntrl_i)) rcntrl  = rcntrl_i                      
                                                                     
+  var => c(1:nvar)                                                 
+                                                                    
   vl_glo = size(tempi, 1)                                           
                                                                     
Index: palm/trunk/SOURCE/prognostic_equations.f90
===================================================================
--- palm/trunk/SOURCE/prognostic_equations.f90	(revision 3796)
+++ palm/trunk/SOURCE/prognostic_equations.f90	(revision 3797)
@@ -25,4 +25,8 @@
 ! -----------------
 ! $Id$
+! Call chem_integegrate in OpenMP loop   (ketelsen)
+! 
+! 
+! 3771 2019-02-28 12:19:33Z raasch
 ! preprocessor directivs fro rrtmg added
 ! 
@@ -527,22 +531,29 @@
              CALL photolysis_control
           ENDIF
-          DO  i = nxl, nxr
-             DO  j = nys, nyn
-
-                IF ( intermediate_timestep_count == 1 .OR.                        &
-                     call_chem_at_all_substeps )  THEN
-
-                   CALL cpu_log( log_point_s(19), 'chem.reactions', 'start' )  
+
+          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)
-                   CALL cpu_log( log_point_s(19), 'chem.reactions', 'stop' )
-
-                   IF ( do_depo )  THEN
-                      CALL cpu_log( log_point_s(24), 'chem.deposition', 'start' )
+                ENDDO
+             ENDDO
+             !$OMP END PARALLEL
+             CALL cpu_log( log_point_s(19), 'chem.reactions', 'stop' )
+
+             IF ( do_depo )  THEN
+                CALL cpu_log( log_point_s(24), 'chem.deposition', 'start' )
+                DO  i = nxl, nxr
+                   DO  j = nys, nyn
                       CALL chem_depo(i,j)
-                      CALL cpu_log( log_point_s(24), 'chem.deposition', 'stop' )
-                   ENDIF
-                ENDIF
-             ENDDO
-          ENDDO
+                   ENDDO
+                ENDDO
+                CALL cpu_log( log_point_s(24), 'chem.deposition', 'stop' )
+             ENDIF
+          ENDIF
        ENDIF
 !
