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

Last change on this file since 4180 was 4180, checked in by scharf, 5 years ago

removed comments in 'Former revisions' section that are older than 01.01.2019

  • Property svn:keywords set to Id
File size: 9.7 KB
RevLine 
[2425]1!> @file chem_photolysis_mod.f90
2!------------------------------------------------------------------------------!
[2828]3! This file is part of the PALM model system.
[2425]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
[2425]19!------------------------------------------------------------------------------!
20!
21! Current revisions:
22! -----------------
23!
[3298]24!
[2425]25! Former revisions:
[2828]26! -----------------
[2425]27! $Id: chem_photolysis_mod.f90 4180 2019-08-21 14:37:54Z scharf $
[3838]28! some formatting and comments added
29!
30! 3824 2019-03-27 15:56:16Z pavelkrc
[3614]31! unused variables removed
32!
[2425]33!------------------------------------------------------------------------------!
34! Description:
35! ------------
36!> photolysis models and interfaces (Adapted from photolysis_model_mod.f90)
[3838]37!> @todo more complex scheme, add shading
[2425]38!------------------------------------------------------------------------------!
39 MODULE chem_photolysis_mod
[2828]40
[3287]41!   USE arrays_3d,                                                             &
42!       ONLY:  dzw, q, ql, zu, zw
[2425]43
44    USE control_parameters,                                                    &
45        ONLY:  time_since_reference_point
46
[3838]47    USE pegrid,                                                                &
48        ONLY: myid, threads_per_task
[2425]49
50    USE indices,                                                               &
[2592]51        ONLY:  nxl, nxlg, nxr, nxrg, nyn, nyng, nys, nysg, nzb, nzt
[2425]52
53    USE control_parameters,                                                    &
54        ONLY:  initializing_actions           
55
[2633]56    USE chem_gasphase_mod,                                                     &
[2425]57        ONLY: nphot, phot_names, phot 
58
[3876]59    USE chem_modules,                                                          &
[2592]60        ONLY: phot_frequen, photolysis_scheme
[2425]61
[2828]62    USE chem_modules,                                                          &
[2633]63        ONLY: chem_debug2
64
[2425]65    USE kinds
66
67#if defined ( __netcdf )
68    USE NETCDF
69#endif
70
71
72    IMPLICIT NONE
73
74
[2592]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
[2425]82
[2592]83!-- Parameters for constant photolysis frequencies
[3282]84    INTEGER,PARAMETER :: nconst  = 15               !< available predefined photolysis prequencies for constant
[2425]85
[2592]86! Names for predefined fixed photolysis frequencies at zenith angle 0
[3838]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         ',   &
[2592]90                     'J         ','J         ','J         ','J         ','J         ' /)
[3838]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,  &
[3282]95                      0.0000E00_wp,0.0000E00_wp,0.0000E00_wp,0.0000E00_wp,0.0000E00_wp /)
[2425]96
[3838]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
[2592]100! Names for simple photolysis frequencies parameterisation (
[3838]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  ',   &
[3287]104                     'J_CH3CHO  ','J         ','J         ','J         ','J_RCHO    ' /)
[2425]105
[3838]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 /)
[2592]112
[3838]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 /)
[2592]117
[3838]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 /)
[2592]122
123
[3838]124    REAL(wp)     :: cosz = 0.7_wp                   !< cosine of fixed zenith angle (45 deg, if not specified otherwise)
[2425]125
126!
127    INTERFACE photolysis_constant
128       MODULE PROCEDURE photolysis_constant
129    END INTERFACE photolysis_constant
130 
[2592]131    INTERFACE photolysis_simple
132       MODULE PROCEDURE photolysis_simple
133    END INTERFACE photolysis_simple
[2425]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
[3282]147    PUBLIC  photolysis_control
[2592]148
[3282]149    PUBLIC  photolysis_scheme
[2425]150
151 CONTAINS
152
153
154!------------------------------------------------------------------------------!
155! Description:
156! ------------
157!> This subroutine controls the calls of the photolysis schemes
158!------------------------------------------------------------------------------!
[3838]159 SUBROUTINE photolysis_control
[2425]160 
[3838]161    IMPLICIT NONE
[2425]162
[3838]163    SELECT CASE ( TRIM( photolysis_scheme ) )
[2425]164
[3838]165       CASE ( 'constant' )
166          CALL photolysis_constant
[2425]167         
[3838]168       CASE ( 'simple' )
169          CALL photolysis_simple
[2425]170       
[3838]171!      CASE ( 'fastj' )
172!         CALL photolysis_fastj
[2425]173
[3838]174       CASE DEFAULT
[2425]175
[3838]176    END SELECT
[2425]177
178
[3838]179 END SUBROUTINE photolysis_control
[2425]180
181
182!------------------------------------------------------------------------------!
183! Description:
184! ------------
185!> This scheme keeps the prescribed net radiation constant during the run
[2656]186!> Default zenith angle is 45 deg
[2425]187!------------------------------------------------------------------------------!
[3838]188 SUBROUTINE photolysis_constant
[2425]189
[3838]190    IMPLICIT NONE
[2425]191
[3838]192    INTEGER(iwp) :: iphot,iav !< loop indix for photolysis reaction
[2425]193
[3838]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,:,:) =                      &
[3282]199                             phot0(iav) * cosz
[3838]200          ENDIF
[2592]201       ENDDO
[3838]202    ENDDO
[2425]203
204
[3838]205 END SUBROUTINE photolysis_constant
[2656]206
[3838]207
[2592]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
[3838]214!> J = l*COSx@m*EXP(-n*SECx)  with l,m,n named par_l etc., x is the zenith angle
[2592]215!------------------------------------------------------------------------------!
[3838]216 SUBROUTINE photolysis_simple
[2592]217
[3838]218    USE radiation_model_mod,                                                   &
219        ONLY:  calc_zenith, cos_zenith
[3252]220
[3838]221    IMPLICIT NONE
[2592]222
[3838]223    INTEGER(iwp) :: iphot,iav !< loop indix for photolysis reaction
224    REAL(wp)     :: coszi     !< 1./cosine of zenith angle
[2592]225
[3838]226    DO  iphot = 1, nphot
227       phot_frequen(iphot)%freq = 0.0_wp
228    ENDDO
[2592]229
[3838]230    CALL calc_zenith
[2656]231
[3838]232    IF ( cos_zenith > 0.0_wp ) THEN
233       coszi = 1. / cos_zenith
[2656]234
[3838]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
[2425]241          ENDDO
[3838]242       ENDDO
243    ENDIF
[2828]244
[3838]245
246 END SUBROUTINE photolysis_simple
247
[2425]248 END MODULE chem_photolysis_mod
Note: See TracBrowser for help on using the repository browser.