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

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