Index: palm/trunk/SOURCE/Makefile
===================================================================
--- palm/trunk/SOURCE/Makefile	(revision 3875)
+++ palm/trunk/SOURCE/Makefile	(revision 3876)
@@ -882,5 +882,5 @@
 	basic_constants_and_equations_mod.o \
 	chem_gasphase_mod.o \
-	chemistry_model_mod.o \
+	chem_modules.o \
 	mod_kinds.o \
 	modules.o \
@@ -1333,5 +1333,4 @@
 	basic_constants_and_equations_mod.o \
 	biometeorology_mod.o \
-	chemistry_model_mod.o \
 	cpulog_mod.o \
 	mod_kinds.o \
@@ -1368,5 +1367,5 @@
 	user_module.o
 nesting_offl_mod.o: \
-	chemistry_model_mod.o \
+	chem_modules.o \
 	cpulog_mod.o \
 	mod_kinds.o \
@@ -1441,4 +1440,5 @@
 pmc_interface_mod.o: \
 	bulk_cloud_model_mod.o \
+	chem_modules.o \
 	chemistry_model_mod.o \
 	chem_gasphase_mod.o \
@@ -1584,5 +1584,5 @@
 	advec_s_up.o \
 	chem_gasphase_mod.o \
-	chemistry_model_mod.o \
+	chem_modules.o \
 	diffusion_s.o \
 	netcdf_data_input_mod.o \
@@ -1851,5 +1851,5 @@
 virtual_measurement_mod.o: \
 	cpulog_mod.o \
-	chemistry_model_mod.o \
+	chem_modules.o \
 	chem_gasphase_mod.o \
 	mod_kinds.o \
Index: palm/trunk/SOURCE/chem_modules.f90
===================================================================
--- palm/trunk/SOURCE/chem_modules.f90	(revision 3875)
+++ palm/trunk/SOURCE/chem_modules.f90	(revision 3876)
@@ -94,5 +94,8 @@
     CHARACTER (LEN=80) ::  mode_emis      = 'PARAMETERIZED'     !< namelist parameter: mode of chemistry emissions - DEFAULT, EXPERT, PARAMETERIZED
     CHARACTER (LEN=80) ::  time_fac_type  = 'MDH'               !< namelist parameter: type of time treatment in the mode_emis DEFAULT - HOUR, MDH
-    
+    CHARACTER (LEN=10) ::  photolysis_scheme                    !< 'constant',
+                                                                !< 'simple' (Simple parameterisation from MCM, Saunders et al., 2003, Atmos. Chem. Phys., 3, 161-180
+                                                                !< 'fastj'  (Wild et al., 2000, J. Atmos. Chem., 37, 245-282) STILL NOT IMPLEMENTED
+
     CHARACTER (LEN=11), DIMENSION(99) ::  cs_name             = 'novalue'  !< namelist parameter: names of species with given fluxes (see csflux)
     CHARACTER (LEN=11), DIMENSION(99) ::  cs_profile_name     = 'novalue'  !< namelist parameter: tbc...???
@@ -183,4 +186,31 @@
     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)
+!
+!-  Define chemical variables within chem_species
+    TYPE species_def
+       CHARACTER(LEN=15)                            ::  name         !< name of chemical species
+       CHARACTER(LEN=15)                            ::  unit         !< unit (ppm for gases, kg m^-3 for aerosol tracers)
+       REAL(kind=wp), POINTER, DIMENSION(:,:,:)     ::  conc         !< concentrations of trace gases
+       REAL(kind=wp), POINTER, DIMENSION(:,:,:)     ::  conc_av      !< averaged concentrations
+       REAL(kind=wp), POINTER, DIMENSION(:,:,:)     ::  conc_p       !< conc at prognostic time level
+       REAL(kind=wp), POINTER, DIMENSION(:,:,:)     ::  tconc_m      !< weighted tendency of conc for previous sub-timestep (Runge-Kutta)
+       REAL(kind=wp), ALLOCATABLE, DIMENSION(:,:)   ::  cssws_av     !< averaged fluxes of trace gases at surface
+       REAL(kind=wp), ALLOCATABLE, DIMENSION(:,:)   ::  flux_s_cs    !< 6th-order advective flux at south face of grid box of chemical species (='cs')
+       REAL(kind=wp), ALLOCATABLE, DIMENSION(:,:)   ::  diss_s_cs    !< artificial numerical dissipation flux at south face of grid box of chemical species
+       REAL(kind=wp), ALLOCATABLE, DIMENSION(:,:,:) ::  flux_l_cs    !< 6th-order advective flux at left face of grid box of chemical species (='cs')
+       REAL(kind=wp), ALLOCATABLE, DIMENSION(:,:,:) ::  diss_l_cs    !< artificial numerical dissipation flux at left face of grid box of chemical species
+       REAL(kind=wp), ALLOCATABLE, DIMENSION(:)     ::  conc_pr_init !< initial profile of chemical species
+    END TYPE species_def
+!
+!-- Define photolysis frequencies in phot_frequen
+    TYPE photols_def
+       CHARACTER(LEN=15)                            :: name          !< name of pgotolysis frequency
+       CHARACTER(LEN=15)                            :: unit          !< unit (1/s)
+       REAL(kind=wp), POINTER, DIMENSION(:,:,:)     :: freq          !< photolysis frequency
+    END TYPE photols_def
+
+
+    TYPE(species_def), ALLOCATABLE, DIMENSION(:), TARGET ::  chem_species
+    TYPE(photols_def), ALLOCATABLE, DIMENSION(:), TARGET ::  phot_frequen
 
     SAVE
Index: palm/trunk/SOURCE/chem_photolysis_mod.f90
===================================================================
--- palm/trunk/SOURCE/chem_photolysis_mod.f90	(revision 3875)
+++ palm/trunk/SOURCE/chem_photolysis_mod.f90	(revision 3876)
@@ -78,5 +78,5 @@
         ONLY: nphot, phot_names, phot 
 
-    USE chemistry_model_mod,                                                   &
+    USE chem_modules,                                                          &
         ONLY: phot_frequen, photolysis_scheme
 
Index: palm/trunk/SOURCE/chemistry_model_mod.f90
===================================================================
--- palm/trunk/SOURCE/chemistry_model_mod.f90	(revision 3875)
+++ palm/trunk/SOURCE/chemistry_model_mod.f90	(revision 3876)
@@ -318,31 +318,4 @@
 
     LOGICAL ::  nest_chemistry = .TRUE.  !< flag for nesting mode of chemical species, independent on parent or not
-!
-!-  Define chemical variables within chem_species
-    TYPE species_def
-       CHARACTER(LEN=15)                            ::  name         !< name of chemical species
-       CHARACTER(LEN=15)                            ::  unit         !< unit (ppm for gases, kg m^-3 for aerosol tracers)
-       REAL(kind=wp), POINTER, DIMENSION(:,:,:)     ::  conc         !< concentrations of trace gases
-       REAL(kind=wp), POINTER, DIMENSION(:,:,:)     ::  conc_av      !< averaged concentrations
-       REAL(kind=wp), POINTER, DIMENSION(:,:,:)     ::  conc_p       !< conc at prognostic time level
-       REAL(kind=wp), POINTER, DIMENSION(:,:,:)     ::  tconc_m      !< weighted tendency of conc for previous sub-timestep (Runge-Kutta)
-       REAL(kind=wp), ALLOCATABLE, DIMENSION(:,:)   ::  cssws_av     !< averaged fluxes of trace gases at surface
-       REAL(kind=wp), ALLOCATABLE, DIMENSION(:,:)   ::  flux_s_cs    !< 6th-order advective flux at south face of grid box of chemical species (='cs')
-       REAL(kind=wp), ALLOCATABLE, DIMENSION(:,:)   ::  diss_s_cs    !< artificial numerical dissipation flux at south face of grid box of chemical species
-       REAL(kind=wp), ALLOCATABLE, DIMENSION(:,:,:) ::  flux_l_cs    !< 6th-order advective flux at left face of grid box of chemical species (='cs')
-       REAL(kind=wp), ALLOCATABLE, DIMENSION(:,:,:) ::  diss_l_cs    !< artificial numerical dissipation flux at left face of grid box of chemical species
-       REAL(kind=wp), ALLOCATABLE, DIMENSION(:)     ::  conc_pr_init !< initial profile of chemical species
-    END TYPE species_def
-!
-!-- Define photolysis frequencies in phot_frequen
-    TYPE photols_def                                                            
-       CHARACTER(LEN=15)                            :: name          !< name of pgotolysis frequency
-       CHARACTER(LEN=15)                            :: unit          !< unit (1/s)
-       REAL(kind=wp), POINTER, DIMENSION(:,:,:)     :: freq          !< photolysis frequency
-    END TYPE photols_def
-
-
-    TYPE(species_def), ALLOCATABLE, DIMENSION(:), TARGET, PUBLIC ::  chem_species
-    TYPE(photols_def), ALLOCATABLE, DIMENSION(:), TARGET, PUBLIC ::  phot_frequen  
 
     REAL(kind=wp), ALLOCATABLE, DIMENSION(:,:,:,:), TARGET ::  spec_conc_1  !< pointer for swapping of timelevels for conc
@@ -374,9 +347,4 @@
 
     REAL(kind=wp), PUBLIC ::  cs_time_step = 0._wp
-    CHARACTER(10), PUBLIC ::  photolysis_scheme
-                              !< 'constant',
-                              !< 'simple' (Simple parameterisation from MCM, Saunders et al., 2003, Atmos. Chem. Phys., 3, 161-180
-                              !< 'fastj'  (Wild et al., 2000, J. Atmos. Chem., 37, 245-282) STILL NOT IMPLEMENTED
-
 
 !
@@ -445,6 +413,4 @@
     PUBLIC nspec               !< number of gas phase chemical species including constant compound (e.g. N2)
     PUBLIC nvar                !< number of variable gas phase chemical species (nvar <= nspec)
-    PUBLIC photols_def         !< type defining phot_frequen
-    PUBLIC species_def         !< type defining chem_species
     PUBLIC spc_names           !< names of gas phase chemical species (come from KPP) (come from KPP)
     PUBLIC spec_conc_2  
Index: palm/trunk/SOURCE/multi_agent_system_mod.f90
===================================================================
--- palm/trunk/SOURCE/multi_agent_system_mod.f90	(revision 3875)
+++ palm/trunk/SOURCE/multi_agent_system_mod.f90	(revision 3876)
@@ -2775,10 +2775,4 @@
            ONLY:  u, v, pt, exner
 
-!       USE chemistry_model_mod,                                                &
-!           ONLY:  chem_species
-
-!       USE control_parameters,                                                 &
-!              ONLY:  air_chemistry
-
        IMPLICIT NONE
 
@@ -2846,18 +2840,5 @@
 !--                Calculate temperature at agent position
                    agents(nl)%t = pt(kl,jl,il) * exner(kl)
-! !
-! !--                Get PM10 concentration at agent position, if possible
-!                    IF ( ind_pm10 == -9 ) THEN
-!                       agents(nl)%pm10 = 0.0_wp
-!                    ELSE
-!                       agents(nl)%pm10 = chem_species(ind_pm10)%conc(kl,jl,il)
-!                    ENDIF
-! !
-! !--                Get PM10 concentration at agent position, if possible
-!                    IF ( ind_pm25 == -9 ) THEN
-!                       agents(nl)%pm25 = 0.0_wp
-!                    ELSE
-!                       agents(nl)%pm25 = chem_species(ind_pm25)%conc(kl,jl,il)
-!                    ENDIF
+
                 ENDDO
 
@@ -3017,10 +2998,4 @@
     SUBROUTINE mas_init
 
-!       USE chem_gasphase_mod,                                                  &
-!           ONLY:  nvar
-
-!       USE chemistry_model_mod,                                                &
-!           ONLY:  chem_species
-
        USE control_parameters,                                                 &
            ONLY:  coupling_char, initializing_actions, io_blocks, io_group
@@ -3108,18 +3083,5 @@
           ENDDO
        ENDDO
-! !
-! !--    Get indices of PM10 and PM2.5 species, if active
-!        IF ( air_chemistry ) THEN
-!           DO il = 1, nvar
-! print*,chem_species(il)%name
-! !              IF ( spec_name(1:4) == 'PM10' ) THEN  
-! !                 ind_pm10 = il
-! !              ELSEIF ( spec_name(1:4) == 'PM25' ) THEN
-! !                 ind_pm25 = il
-! !              ENDIF
-! 
-!           ENDDO
-!        ENDIF
-! stop
+
        CALL mas_create_obstacle_flags
 
Index: palm/trunk/SOURCE/nesting_offl_mod.f90
===================================================================
--- palm/trunk/SOURCE/nesting_offl_mod.f90	(revision 3875)
+++ palm/trunk/SOURCE/nesting_offl_mod.f90	(revision 3876)
@@ -63,5 +63,5 @@
                v_init, vg, w, zu, zw
                  
-    USE chemistry_model_mod,                                                   &
+    USE chem_modules,                                                          &
         ONLY:  chem_species
 
Index: palm/trunk/SOURCE/pmc_interface_mod.f90
===================================================================
--- palm/trunk/SOURCE/pmc_interface_mod.f90	(revision 3875)
+++ palm/trunk/SOURCE/pmc_interface_mod.f90	(revision 3876)
@@ -403,9 +403,12 @@
                roughness_length, salsa, topography, volume_flow
 
-    USE chem_gasphase_mod,                                                          &
+    USE chem_gasphase_mod,                                                     &
         ONLY:  nspec
 
+    USE chem_modules,                                                          &
+        ONLY:  chem_species
+
     USE chemistry_model_mod,                                                   &
-        ONLY:  chem_species, nest_chemistry, spec_conc_2
+        ONLY:  nest_chemistry, spec_conc_2
 
     USE cpulog,                                                                &
Index: palm/trunk/SOURCE/prognostic_equations.f90
===================================================================
--- palm/trunk/SOURCE/prognostic_equations.f90	(revision 3875)
+++ palm/trunk/SOURCE/prognostic_equations.f90	(revision 3876)
@@ -389,5 +389,5 @@
     USE chem_modules,                                                          &
         ONLY:  call_chem_at_all_substeps, chem_gasphase_on, cs_name,           &
-               deposition_dry
+               deposition_dry, chem_species
 
     USE chem_gasphase_mod,                                                     &
@@ -399,5 +399,5 @@
     USE chemistry_model_mod,                                                   &
         ONLY:  chem_boundary_conds, chem_depo, chem_integrate,                 &
-               chem_prognostic_equations, chem_species
+               chem_prognostic_equations
 
     USE control_parameters,                                                    &
Index: palm/trunk/SOURCE/salsa_mod.f90
===================================================================
--- palm/trunk/SOURCE/salsa_mod.f90	(revision 3875)
+++ palm/trunk/SOURCE/salsa_mod.f90	(revision 3876)
@@ -135,9 +135,6 @@
         ONLY:  nspec, nvar, spc_names
 
-    USE chemistry_model_mod,                                                   &
-        ONLY:  chem_species
-
     USE chem_modules,                                                          &
-        ONLY:  call_chem_at_all_substeps, chem_gasphase_on
+        ONLY:  call_chem_at_all_substeps, chem_gasphase_on, chem_species
 
     USE control_parameters
Index: palm/trunk/SOURCE/time_integration.f90
===================================================================
--- palm/trunk/SOURCE/time_integration.f90	(revision 3875)
+++ palm/trunk/SOURCE/time_integration.f90	(revision 3876)
@@ -509,8 +509,8 @@
 
     USE chem_modules,                                                                              &
-        ONLY:  bc_cs_t_val, cs_name, emissions_anthropogenic, nspec_out
+        ONLY:  bc_cs_t_val, cs_name, emissions_anthropogenic, nspec_out, chem_species
 
     USE chemistry_model_mod,                                                                       &
-        ONLY:  chem_boundary_conds, chem_species
+        ONLY:  chem_boundary_conds
 
     USE control_parameters,                                                                        &
@@ -892,5 +892,5 @@
 
 !
-!--    Execute alle other module actions routunes
+!--    Execute all other module actions routunes
        CALL module_interface_actions( 'before_timestep' )
        
@@ -950,5 +950,7 @@
              CALL calc_mean_profile( q, 41 )
           ENDIF
-
+!
+!--       Execute all other module actions routunes
+          CALL module_interface_actions( 'before_prognostic_equations' )
 !
 !--       Solve the prognostic equations. A fast cache optimized version with
Index: palm/trunk/SOURCE/virtual_measurement_mod.f90
===================================================================
--- palm/trunk/SOURCE/virtual_measurement_mod.f90	(revision 3875)
+++ palm/trunk/SOURCE/virtual_measurement_mod.f90	(revision 3876)
@@ -86,5 +86,5 @@
         ONLY:  nvar
 
-    USE chemistry_model_mod,                                                   &
+    USE chem_modules,                                                          &
         ONLY:  chem_species
         
