Index: palm/trunk/SOURCE/chem_modules.f90
===================================================================
--- palm/trunk/SOURCE/chem_modules.f90	(revision 4577)
+++ palm/trunk/SOURCE/chem_modules.f90	(revision 4581)
@@ -26,4 +26,7 @@
 ! -----------------
 ! $Id$
+! Enable output of vertical fluxes of chemical species.
+! 
+! 4577 2020-06-25 09:53:58Z raasch
 ! further re-formatting concerning Fortran parameter variables
 !
@@ -163,6 +166,7 @@
                                             !< 4: non-cyclic
 
-    INTEGER(iwp) ::  cs_pr_count                           = 0      !< counter for chemical species
-                                                                    !< profiles
+    INTEGER(iwp) ::  cs_pr_count_fl_res                    = 0      !< counter for vertical flux profiles of chemical species (resolved-scale)
+    INTEGER(iwp) ::  cs_pr_count_fl_sgs                    = 0      !< counter for vertical flux profiles of chemical species (SGS)
+    INTEGER(iwp) ::  cs_pr_count_sp                        = 0      !< counter for chemical species profiles
     INTEGER(iwp) ::  cs_vertical_gradient_level_ind(99,10) = -9999  !< grid index values of
                                                                     !< cs_vertical_gradient_level
@@ -174,5 +178,5 @@
     INTEGER(iwp) ::  main_street_id                        = 0      !< namelist parameter: lower bound of main street IDs
                                                                     !< (OpenStreetMaps) for PARAMETERIZED mode
-    INTEGER(iwp) ::  max_pr_cs                             = 0      !<
+    INTEGER(iwp) ::  max_pr_cs                             = 0      !< number of chemistry profiles in output
     INTEGER(iwp) ::  max_street_id                         = 0      !< namelist parameter: upper bound of main street IDs
                                                                     !< (OpenStreetMaps) for PARAMETERIZED mode
@@ -182,11 +186,13 @@
                                                                     !< (OpenStreetMaps) for PARAMETERIZED mode
 
-    INTEGER(iwp), DIMENSION(99) ::  cs_pr_index  = 0      !< index for chemical species profiles
-    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), DIMENSION(99) ::  cs_pr_index_sp      = 0 !< index for chemical species mean profiles
+    INTEGER(iwp), DIMENSION(99) ::  cs_pr_index_fl_res  = 0 !< index for chemical species sgs-flux profiles
+    INTEGER(iwp), DIMENSION(99) ::  cs_pr_index_fl_sgs  = 0 !< index for chemical species resolved-scale flux profiles
+    INTEGER(iwp), DIMENSION(99) ::  hom_index_fl_res    = 0 !< index of the resolved-scale flux profile with respect to the hom array
+    INTEGER(iwp), DIMENSION(99) ::  hom_index_fl_sgs    = 0 !< index of the SGS flux profile with respect to the hom array
+    INTEGER(iwp), DIMENSION(99) ::  hom_index_spec      = 0 !< index of the profile with respect to the hom array
+    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), DIMENSION(:), ALLOCATABLE ::  match_spec_input      !< index of input chem species
@@ -262,6 +268,7 @@
     REAL(wp), DIMENSION(:), ALLOCATABLE ::  css          !< scaling parameter for chem species
 
-    REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::  emis_distribution  !< emissions final values
-                                                                     !< (main module output) ???
+    REAL(wp), DIMENSION(:,:,:),   ALLOCATABLE, TARGET ::  sums_ws_l  !< subdomain sum of vertical chemistry flux w'ch'
+
+    REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE ::  emis_distribution  !< emissions final values (main module output) ???
 
     REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE, TARGET ::  cs_1  !< pointer for swapping of
