1 | !> @file chem_photolysis_mod.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 2018-2018 Leibniz Universitaet Hannover |
---|
18 | ! Copyright 2018-2018 Karlsruhe Institute of Technology |
---|
19 | !------------------------------------------------------------------------------! |
---|
20 | ! |
---|
21 | ! Current revisions: |
---|
22 | ! ----------------- |
---|
23 | ! |
---|
24 | ! |
---|
25 | ! Former revisions: |
---|
26 | ! ----------------- |
---|
27 | ! $Id: chem_photolysis_mod.f90 4180 2019-08-21 14:37:54Z scharf $ |
---|
28 | ! some formatting and comments added |
---|
29 | ! |
---|
30 | ! 3824 2019-03-27 15:56:16Z pavelkrc |
---|
31 | ! unused variables removed |
---|
32 | ! |
---|
33 | !------------------------------------------------------------------------------! |
---|
34 | ! Description: |
---|
35 | ! ------------ |
---|
36 | !> photolysis models and interfaces (Adapted from photolysis_model_mod.f90) |
---|
37 | !> @todo more complex scheme, add shading |
---|
38 | !------------------------------------------------------------------------------! |
---|
39 | MODULE chem_photolysis_mod |
---|
40 | |
---|
41 | ! USE arrays_3d, & |
---|
42 | ! ONLY: dzw, q, ql, zu, zw |
---|
43 | |
---|
44 | USE control_parameters, & |
---|
45 | ONLY: time_since_reference_point |
---|
46 | |
---|
47 | USE pegrid, & |
---|
48 | ONLY: myid, threads_per_task |
---|
49 | |
---|
50 | USE indices, & |
---|
51 | ONLY: nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzt |
---|
52 | |
---|
53 | USE control_parameters, & |
---|
54 | ONLY: initializing_actions |
---|
55 | |
---|
56 | USE chem_gasphase_mod, & |
---|
57 | ONLY: nphot, phot_names, phot |
---|
58 | |
---|
59 | USE chem_modules, & |
---|
60 | ONLY: phot_frequen, photolysis_scheme |
---|
61 | |
---|
62 | USE chem_modules, & |
---|
63 | ONLY: chem_debug2 |
---|
64 | |
---|
65 | USE kinds |
---|
66 | |
---|
67 | #if defined ( __netcdf ) |
---|
68 | USE NETCDF |
---|
69 | #endif |
---|
70 | |
---|
71 | |
---|
72 | IMPLICIT NONE |
---|
73 | |
---|
74 | |
---|
75 | ! LOGICAL :: unscheduled_photolysis_calls = .TRUE., & !< flag parameter indicating whether additional calls of the photolysis code are allowed |
---|
76 | ! constant_albedo = .FALSE., & !< flag parameter indicating whether the albedo may change depending on zenith |
---|
77 | ! force_photolysis_call = .FALSE., & !< flag parameter for unscheduled photolysis calls |
---|
78 | ! photolysis = .FALSE., & !< flag parameter indicating whether the photolysis model is used |
---|
79 | ! sun_up = .TRUE., & !< flag parameter indicating whether the sun is up or down |
---|
80 | ! photolysis = .TRUE., & !< flag parameter indicing whether photolysis shall be calculated |
---|
81 | ! sun_direction = .FALSE. !< flag parameter indicing whether solar direction shall be calculated |
---|
82 | |
---|
83 | !-- Parameters for constant photolysis frequencies |
---|
84 | INTEGER,PARAMETER :: nconst = 15 !< available predefined photolysis prequencies for constant |
---|
85 | |
---|
86 | ! Names for predefined fixed photolysis frequencies at zenith angle 0 |
---|
87 | CHARACTER(LEN=10), PARAMETER, DIMENSION(nconst) :: names_c = (/ & |
---|
88 | 'J_O31D ','J_O33P ','J_NO2 ','J_HNO3 ','J_RCHO ', & |
---|
89 | 'J ','J ','J ','J ','J ', & |
---|
90 | 'J ','J ','J ','J ','J ' /) |
---|
91 | ! Photolysis frequency at zenith angle 0 degrees in 1/s |
---|
92 | REAL(wp), PARAMETER, DIMENSION(nconst) :: phot0 = (/ & |
---|
93 | 2.489E-05_wp,3.556E-04_wp, 8.89E-03_wp,5.334E-07_wp,3.734E-05_wp, & |
---|
94 | 0.0000E00_wp,0.0000E00_wp,0.0000E00_wp,0.0000E00_wp,0.0000E00_wp, & |
---|
95 | 0.0000E00_wp,0.0000E00_wp,0.0000E00_wp,0.0000E00_wp,0.0000E00_wp /) |
---|
96 | |
---|
97 | !-- Parameters for simple photolysis frequencies from MCM (http://mcm.leeds.ac.uk/MCM) |
---|
98 | !-- Saunders et al., 2003, Atmos. Chem. Phys., 3, 161-180 |
---|
99 | INTEGER,PARAMETER :: nsimple = 15 !< available predefined photolysis prequencies for simple parameterisation |
---|
100 | ! Names for simple photolysis frequencies parameterisation ( |
---|
101 | CHARACTER(LEN=10), PARAMETER, DIMENSION(nsimple) :: names_s = (/ & |
---|
102 | 'J_O31D ','J_O33P ','J_H2O2 ','J_NO2 ','J_NO3_A ', & |
---|
103 | 'J_NO3_B ','J_HONO ','J_HNO3 ','J_HCHO_A ','J_HCHO_B ', & |
---|
104 | 'J_CH3CHO ','J ','J ','J ','J_RCHO ' /) |
---|
105 | |
---|
106 | !-- Species dependent parameters for simple photolysis frequencies from MCM (http://mcm.leeds.ac.uk/MCM) |
---|
107 | !-- J = l*COSx@m*EXP(-n*SECx) with l,m,n named par_l etc., x is the zenith angle |
---|
108 | REAL(wp), PARAMETER, DIMENSION(nconst) :: par_l = (/ & |
---|
109 | 6.073E-05_wp,4.775E-04_wp,1.041E-05_wp,1.165E-02_wp,2.485E-02_wp, & |
---|
110 | 1.747E-01_wp,2.644E-03_wp,9.312E-07_wp,4.642E-05_wp,6.853E-05_wp, & |
---|
111 | 7.344E-06_wp,0.0000E00_wp,0.0000E00_wp,0.000E00_wp, 6.853E-05_wp /) |
---|
112 | |
---|
113 | REAL(wp), PARAMETER, DIMENSION(nconst) :: par_m = (/ & |
---|
114 | 1.743_wp, 0.298_wp, 0.723_wp, 0.244_wp, 0.168_wp, & |
---|
115 | 0.155_wp, 0.261_wp, 1.230_wp, 0.762_wp, 0.477_wp, & |
---|
116 | 1.202_wp, 0.000_wp, 0.000_wp, 0.000_wp, 0.477_wp /) |
---|
117 | |
---|
118 | REAL(wp), PARAMETER, DIMENSION(nconst) :: par_n = (/ & |
---|
119 | 0.474_wp, 0.080_wp, 0.279_wp, 0.267_wp, 0.108_wp, & |
---|
120 | 0.125_wp, 0.288_wp, 0.307_wp, 0.353_wp, 0.323_wp, & |
---|
121 | 0.417_wp, 0.000_wp, 0.000_wp, 0.000_wp, 0.323_wp /) |
---|
122 | |
---|
123 | |
---|
124 | REAL(wp) :: cosz = 0.7_wp !< cosine of fixed zenith angle (45 deg, if not specified otherwise) |
---|
125 | |
---|
126 | ! |
---|
127 | INTERFACE photolysis_constant |
---|
128 | MODULE PROCEDURE photolysis_constant |
---|
129 | END INTERFACE photolysis_constant |
---|
130 | |
---|
131 | INTERFACE photolysis_simple |
---|
132 | MODULE PROCEDURE photolysis_simple |
---|
133 | END INTERFACE photolysis_simple |
---|
134 | ! |
---|
135 | ! INTERFACE photolysis_fastj |
---|
136 | ! MODULE PROCEDURE photolysis_fastj |
---|
137 | ! END INTERFACE photolysis_fastj |
---|
138 | ! |
---|
139 | INTERFACE photolysis_control |
---|
140 | MODULE PROCEDURE photolysis_control |
---|
141 | END INTERFACE photolysis_control |
---|
142 | |
---|
143 | SAVE |
---|
144 | |
---|
145 | PRIVATE |
---|
146 | |
---|
147 | PUBLIC photolysis_control |
---|
148 | |
---|
149 | PUBLIC photolysis_scheme |
---|
150 | |
---|
151 | CONTAINS |
---|
152 | |
---|
153 | |
---|
154 | !------------------------------------------------------------------------------! |
---|
155 | ! Description: |
---|
156 | ! ------------ |
---|
157 | !> This subroutine controls the calls of the photolysis schemes |
---|
158 | !------------------------------------------------------------------------------! |
---|
159 | SUBROUTINE photolysis_control |
---|
160 | |
---|
161 | IMPLICIT NONE |
---|
162 | |
---|
163 | SELECT CASE ( TRIM( photolysis_scheme ) ) |
---|
164 | |
---|
165 | CASE ( 'constant' ) |
---|
166 | CALL photolysis_constant |
---|
167 | |
---|
168 | CASE ( 'simple' ) |
---|
169 | CALL photolysis_simple |
---|
170 | |
---|
171 | ! CASE ( 'fastj' ) |
---|
172 | ! CALL photolysis_fastj |
---|
173 | |
---|
174 | CASE DEFAULT |
---|
175 | |
---|
176 | END SELECT |
---|
177 | |
---|
178 | |
---|
179 | END SUBROUTINE photolysis_control |
---|
180 | |
---|
181 | |
---|
182 | !------------------------------------------------------------------------------! |
---|
183 | ! Description: |
---|
184 | ! ------------ |
---|
185 | !> This scheme keeps the prescribed net radiation constant during the run |
---|
186 | !> Default zenith angle is 45 deg |
---|
187 | !------------------------------------------------------------------------------! |
---|
188 | SUBROUTINE photolysis_constant |
---|
189 | |
---|
190 | IMPLICIT NONE |
---|
191 | |
---|
192 | INTEGER(iwp) :: iphot,iav !< loop indix for photolysis reaction |
---|
193 | |
---|
194 | DO iphot = 1, nphot |
---|
195 | DO iav = 1, nconst |
---|
196 | IF ( TRIM( names_c(iav) ) == TRIM( phot_names(iphot) ) ) THEN |
---|
197 | !-- Prescribe fixed photolysis frequencies [1/s] |
---|
198 | phot_frequen(iphot)%freq(nzb+1:nzt,:,:) = & |
---|
199 | phot0(iav) * cosz |
---|
200 | ENDIF |
---|
201 | ENDDO |
---|
202 | ENDDO |
---|
203 | |
---|
204 | |
---|
205 | END SUBROUTINE photolysis_constant |
---|
206 | |
---|
207 | |
---|
208 | !------------------------------------------------------------------------------! |
---|
209 | ! Description: |
---|
210 | ! ------------ |
---|
211 | !> This scheme applies a simple parameterisation for clear sky photolysis frequencies |
---|
212 | !> from the Master Chemical Mechanism, MCM v3.2 (http://mcm.leeds.ac.uk/MCM). |
---|
213 | !> Reference: Saunders et al., Atmos. Chem. Phys., 3, 161, 2003 |
---|
214 | !> J = l*COSx@m*EXP(-n*SECx) with l,m,n named par_l etc., x is the zenith angle |
---|
215 | !------------------------------------------------------------------------------! |
---|
216 | SUBROUTINE photolysis_simple |
---|
217 | |
---|
218 | USE radiation_model_mod, & |
---|
219 | ONLY: calc_zenith, cos_zenith |
---|
220 | |
---|
221 | IMPLICIT NONE |
---|
222 | |
---|
223 | INTEGER(iwp) :: iphot,iav !< loop indix for photolysis reaction |
---|
224 | REAL(wp) :: coszi !< 1./cosine of zenith angle |
---|
225 | |
---|
226 | DO iphot = 1, nphot |
---|
227 | phot_frequen(iphot)%freq = 0.0_wp |
---|
228 | ENDDO |
---|
229 | |
---|
230 | CALL calc_zenith |
---|
231 | |
---|
232 | IF ( cos_zenith > 0.0_wp ) THEN |
---|
233 | coszi = 1. / cos_zenith |
---|
234 | |
---|
235 | DO iphot = 1, nphot |
---|
236 | DO iav = 1, nsimple |
---|
237 | IF ( TRIM( names_s(iav) ) == TRIM( phot_names(iphot) ) ) then |
---|
238 | phot_frequen(iphot)%freq(nzb+1:nzt,:,:) = & |
---|
239 | par_l(iav) * cos_zenith**par_m(iav) * EXP( -par_n(iav) * coszi ) |
---|
240 | ENDIF |
---|
241 | ENDDO |
---|
242 | ENDDO |
---|
243 | ENDIF |
---|
244 | |
---|
245 | |
---|
246 | END SUBROUTINE photolysis_simple |
---|
247 | |
---|
248 | END MODULE chem_photolysis_mod |
---|