[2615] | 1 | !> @file chem_modules.f90 |
---|
| 2 | !------------------------------------------------------------------------------! |
---|
[2828] | 3 | ! This file is part of the PALM model system. |
---|
[2615] | 4 | ! |
---|
| 5 | ! PALM is free software: you can redistribute it and/or modify it under the |
---|
| 6 | ! terms of the GNU General Public License as published by the Free Software |
---|
| 7 | ! Foundation, either version 3 of the License, or (at your option) any later |
---|
| 8 | ! version. |
---|
| 9 | ! |
---|
| 10 | ! PALM is distributed in the hope that it will be useful, but WITHOUT ANY |
---|
| 11 | ! WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR |
---|
| 12 | ! A PARTICULAR PURPOSE. See the GNU General Public License for more details. |
---|
| 13 | ! |
---|
| 14 | ! You should have received a copy of the GNU General Public License along with |
---|
| 15 | ! PALM. If not, see <http://www.gnu.org/licenses/>. |
---|
| 16 | ! |
---|
[3298] | 17 | ! Copyright 2018-2018 Leibniz Universitaet Hannover |
---|
| 18 | ! Copyright 2018-2018 Karlsruhe Institute of Technology |
---|
| 19 | ! Copyright 2018-2018 Freie Universitaet Berlin |
---|
[2615] | 20 | !------------------------------------------------------------------------------! |
---|
| 21 | ! |
---|
| 22 | ! Current revisions: |
---|
[2828] | 23 | ! ----------------- |
---|
[2615] | 24 | ! |
---|
[3298] | 25 | ! |
---|
[2615] | 26 | ! Former revisions: |
---|
| 27 | ! ----------------- |
---|
| 28 | ! $Id: chem_modules.f90 3780 2019-03-05 11:19:45Z hellstea $ |
---|
[3780] | 29 | ! added cs_mech |
---|
| 30 | ! |
---|
| 31 | ! |
---|
| 32 | ! 3652 2019-01-07 15:29:59Z forkel |
---|
[3652] | 33 | ! parameter chem_mechanism added (basit) |
---|
| 34 | ! |
---|
| 35 | ! |
---|
| 36 | ! 3636 2018-12-19 13:48:34Z raasch |
---|
[3636] | 37 | ! nopointer option removed |
---|
| 38 | ! |
---|
| 39 | ! 3611 2018-12-07 14:14:11Z banzhafs |
---|
[3611] | 40 | ! Minor formatting |
---|
| 41 | ! |
---|
| 42 | ! 3458 2018-10-30 14:51:23Z kanani |
---|
[3458] | 43 | ! from chemistry branch r3443: |
---|
| 44 | ! ?? |
---|
[3611] | 45 | ! |
---|
[3458] | 46 | ! 3298 2018-10-02 12:21:11Z kanani |
---|
[3298] | 47 | ! - Minor formatting |
---|
| 48 | ! - Introduced Variables for Chemistry emissions Module (Russo) |
---|
| 49 | ! - Variables and parameters added for 2d and profile output (basit) |
---|
| 50 | ! - Converted scalar emission factors to 1-D array of 99 elements each (basit) |
---|
| 51 | ! - Removed "__chem" directive (basit) |
---|
| 52 | ! |
---|
| 53 | ! 3282 2018-09-27 10:49:12Z basit |
---|
[2828] | 54 | ! Initial revision |
---|
| 55 | ! |
---|
| 56 | ! Authors: |
---|
| 57 | ! -------- |
---|
| 58 | ! @author Farah Kanani-Suehring |
---|
| 59 | ! @author Basit Khan |
---|
[3458] | 60 | ! @author Sabine Banzhaf |
---|
| 61 | ! @author Emmanuele Russo |
---|
[2828] | 62 | ! |
---|
[2615] | 63 | !------------------------------------------------------------------------------! |
---|
| 64 | ! Description: |
---|
| 65 | ! ------------ |
---|
[3636] | 66 | !> Definition of global PALM-4U chemistry variables |
---|
[2615] | 67 | !------------------------------------------------------------------------------! |
---|
| 68 | ! |
---|
[2828] | 69 | MODULE chem_modules |
---|
[3085] | 70 | |
---|
[2615] | 71 | USE chem_gasphase_mod, & |
---|
[3780] | 72 | ONLY: cs_mech, nspec, nvar, spc_names |
---|
[2615] | 73 | |
---|
[3085] | 74 | USE control_parameters, & |
---|
| 75 | ONLY: varnamelength |
---|
[2615] | 76 | |
---|
[3085] | 77 | USE kinds |
---|
| 78 | |
---|
| 79 | USE statistics, & |
---|
| 80 | ONLY: pr_palm |
---|
| 81 | |
---|
| 82 | |
---|
[2615] | 83 | IMPLICIT NONE |
---|
| 84 | |
---|
[3780] | 85 | PUBLIC cs_mech |
---|
[2615] | 86 | PUBLIC nspec |
---|
| 87 | PUBLIC nvar |
---|
| 88 | PUBLIC spc_names |
---|
| 89 | |
---|
[3611] | 90 | INTEGER(iwp), DIMENSION(99) :: cs_pr_index = 0 |
---|
| 91 | INTEGER(iwp) :: ibc_cs_b !< integer flag for bc_cs_b |
---|
| 92 | INTEGER(iwp) :: ibc_cs_t !< integer flag for bc_cs_t |
---|
| 93 | INTEGER(iwp) :: cs_pr_count = 0 |
---|
| 94 | INTEGER(iwp) :: max_pr_cs = 0 |
---|
| 95 | INTEGER(iwp) :: cs_vertical_gradient_level_ind(99,10) = -9999 !< grid index values of cs_vertical_gradient_level_ind(s) |
---|
[2615] | 96 | |
---|
[3611] | 97 | LOGICAL :: constant_top_csflux(99) = .TRUE. !< chem spcs at the top orig .TRUE. |
---|
| 98 | LOGICAL :: constant_csflux(99) = .TRUE. !< chem spcs at namelist parameter orig TRUE |
---|
| 99 | LOGICAL :: call_chem_at_all_substeps = .FALSE. !< namelist parameter |
---|
| 100 | LOGICAL :: chem_debug0 = .FALSE. !< namelist parameter flag for minimum print output |
---|
| 101 | LOGICAL :: chem_debug1 = .FALSE. !< namelist parameter flag for print output |
---|
| 102 | LOGICAL :: chem_debug2 = .FALSE. !< namelist parameter flag for further print output |
---|
| 103 | LOGICAL :: chem_gasphase_on = .TRUE. !< namelist parameter |
---|
| 104 | LOGICAL :: emission_output_required = .TRUE. !< Logical Variable for requiring Emission Outputs |
---|
| 105 | LOGICAL :: do_emis = .FALSE. !< Flag for turning on chemistry emissions |
---|
| 106 | LOGICAL :: cs_pr_namelist_found = .FALSE. !< Namelist parameter: Names of t |
---|
| 107 | LOGICAL :: do_depo = .FALSE. !< namelist parameter for activation of deposition calculation |
---|
[2615] | 108 | |
---|
| 109 | |
---|
[3611] | 110 | ! |
---|
[2615] | 111 | !-- Namelist parameters for creating initial chemistry profiles |
---|
[3611] | 112 | REAL(wp) :: wall_csflux (99,0:5) = 0.0_wp !< namelist parameter |
---|
| 113 | REAL(wp) :: cs_vertical_gradient (99,10) = 0.0_wp !< namelist parameter |
---|
| 114 | REAL(wp) :: cs_vertical_gradient_level (99,10) = -999999.9_wp !< namelist parameter |
---|
| 115 | REAL(wp) :: top_csflux ( 99 ) = 0.0_wp !< namelist parameter |
---|
| 116 | REAL(wp) :: cs_surface_initial_change(99) = 0.0_wp !< namelist parameter |
---|
| 117 | REAL(wp) :: surface_csflux(99 ) = 0.0_wp !< namelist parameter: fluxes where 'surface_csflux_name' is in the namelist |
---|
[2615] | 118 | |
---|
[3611] | 119 | REAL(wp), DIMENSION(:), ALLOCATABLE :: bc_cs_t_val |
---|
| 120 | REAL(wp), DIMENSION(:), ALLOCATABLE :: css !< scaling parameter for chem spcs |
---|
| 121 | REAL(wp), DIMENSION(99) :: cs_surface = 0.0_wp !< Namelist parameter: Surface conc of chem spcs' |
---|
| 122 | REAL(wp), DIMENSION(99,100) :: cs_heights = 9999999.9_wp !< Namelist parameter: Height lvls(m) for cs_profiles |
---|
| 123 | REAL(wp), DIMENSION(99,100) :: cs_profile = 9999999.9_wp !< Namelist parameter: Chem conc for each spcs defined |
---|
[2615] | 124 | |
---|
[3611] | 125 | ! |
---|
| 126 | !-- Use pointers cs, cs_p and tcs_m to point arrays cs_1, cs_2, and cs_3 |
---|
| 127 | REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE, TARGET :: cs_1 !< pointer for swapping of timelevels for respective quantity |
---|
| 128 | REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE, TARGET :: cs_2 !< pointer for swapping of timelevels for respective quantity |
---|
| 129 | REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE, TARGET :: cs_3 !< pointer for swapping of timelevels for respective quantity |
---|
| 130 | REAL(wp), DIMENSION(:,:,:), POINTER :: cs !< pointer: sgs chem spcs) |
---|
| 131 | REAL(wp), DIMENSION(:,:,:), POINTER :: cs_p !< pointer: prognostic value of sgs chem spcs |
---|
| 132 | REAL(wp), DIMENSION(:,:,:), POINTER :: tcs_m !< pointer: |
---|
[3282] | 133 | |
---|
[3611] | 134 | CHARACTER (LEN=20) :: bc_cs_b = 'dirichlet' !< namelist parameter |
---|
| 135 | CHARACTER (LEN=20) :: bc_cs_t = 'initial_gradient' !< namelist parameter |
---|
| 136 | CHARACTER (LEN=11), DIMENSION(99) :: cs_name = 'novalue' !< Namelist parameter: chem spcs names |
---|
| 137 | CHARACTER (LEN=11), DIMENSION(99) :: cs_profile_name = 'novalue' !< Namelist parameter: Names of the chem for profiles |
---|
| 138 | CHARACTER (LEN=11), DIMENSION(99) :: surface_csflux_name = 'novalue' !< Namelist parameter: chem species surface fluxes names |
---|
| 139 | !< active chem spcs, default is 'novalue') ???? |
---|
| 140 | CHARACTER (LEN=80) :: mode_emis ='PARAMETERIZED' !< Mode of chemistry emissions: DEFAULT .OR. EXPERT .OR. |
---|
| 141 | !< PARAMETERIZED |
---|
| 142 | CHARACTER (LEN=80) :: time_fac_type ='MDH' !< Type of time treatment in the emis DEFAULT mode: HOUR .OR. MDH |
---|
| 143 | CHARACTER (LEN=80) :: daytype_mdh ='workday' !< Type of day in the MDH case: workday, weekend, holiday |
---|
[3652] | 144 | CHARACTER (LEN=11), DIMENSION(99) :: data_output_pr_cs = 'novalue' !< Namelist parameter: Names of the chem species for profile output |
---|
[3611] | 145 | !< by cs_name for each height lvls defined by cs_heights |
---|
[3652] | 146 | CHARACTER (LEN=30) :: chem_mechanism = 'phstatp' !< Namelist parameter: Name of chemistry mechanism |
---|
| 147 | !< (must match with third line in chem_gasphase_mod.f90) |
---|
[2828] | 148 | ! |
---|
| 149 | !-- Namelist parameters for chem_emissions |
---|
| 150 | INTEGER(iwp) :: main_street_id = 0 |
---|
[3282] | 151 | INTEGER(iwp) :: max_street_id = 0 |
---|
[2828] | 152 | INTEGER(iwp) :: side_street_id = 0 |
---|
| 153 | ! |
---|
| 154 | !-- Constant emission factors |
---|
[3266] | 155 | REAL(wp) :: emiss_factor_main ( 99 ) = -9999.0_wp |
---|
| 156 | REAL(wp) :: emiss_factor_side ( 99 ) = -9999.0_wp |
---|
[3611] | 157 | ! |
---|
[3190] | 158 | !-- Other Emissions Variables |
---|
[3282] | 159 | INTEGER(iwp) :: nspec_out !< Output of routine chem_emis_matching with |
---|
| 160 | !< number of matched species |
---|
[3611] | 161 | REAL(wp),ALLOCATABLE, DIMENSION(:,:,:,:) :: emis_distribution !> Emissions Final Values (main module output) |
---|
[3190] | 162 | |
---|
[3611] | 163 | INTEGER(iwp),ALLOCATABLE,DIMENSION(:) :: match_spec_input !< Index of Input chem species for matching routine |
---|
| 164 | INTEGER(iwp),ALLOCATABLE,DIMENSION(:) :: match_spec_model !< Index of Model chem species for matching routine |
---|
| 165 | INTEGER(iwp),ALLOCATABLE,DIMENSION(:) :: match_spec_voc_input !< index of VOC input components matching the model's VOCs |
---|
| 166 | INTEGER(iwp),ALLOCATABLE,DIMENSION(:) :: match_spec_voc_model !< index of VOC model species matching the input VOCs comp. |
---|
| 167 | INTEGER(iwp),DIMENSION(:) :: match_spec_pm(1:3) !< results of matching the input and model's PMs |
---|
| 168 | INTEGER(iwp),DIMENSION(:) :: match_spec_nox(1:2) !< results of matching the input and model's NOx |
---|
| 169 | INTEGER(iwp),DIMENSION(:) :: match_spec_sox(1:2) !< results of matching the input and model's SOx! |
---|
| 170 | |
---|
[3190] | 171 | |
---|
[3611] | 172 | ! |
---|
| 173 | !-- Selected atomic/molecular weights: |
---|
| 174 | REAL, PARAMETER :: xm_H = 1.00790e-3 !< kg/mol |
---|
| 175 | REAL, PARAMETER :: xm_N = 14.00670e-3 !< kg/mol |
---|
| 176 | REAL, PARAMETER :: xm_C = 12.01115e-3 !< kg/mol |
---|
| 177 | REAL, PARAMETER :: xm_S = 32.06400e-3 !< kg/mol |
---|
| 178 | REAL, PARAMETER :: xm_O = 15.99940e-3 !< kg/mol |
---|
| 179 | REAL, PARAMETER :: xm_F = 18.99840e-3 !< kg/mol |
---|
| 180 | REAL, PARAMETER :: xm_Na = 22.98977e-3 !< kg/mol |
---|
| 181 | REAL, PARAMETER :: xm_Cl = 35.45300e-3 !< kg/mol |
---|
| 182 | REAL, PARAMETER :: xm_Rn222 = 222.00000e-3 !< kg/mol |
---|
| 183 | REAL, PARAMETER :: xm_Pb210 = 210.00000e-3 !< kg/mol |
---|
| 184 | REAL, PARAMETER :: xm_Ca = 40.07800e-3 !< kg/mol |
---|
| 185 | REAL, PARAMETER :: xm_K = 39.09800e-3 !< kg/mol |
---|
| 186 | REAL, PARAMETER :: xm_Mg = 24.30500e-3 !< kg/mol |
---|
| 187 | REAL, PARAMETER :: xm_Pb = 207.20000e-3 !< kg/mol |
---|
| 188 | REAL, PARAMETER :: xm_Cd = 112.41000e-3 !< kg/mol |
---|
[3458] | 189 | |
---|
[3611] | 190 | REAL, PARAMETER :: xm_h2o = xm_H * 2 + xm_O !< kg/mol |
---|
| 191 | REAL, PARAMETER :: xm_o3 = xm_O * 3 !< kg/mol |
---|
| 192 | REAL, PARAMETER :: xm_N2O5 = xm_N * 2 + xm_O * 5 !< kg/mol |
---|
| 193 | REAL, PARAMETER :: xm_HNO3 = xm_H + xm_N + xm_O * 3 !< kg/mol |
---|
| 194 | REAL, PARAMETER :: xm_NH4 = xm_N + xm_H * 4 !< kg/mol |
---|
| 195 | REAL, PARAMETER :: xm_SO4 = xm_S + xm_O * 4 !< kg/mol |
---|
| 196 | REAL, PARAMETER :: xm_NO3 = xm_N + xm_O * 3 !< kg/mol |
---|
| 197 | REAL, PARAMETER :: xm_CO2 = xm_C + xm_O * 2 !< kg/mol |
---|
[3458] | 198 | |
---|
[3611] | 199 | ! |
---|
| 200 | !-- mass of air |
---|
| 201 | REAL, PARAMETER :: xm_air = 28.964e-3 !< kg/mol |
---|
[3458] | 202 | |
---|
[3611] | 203 | ! |
---|
| 204 | !-- dummy weight, used for complex molecules: |
---|
[3458] | 205 | REAL, PARAMETER :: xm_dummy = 1000.0e-3 ! kg/mol |
---|
| 206 | |
---|
| 207 | |
---|
[2615] | 208 | SAVE |
---|
[2828] | 209 | END MODULE chem_modules |
---|
[2615] | 210 | |
---|