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

Last change on this file since 4406 was 4227, checked in by gronemeier, 5 years ago

implement new palm_date_time_mod; replaced namelist parameters time_utc_init and day_of_year_init by origin_date_time

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