1 | !> @file chem_modules.f90 |
---|
2 | !------------------------------------------------------------------------------! |
---|
3 | ! This file is part of the PALM model system. |
---|
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 | ! |
---|
17 | ! Copyright 1997-2018 Leibniz Universitaet Hannover |
---|
18 | ! Copyright 2017-2018 Karlsruhe Institute of Technology |
---|
19 | ! Copyright 2017-2018 Freie Universitaet Berlin |
---|
20 | !------------------------------------------------------------------------------! |
---|
21 | ! |
---|
22 | ! Current revisions: |
---|
23 | ! ----------------- |
---|
24 | ! |
---|
25 | ! |
---|
26 | ! Former revisions: |
---|
27 | ! ----------------- |
---|
28 | ! $Id: chem_modules.f90 2766 2018-01-22 17:17:47Z witha $ |
---|
29 | ! Removed preprocessor directive __chem |
---|
30 | ! |
---|
31 | ! 2718 2018-01-02 08:49:38Z maronga |
---|
32 | ! Initial revision |
---|
33 | ! |
---|
34 | ! |
---|
35 | ! |
---|
36 | ! |
---|
37 | ! Authors: |
---|
38 | ! -------- |
---|
39 | ! @author Farah Kanani-Suehring |
---|
40 | ! @author Basit Khan |
---|
41 | ! |
---|
42 | !------------------------------------------------------------------------------! |
---|
43 | ! Description: |
---|
44 | ! ------------ |
---|
45 | !> Definition of global palm-4u chemistry variables |
---|
46 | !> (Module written to define global palm-4u chemistry variables. basit 16Nov2017) |
---|
47 | !------------------------------------------------------------------------------! |
---|
48 | ! |
---|
49 | MODULE chem_modules |
---|
50 | |
---|
51 | USE kinds |
---|
52 | USE chem_gasphase_mod, & |
---|
53 | ONLY: nspec, nvar, spc_names |
---|
54 | |
---|
55 | |
---|
56 | IMPLICIT NONE |
---|
57 | |
---|
58 | PUBLIC nspec |
---|
59 | PUBLIC nvar |
---|
60 | PUBLIC spc_names |
---|
61 | |
---|
62 | LOGICAL :: constant_top_csflux(99) = .TRUE. !< chem spcs at the top orig .TRUE. |
---|
63 | LOGICAL :: constant_csflux(99) = .TRUE. !< chem spcs at namelist parameter orig TRUE |
---|
64 | |
---|
65 | |
---|
66 | INTEGER(iwp) :: cs_vertical_gradient_level_ind(99,10) = -9999 !< grid index values of cs_vertical_gradient_level_ind(s) |
---|
67 | REAL(wp), DIMENSION(:), ALLOCATABLE :: bc_cs_t_val |
---|
68 | INTEGER(iwp) :: ibc_cs_b !< integer flag for bc_cs_b |
---|
69 | INTEGER(iwp) :: ibc_cs_t !< integer flag for bc_cs_t |
---|
70 | |
---|
71 | REAL(wp), DIMENSION(:), ALLOCATABLE :: css !< scaling parameter for chem spcs |
---|
72 | |
---|
73 | !-- Namelist parameters for creating initial chemistry profiles |
---|
74 | CHARACTER (LEN=20) :: bc_cs_b = 'dirichlet' !< namelist parameter |
---|
75 | CHARACTER (LEN=20) :: bc_cs_t = 'initial_gradient' !< namelist parameter |
---|
76 | REAL(wp) :: wall_csflux (99,0:5) = 0.0_wp !< namelist parameter |
---|
77 | REAL(wp) :: cs_vertical_gradient (99,10) = 0.0_wp !< namelist parameter |
---|
78 | REAL(wp) :: cs_vertical_gradient_level (99,10) = -999999.9_wp !< namelist parameter |
---|
79 | REAL(wp) :: top_csflux ( 99 ) = 0.0_wp !< namelist parameter |
---|
80 | REAL(wp) :: cs_surface_initial_change(99) = 0.0_wp !< namelist parameter |
---|
81 | REAL(wp) :: surface_csflux(99 ) = 0.0_wp !< namelist parameter: fluxes where 'surface_csflux_name' is in the namelist |
---|
82 | ! RFo: I do not know whether it makes sense to have 'constant_csflux=.TRUE. for only these species where |
---|
83 | ! no flux is given in the namelist. Let's choos surface_csflux=0.0 (and thus 'constant_csflux'=.TRUE.) as default |
---|
84 | ! To obtain constant_csflux=.FALSE., set surface_csflux = 9999999.9 in the namelist |
---|
85 | ! @todo: need to think a bit more about constant_csflux for chemistry. |
---|
86 | |
---|
87 | LOGICAL :: call_chem_at_all_substeps = .FALSE. !< namelist parameter |
---|
88 | LOGICAL :: chem_debug0 = .FALSE. !< namelist parameter flag for minimum print output |
---|
89 | LOGICAL :: chem_debug1 = .FALSE. !< namelist parameter flag for print output |
---|
90 | LOGICAL :: chem_debug2 = .FALSE. !< namelist parameter flag for further print output |
---|
91 | LOGICAL :: chem_gasphase_on = .TRUE. !< namelist parameter |
---|
92 | |
---|
93 | CHARACTER (LEN=11), DIMENSION(99) :: cs_name = 'novalue' !< Namelist parameter: chem spcs names |
---|
94 | CHARACTER (LEN=11), DIMENSION(99) :: cs_profile_name = 'novalue' !< Namelist parameter: Names of the |
---|
95 | CHARACTER (LEN=11), DIMENSION(99) :: surface_csflux_name = 'novalue' !< Namelist parameter: chem species surface fluxes names |
---|
96 | !< active chem spcs, default is 'novalue') ???? |
---|
97 | REAL(wp), DIMENSION(99) :: cs_surface = 0.0_wp !< Namelist parameter: Surface conc of chem spcs' |
---|
98 | REAL(wp), DIMENSION(99,100) :: cs_heights = 9999999.9_wp !< Namelist parameter: Height lvls(m) for cs_profiles |
---|
99 | REAL(wp), DIMENSION(99,100) :: cs_profile = 9999999.9_wp !< Namelist parameter: Chem conc for each spcs defined |
---|
100 | |
---|
101 | #if defined( __nopointer ) |
---|
102 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, TARGET :: cs !< chem spcs |
---|
103 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, TARGET :: cs_p !< prognostic value of chem spc |
---|
104 | REAL(wp), DIMENSION(:,:,:), ALLOCATABLE, TARGET :: tcs_m !< weighted tendency of s for previous sub-timestep (Runge-Kutta) |
---|
105 | |
---|
106 | #else |
---|
107 | ! use pointers cs, cs_p and tcs_m to point arrays cs_1, cs_2, and cs_3 |
---|
108 | REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE, TARGET :: cs_1 !< pointer for swapping of timelevels for respective quantity |
---|
109 | REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE, TARGET :: cs_2 !< pointer for swapping of timelevels for respective quantity |
---|
110 | REAL(wp), DIMENSION(:,:,:,:), ALLOCATABLE, TARGET :: cs_3 !< pointer for swapping of timelevels for respective quantity |
---|
111 | |
---|
112 | REAL(wp), DIMENSION(:,:,:), POINTER :: cs !< pointer: sgs chem spcs) |
---|
113 | REAL(wp), DIMENSION(:,:,:), POINTER :: cs_p !< pointer: prognostic value of sgs chem spcs |
---|
114 | REAL(wp), DIMENSION(:,:,:), POINTER :: tcs_m !< pointer: |
---|
115 | |
---|
116 | #endif |
---|
117 | !< by cs_name for each height lvls defined by cs_heights |
---|
118 | ! |
---|
119 | !-- Namelist parameters for chem_emissions |
---|
120 | INTEGER(iwp) :: main_street_id = 0 |
---|
121 | INTEGER(iwp) :: max_street_id = 0 |
---|
122 | INTEGER(iwp) :: side_street_id = 0 |
---|
123 | ! |
---|
124 | !-- Constant emission factors |
---|
125 | REAL(wp) :: emiss_factor_main = 0.0_wp |
---|
126 | REAL(wp) :: emiss_factor_side = 0.0_wp |
---|
127 | |
---|
128 | !-- Emission factors with daily cycle |
---|
129 | ! REAL(wp), DIMENSION(1:24) :: emiss_factor_main = 0.0_wp |
---|
130 | ! REAL(wp), DIMENSION(1:24) :: emiss_factor_side = 0.0_wp |
---|
131 | |
---|
132 | SAVE |
---|
133 | |
---|
134 | END MODULE chem_modules |
---|
135 | |
---|