source: palm/trunk/SOURCE/chem_photolysis_mod.f90 @ 4583

Last change on this file since 4583 was 4577, checked in by raasch, 4 years ago

further re-formatting to follow the PALM coding standard

  • Property svn:keywords set to Id
File size: 11.3 KB
Line 
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 terms of the GNU General
6! Public License as published by the Free Software Foundation, either version 3 of the License, or
7! (at your option) any later version.
8!
9! PALM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
10! implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
11! Public License for more details.
12!
13! You should have received a copy of the GNU General Public License along with PALM. If not, see
14! <http://www.gnu.org/licenses/>.
15!
16! Copyright 2018-2020 Leibniz Universitaet Hannover
17! Copyright 2018-2020 Karlsruhe Institute of Technology
18!--------------------------------------------------------------------------------------------------!
19!
20! Current revisions:
21! -----------------
22!
23!
24! Former revisions:
25! -----------------
26! $Id: chem_photolysis_mod.f90 4577 2020-06-25 09:53:58Z raasch $
27! further re-formatting to follow the PALM coding standard
28!
29! 4559 2020-06-11 08:51:48Z raasch
30! file re-formatted to follow the PALM coding standard
31!
32! 4481 2020-03-31 18:55:54Z maronga
33! Change call to calc_zenith
34!
35! 4223 2019-09-10 09:20:47Z gronemeier
36! Corrected "Former revisions" section
37!
38! 3876 2019-04-08 18:41:49Z knoop
39! some formatting and comments added
40!
41! 3824 2019-03-27 15:56:16Z pavelkrc
42! unused variables removed
43!
44! 2718 2018-01-02 08:49:38Z maronga
45! Initial revision
46!
47!
48! Authors:
49! --------
50! @author Renate Forkel
51!
52!--------------------------------------------------------------------------------------------------!
53! Description:
54! ------------
55!> photolysis models and interfaces (Adapted from photolysis_model_mod.f90)
56!> @todo more complex scheme, add shading
57!--------------------------------------------------------------------------------------------------!
58 MODULE chem_photolysis_mod
59
60!   USE arrays_3d,                                                                                  &
61!       ONLY:  dzw, q, ql, zu, zw
62
63    USE control_parameters,                                                                        &
64        ONLY:  time_since_reference_point
65
66    USE pegrid,                                                                                    &
67        ONLY: myid, threads_per_task
68
69    USE indices,                                                                                   &
70        ONLY:  nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzt
71
72    USE control_parameters,                                                                        &
73        ONLY:  initializing_actions
74
75    USE chem_gasphase_mod,                                                                         &
76        ONLY: nphot, phot, phot_names
77
78    USE chem_modules,                                                                              &
79        ONLY: phot_frequen, photolysis_scheme
80
81    USE chem_modules,                                                                              &
82        ONLY: chem_debug2
83
84    USE kinds
85
86#if defined ( __netcdf )
87    USE NETCDF
88#endif
89
90
91    IMPLICIT NONE
92
93
94!   LOGICAL ::  unscheduled_photolysis_calls = .TRUE., & !< flag parameter indicating whether additional calls of the photolysis
95!                                                        !< code are allowed
96!               constant_albedo = .FALSE.,             & !< flag parameter indicating whether the albedo may change depending on
97!                                                        !< zenith
98!               force_photolysis_call = .FALSE.,       & !< flag parameter for unscheduled photolysis calls
99!               photolysis = .FALSE.,                  & !< flag parameter indicating whether the photolysis model is used
100!               sun_up    = .TRUE.,                    & !< flag parameter indicating whether the sun is up or down
101!               photolysis = .TRUE.,                   & !< flag parameter indicing whether photolysis shall be calculated
102!               sun_direction = .FALSE.                  !< flag parameter indicing whether solar direction shall be calculated
103
104!
105!-- Parameters for constant photolysis frequencies
106    INTEGER,PARAMETER :: nconst  = 15               !< available predefined photolysis prequencies for constant
107!
108!-- Names for predefined fixed photolysis frequencies at zenith angle 0
109    CHARACTER(LEN=10), PARAMETER, DIMENSION(nconst) :: names_c =  (/                               &
110                     'J_O31D    ','J_O33P    ','J_NO2     ','J_HNO3    ','J_RCHO    ',             &
111                     'J         ','J         ','J         ','J         ','J         ',             &
112                     'J         ','J         ','J         ','J         ','J         ' /)
113!
114!-- Photolysis frequency at zenith angle 0 degrees in 1/s
115    REAL(wp), PARAMETER, DIMENSION(nconst) :: phot0 =  (/                                          &
116                      2.489E-05_wp, 3.556E-04_wp, 8.89E-03_wp,5.334E-07_wp, 3.734E-05_wp,          &
117                      0.0000E00_wp, 0.0000E00_wp, 0.0000E00_wp,0.0000E00_wp, 0.0000E00_wp,         &
118                      0.0000E00_wp, 0.0000E00_wp, 0.0000E00_wp,0.0000E00_wp, 0.0000E00_wp /)
119!
120!-- Parameters for simple photolysis frequencies from MCM (http://mcm.leeds.ac.uk/MCM)
121!-- Saunders et al., 2003, Atmos. Chem. Phys., 3, 161-180
122    INTEGER,PARAMETER :: nsimple = 15               !< available predefined photolysis prequencies for simple parameterisation
123!
124!-- Names for simple photolysis frequencies parameterisation (
125    CHARACTER(LEN=10), PARAMETER, DIMENSION(nsimple) :: names_s =  (/                              &
126                     'J_O31D    ','J_O33P    ','J_H2O2    ','J_NO2     ','J_NO3_A   ',             &
127                     'J_NO3_B   ','J_HONO    ','J_HNO3    ','J_HCHO_A  ','J_HCHO_B  ',             &
128                     'J_CH3CHO  ','J         ','J         ','J         ','J_RCHO    ' /)
129!
130!-- Species dependent parameters for simple photolysis frequencies from MCM
131!-- (http://mcm.leeds.ac.uk/MCM)
132!-- J = l*COSx@m*EXP(-n*SECx)  with l,m,n named par_l etc., x is the zenith angle
133    REAL(wp), PARAMETER, DIMENSION(nconst) :: par_l =  (/                                          &
134                       6.073E-05_wp, 4.775E-04_wp, 1.041E-05_wp, 1.165E-02_wp, 2.485E-02_wp,       &
135                       1.747E-01_wp, 2.644E-03_wp, 9.312E-07_wp, 4.642E-05_wp, 6.853E-05_wp,       &
136                       7.344E-06_wp, 0.0000E00_wp, 0.0000E00_wp, 0.000E00_wp,  6.853E-05_wp /)
137
138    REAL(wp), PARAMETER, DIMENSION(nconst) :: par_m =  (/                                          &
139                           1.743_wp,    0.298_wp,    0.723_wp,    0.244_wp,    0.168_wp,           &
140                           0.155_wp,    0.261_wp,    1.230_wp,    0.762_wp,    0.477_wp,           &
141                           1.202_wp,    0.000_wp,    0.000_wp,    0.000_wp,    0.477_wp /)
142
143    REAL(wp), PARAMETER, DIMENSION(nconst) :: par_n =  (/                                          &
144                           0.474_wp,    0.080_wp,    0.279_wp,    0.267_wp,    0.108_wp,           &
145                           0.125_wp,    0.288_wp,    0.307_wp,    0.353_wp,    0.323_wp,           &
146                           0.417_wp,    0.000_wp,    0.000_wp,    0.000_wp,    0.323_wp /)
147
148
149    REAL(wp)     :: cosz = 0.7_wp                   !< cosine of fixed zenith angle (45 deg, if not
150                                                    !< specified otherwise)
151
152
153    INTERFACE photolysis_constant
154       MODULE PROCEDURE photolysis_constant
155    END INTERFACE photolysis_constant
156
157    INTERFACE photolysis_simple
158       MODULE PROCEDURE photolysis_simple
159    END INTERFACE photolysis_simple
160!
161!   INTERFACE photolysis_fastj
162!      MODULE PROCEDURE photolysis_fastj
163!   END INTERFACE photolysis_fastj
164!
165    INTERFACE photolysis_control
166       MODULE PROCEDURE photolysis_control
167    END INTERFACE photolysis_control
168
169    SAVE
170
171    PRIVATE
172
173    PUBLIC  photolysis_control
174
175    PUBLIC  photolysis_scheme
176
177 CONTAINS
178
179
180!--------------------------------------------------------------------------------------------------!
181! Description:
182! ------------
183!> This subroutine controls the calls of the photolysis schemes.
184!--------------------------------------------------------------------------------------------------!
185 SUBROUTINE photolysis_control
186
187    IMPLICIT NONE
188
189    SELECT CASE ( TRIM( photolysis_scheme ) )
190
191       CASE ( 'constant' )
192          CALL photolysis_constant
193
194       CASE ( 'simple' )
195          CALL photolysis_simple
196
197!      CASE ( 'fastj' )
198!         CALL photolysis_fastj
199
200       CASE DEFAULT
201
202    END SELECT
203
204
205 END SUBROUTINE photolysis_control
206
207
208!--------------------------------------------------------------------------------------------------!
209! Description:
210! ------------
211!> This scheme keeps the prescribed net radiation constant during the run.
212!> Default zenith angle is 45 deg
213!--------------------------------------------------------------------------------------------------!
214 SUBROUTINE photolysis_constant
215
216    IMPLICIT NONE
217
218    INTEGER(iwp) :: iphot,iav !< loop index for photolysis reaction
219
220    DO  iphot = 1, nphot
221       DO  iav = 1, nconst
222          IF ( TRIM( names_c(iav) ) == TRIM( phot_names(iphot) ) )  THEN
223!--             Prescribe fixed photolysis frequencies  [1/s]
224                phot_frequen(iphot)%freq(nzb+1:nzt,:,:) =  phot0(iav) * cosz
225          ENDIF
226       ENDDO
227    ENDDO
228
229
230 END SUBROUTINE photolysis_constant
231
232
233!--------------------------------------------------------------------------------------------------!
234! Description:
235! ------------
236!> This scheme applies a simple parameterisation for clear sky photolysis frequencies from the
237!> Master Chemical Mechanism, MCM v3.2 (http://mcm.leeds.ac.uk/MCM).
238!> Reference: Saunders et al., Atmos. Chem. Phys., 3, 161, 2003
239!> J = l*COSx@m*EXP(-n*SECx)  with l,m,n named par_l etc., x is the zenith angle
240!--------------------------------------------------------------------------------------------------!
241 SUBROUTINE photolysis_simple
242
243    USE palm_date_time_mod,                                                                        &
244        ONLY:  get_date_time
245
246    USE radiation_model_mod,                                                                       &
247        ONLY:  calc_zenith, cos_zenith
248
249    IMPLICIT NONE
250
251    INTEGER(iwp) :: day_of_year  !< day of the year
252    INTEGER(iwp) :: iav          !< loop indix for photolysis reaction
253    INTEGER(iwp) :: iphot        !< loop indix for photolysis reaction
254
255    REAL(wp)     :: coszi          !< 1./cosine of zenith angle
256    REAL(wp)     :: second_of_day  !< second of the day
257
258    DO  iphot = 1, nphot
259       phot_frequen(iphot)%freq = 0.0_wp
260    ENDDO
261
262    CALL get_date_time( time_since_reference_point, day_of_year = day_of_year,                     &
263                        second_of_day=second_of_day )
264    CALL calc_zenith( day_of_year, second_of_day )
265
266    IF ( cos_zenith > 0.0_wp )  THEN
267       coszi = 1.0_wp / cos_zenith
268
269       DO iphot = 1, nphot
270          DO iav = 1, nsimple
271             IF ( TRIM( names_s(iav) ) == TRIM( phot_names(iphot) ) )  THEN
272                phot_frequen(iphot)%freq(nzb+1:nzt,:,:) =  par_l(iav) * cos_zenith**par_m(iav) *   &
273                                                           EXP( - par_n(iav) * coszi )
274             ENDIF
275          ENDDO
276       ENDDO
277    ENDIF
278
279
280 END SUBROUTINE photolysis_simple
281
282 END MODULE chem_photolysis_mod
Note: See TracBrowser for help on using the repository browser.