1 !WRF:MODEL_LAYER:CHEMISTRY
3 ! Calls lightning_nox_driver for calling subroutines that convert lightning
4 ! flash rate predictions (2D, #/sec) into NO emission (3D, moles/sec)
7 ! 3.4.1 - rewritten and added init, separate out flash rate
8 ! parameterization from emission
9 ! 3.3.x - lightning_driver written by M. Barth and L. Ott. Called
10 ! in emission_driver in chem
12 ! Contact: J. Wong <johnwong@ucar.edu>
14 !**********************************************************************
15 MODULE module_lightning_nox_driver
18 SUBROUTINE lightning_nox_driver ( &
19 ! Frequently used prognostics
20 curr_secs, dt, dx, dy, &
21 xlat, xlon, xland, ht, &
22 t_phy, p_phy, rho, u, v, w, &
24 ic_flashrate, cg_flashrate, &
25 ! Scheme specific prognostics
27 ! Mandatory namelist inputs
28 lightning_option, lightning_dt, &
29 lightning_start_seconds, &
31 lnox_opt, lnox_passive, &
32 ! Scheme specific namelist inputs
33 ltng_temp_upper,ltng_temp_lower, &
34 cellcount_method, & ! This is in the physics namelist
35 ! Order dependent args for domain, mem, and tile dims
36 ids, ide, jds, jde, kds, kde, &
37 ims, ime, jms, jme, kms, kme, &
38 its, ite, jts, jte, kts, kte, &
40 c_no, & ! NO concentration
41 lnox_total, lnox_ic, lnox_cg &
43 !-----------------------------------------------------------------
45 USE module_state_description
48 USE module_model_constants
52 USE module_lightning_nox_ott
53 USE module_lightning_nox_decaria, only: lightning_nox_decaria
56 !-----------------------------------------------------------------
58 ! Frequently used prognostics
59 REAL(8), INTENT(IN ) :: curr_secs
60 REAL, INTENT(IN ) :: dt, dx, dy
62 REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN ) :: xlat, xlon, xland, ht
63 REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(IN ) :: t_phy, p_phy, rho
64 REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(IN ) :: u, v, w, z
65 REAL, DIMENSION( ims:ime, kms:kme, jms:jme, num_moist), INTENT(IN ) :: moist
67 REAL, DIMENSION( ims:ime, jms:jme ), INTENT(IN ) :: ic_flashrate , cg_flashrate ! #/sec
69 ! Scheme specific prognostics
70 REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(IN ) :: refl
72 ! Mandatory namelist inputs
73 INTEGER, INTENT(IN ) :: lightning_option
74 REAL, INTENT(IN ) :: lightning_dt, lightning_start_seconds
75 REAL, INTENT(IN ) :: N_IC, N_CG
76 INTEGER, INTENT(IN ) :: lnox_opt
77 LOGICAL, INTENT(IN ) :: lnox_passive
79 ! Scheme specific namelist inputs
80 REAL, INTENT(IN ) :: ltng_temp_upper, ltng_temp_lower
81 INTEGER, INTENT(IN ) :: cellcount_method
83 ! Order dependent args for domain, mem, and tile dims
84 INTEGER, INTENT(IN ) :: ids,ide, jds,jde, kds,kde
85 INTEGER, INTENT(IN ) :: ims,ime, jms,jme, kms,kme
86 INTEGER, INTENT(IN ) :: its,ite, jts,jte, kts,kte
88 ! Mandatory inputs for all quantitative schemes
89 REAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(INOUT) :: c_no
90 REAL, OPTIONAL, DIMENSION( ims:ime, kms:kme, jms:jme ), INTENT(INOUT) :: lnox_total,lnox_ic,lnox_cg
93 REAL, DIMENSION( ims:ime, kms:kme, jms:jme ) :: lnox_total_tend
94 REAL, DIMENSION( ims:ime, kms:kme, jms:jme ) :: lnox_ic_tend, lnox_cg_tend
96 CHARACTER (LEN=80) :: message
98 !-----------------------------------------------------------------
100 IF (lightning_option .eq. 0 .or. lnox_opt .eq. 0) RETURN
102 IF ((curr_secs+REAL(dt,8)) .lt. REAL(lightning_start_seconds,8)) RETURN
104 IF ( N_IC .eq. 0. .and. N_CG .eq. 0. ) RETURN
105 !-----------------------------------------------------------------
107 CALL wrf_debug( 100, ' lightning_nox_driver: converting flash rate to emission')
109 lnox_select: SELECT CASE(lnox_opt)
112 CALL lightning_nox_ott ( &
113 ! Frequently used prognostics
114 dx, dy, xlat, xland, ht, rho, z, &
115 ic_flashrate, cg_flashrate, & ! flashes (#/s)
118 ! Order dependent args for domain, mem, and tile dims
119 ids, ide, jds, jde, kds, kde, &
120 ims, ime, jms, jme, kms, kme, &
121 its, ite, jts, jte, kts, kte, &
123 lnox_total_tend & ! tendency (ppmv/s)
126 CASE(lnox_opt_decaria)
127 CALL lightning_nox_decaria ( &
128 ! Frequently used prognostics
129 dx, dy, xland, ht, t_phy, rho, z, p_phy, &
130 ic_flashrate, cg_flashrate, & ! flashes (#/s)
131 ! Scheme specific prognostics
135 ltng_temp_upper,ltng_temp_lower, &
137 ! Order dependent args for domain, mem, and tile dims
138 ids, ide, jds, jde, kds, kde, &
139 ims, ime, jms, jme, kms, kme, &
140 its, ite, jts, jte, kts, kte, &
142 lnox_ic_tend, lnox_cg_tend & ! tendency (ppmv/s)
144 ! Invalid lightning NOx options
146 WRITE(wrf_err_message, * ) ' lightning_nox_driver: The lightning nox option does not exist: lnox_opt = ', lnox_opt
147 CALL wrf_error_fatal ( wrf_err_message )
149 END SELECT lnox_select
152 !-----------------------------------------------------------------
153 lnox_add_select: SELECT CASE(lnox_opt)
157 CALL wrf_debug( 100, ' lightning_nox_driver: adding total tendency to NO and passive tracers')
158 WRITE(wrf_err_message, * ) 'lightning_nox_driver: max lnox_total_tend = ', maxval(lnox_total_tend(its:ite,kts:kte,jts:jte))
159 CALL wrf_debug( 100, wrf_err_message)
161 lnox_total(its:ite,kts:kte,jts:jte) = lnox_total(its:ite,kts:kte,jts:jte) + &
162 lnox_total_tend(its:ite,kts:kte,jts:jte) * lightning_dt
163 IF ( .not.lnox_passive ) THEN
164 c_no(its:ite,kts:kte,jts:jte) = c_no(its:ite,kts:kte,jts:jte) + &
165 lnox_total_tend(its:ite,kts:kte,jts:jte) * lightning_dt
168 CASE(lnox_opt_decaria)
169 CALL wrf_debug( 100, ' lightning_nox_driver: adding IC an& CG tendencies to NO and passive tracers')
170 WRITE(wrf_err_message, * ) 'lightning_nox_driver: max lnox_ic/cg_tend = ', maxval(lnox_ic_tend(its:ite,kts:kte,jts:jte)), &
171 maxval(lnox_cg_tend(its:ite,kts:kte,jts:jte))
172 CALL wrf_debug( 100, wrf_err_message)
174 lnox_ic(its:ite,kts:kte,jts:jte) = lnox_ic(its:ite,kts:kte,jts:jte) + lnox_ic_tend(its:ite,kts:kte,jts:jte) * lightning_dt
175 lnox_cg(its:ite,kts:kte,jts:jte) = lnox_cg(its:ite,kts:kte,jts:jte) + lnox_cg_tend(its:ite,kts:kte,jts:jte) * lightning_dt
176 IF ( .not.lnox_passive ) THEN
177 c_no(its:ite,kts:kte,jts:jte) = c_no(its:ite,kts:kte,jts:jte) + &
178 ( lnox_ic_tend(its:ite,kts:kte,jts:jte) + &
179 lnox_cg_tend(its:ite,kts:kte,jts:jte) ) * lightning_dt
183 WRITE(wrf_err_message, * ) ' lightning_nox_driver: The lightning nox option does not exist: lnox_opt = ', lnox_opt
184 CALL wrf_error_fatal ( wrf_err_message )
185 END SELECT lnox_add_select
187 CALL wrf_debug( 100, ' lightning_nox_driver: finishing')
189 END SUBROUTINE lightning_nox_driver
191 END MODULE module_lightning_nox_driver