13 |
! This procedure evolves the ozone mass fraction through a time |
! This procedure evolves the ozone mass fraction through a time |
14 |
! step taking only chemistry into account. |
! step taking only chemistry into account. |
15 |
|
|
16 |
use nrutil, only: assert |
! All the 2-dimensional arrays are on the "physics" grid. |
17 |
|
! Their shape is "(/klon, llm/)". |
18 |
|
! Index "(i, :)" is for longitude "rlon(i)", latitude "rlat(i)". |
19 |
|
|
20 |
|
use nr_util, only: assert, pi |
21 |
use dimphy, only: klon |
use dimphy, only: klon |
22 |
use dimens_m, only: llm |
use dimens_m, only: llm |
23 |
use read_coefoz_m, only: c_Mob, a4_mass, a2, r_het_interm |
use regr_pr_comb_coefoz_m, only: c_Mob, a4_mass, a2, r_het_interm |
24 |
use orbite_m, only: orbite, zenang |
use orbite_m, only: orbite, zenang |
|
use nrtype, only: pi |
|
25 |
|
|
26 |
integer, intent(in):: julien ! jour julien, 1 <= julien <= 360 |
integer, intent(in):: julien ! jour julien, 1 <= julien <= 360 |
27 |
real, intent(in):: gmtime ! heure de la journée en fraction de jour |
real, intent(in):: gmtime ! heure de la journée en fraction de jour |
28 |
real, intent(in):: t_seri(:, :) ! temperature, in K |
real, intent(in):: t_seri(:, :) ! (klon, llm) temperature, in K |
29 |
|
|
30 |
real, intent(in):: zmasse(:, :) |
real, intent(in):: zmasse(:, :) ! (klon, llm) |
31 |
! (column-density of mass of air in a cell, in kg m-2) |
! (column-density of mass of air in a cell, in kg m-2) |
32 |
! (On the "physics" grid. |
! "zmasse(:, k)" is for layer "k".) |
|
! "zmasse(i, k)" is at longitude "rlon(i)", latitude "rlat(i)", for |
|
|
! layer "k".) |
|
33 |
|
|
34 |
real, intent(in):: pdtphys ! time step for physics, in s |
real, intent(in):: pdtphys ! time step for physics, in s |
35 |
|
|
36 |
real, intent(inout):: q(:, :) ! mass fraction of ozone |
real, intent(inout):: q(:, :) ! (klon, llm) mass fraction of ozone |
37 |
! (On the "physics" grid. |
! "q(:, k)" is at middle of layer "k".) |
|
! "q(i, k)" is at longitude "rlon(i)", latitude "rlat(i)", middle of |
|
|
! layer "k".) |
|
38 |
|
|
39 |
! Variables local to the procedure: |
! Variables local to the procedure: |
40 |
integer month, k |
integer k |
41 |
|
|
42 |
real c(klon, llm) |
real c(klon, llm) |
43 |
! (constant term during a time step in the net mass production |
! (constant term during a time step in the net mass production |
44 |
! rate of ozone by chemistry, per unit mass of air, in s-1) |
! rate of ozone by chemistry, per unit mass of air, in s-1) |
45 |
! (On the "physics" grid. |
! "c(:, k)" is at middle of layer "k".) |
|
! "c(i, k)" is at longitude "rlon(i)", latitude "rlat(i)", middle of |
|
|
! layer "k".) |
|
46 |
|
|
47 |
real b(klon, llm) |
real b(klon, llm) |
48 |
! (coefficient of "q" in the net mass production |
! (coefficient of "q" in the net mass production |
49 |
! rate of ozone by chemistry, per unit mass of air, in s-1) |
! rate of ozone by chemistry, per unit mass of air, in s-1) |
50 |
! (On the "physics" grid. |
! "b(:, k)" is at middle of layer "k".) |
|
! "b(i, k)" is at longitude "rlon(i)", latitude "rlat(i)", middle of |
|
|
! layer "k".) |
|
51 |
|
|
52 |
real dq_o3_chem(klon, llm) |
real dq_o3_chem(klon, llm) |
53 |
! (variation of ozone mass fraction due to chemistry during a time step) |
! (variation of ozone mass fraction due to chemistry during a time step) |
54 |
! (On the "physics" grid. |
! "dq_o3_chem(:, k)" is at middle of layer "k".) |
|
! "dq_o3_chem(i, k)" is at longitude "rlon(i)", latitude |
|
|
! "rlat(i)", middle of layer "k".) |
|
55 |
|
|
56 |
real earth_long |
real earth_long |
57 |
! (longitude vraie de la Terre dans son orbite solaire, par |
! (longitude vraie de la Terre dans son orbite solaire, par |
66 |
call assert(llm == (/size(q, 2), size(t_seri, 2), size(zmasse, 2)/), & |
call assert(llm == (/size(q, 2), size(t_seri, 2), size(zmasse, 2)/), & |
67 |
"o3_chem llm") |
"o3_chem llm") |
68 |
|
|
69 |
month = (julien - 1) / 30 + 1 ! compute the month from the day number |
c = c_Mob + a4_mass * t_seri |
|
c = c_Mob(:, :, month) + a4_mass(:, :, month) * t_seri |
|
70 |
|
|
71 |
! Compute coefficient "b": |
! Compute coefficient "b": |
72 |
|
|
73 |
! Heterogeneous chemistry is only at low temperature: |
! Heterogeneous chemistry is only at low temperature: |
74 |
where (t_seri < 195.) |
where (t_seri < 195.) |
75 |
b = r_het_interm(:, :, month) |
b = r_het_interm |
76 |
elsewhere |
elsewhere |
77 |
b = 0. |
b = 0. |
78 |
end where |
end where |
84 |
where (pmu0 <= cos(87. / 180. * pi)) b(:, k) = 0. |
where (pmu0 <= cos(87. / 180. * pi)) b(:, k) = 0. |
85 |
end forall |
end forall |
86 |
|
|
87 |
b = b + a2(:, :, month) |
b = b + a2 |
88 |
|
|
89 |
! Midpoint method: |
! Midpoint method: |
90 |
|
|
91 |
! Trial step to the midpoint: |
! Trial step to the midpoint: |
92 |
dq_o3_chem = o3_prod(q, month, zmasse, c, b) * pdtphys / 2 |
dq_o3_chem = o3_prod(q, zmasse, c, b) * pdtphys / 2 |
93 |
! "Real" step across the whole interval: |
! "Real" step across the whole interval: |
94 |
dq_o3_chem = o3_prod(q + dq_o3_chem, month, zmasse, c, b) * pdtphys |
dq_o3_chem = o3_prod(q + dq_o3_chem, zmasse, c, b) * pdtphys |
95 |
q = q + dq_o3_chem |
q = q + dq_o3_chem |
96 |
|
|
97 |
! Confine the mass fraction: |
! Confine the mass fraction: |
101 |
|
|
102 |
!************************************************* |
!************************************************* |
103 |
|
|
104 |
function o3_prod(q, month, zmasse, c, b) |
function o3_prod(q, zmasse, c, b) |
105 |
|
|
106 |
! This function computes the production rate of ozone by chemistry. |
! This function computes the production rate of ozone by chemistry. |
107 |
|
|
108 |
use read_coefoz_m, only: a6_mass |
! All the 2-dimensional arrays are on the "physics" grid. |
109 |
use nrutil, only: assert |
! Their shape is "(/klon, llm/)". |
110 |
|
! Index "(i, :)" is for longitude "rlon(i)", latitude "rlat(i)". |
111 |
|
|
112 |
|
use regr_pr_comb_coefoz_m, only: a6_mass |
113 |
|
use nr_util, only: assert |
114 |
use dimens_m, only: llm |
use dimens_m, only: llm |
115 |
use dimphy, only: klon |
use dimphy, only: klon |
116 |
|
|
117 |
real, intent(in):: q(:, :) ! mass fraction of ozone |
real, intent(in):: q(:, :) ! mass fraction of ozone |
118 |
! (On the "physics" grid. |
! "q(:, k)" is at middle of layer "k".) |
|
! "q(i, k)" is at longitude "rlon(i)", latitude "rlat(i)", middle of |
|
|
! layer "k".) |
|
|
|
|
|
integer, intent(in):: month |
|
119 |
|
|
120 |
real, intent(in):: zmasse(:, :) |
real, intent(in):: zmasse(:, :) |
121 |
! (column-density of mass of air in a layer, in kg m-2) |
! (column-density of mass of air in a layer, in kg m-2) |
122 |
! (On the "physics" grid. |
! ("zmasse(:, k)" is for layer "k".) |
|
! "zmasse(i, k)" is at longitude "rlon(i)", latitude "rlat(i)", middle of |
|
|
! layer "k".) |
|
123 |
|
|
124 |
real, intent(in):: c(:, :) |
real, intent(in):: c(:, :) |
125 |
! (constant term during a time step in the net mass production |
! (constant term during a time step in the net mass production |
126 |
! rate of ozone by chemistry, per unit mass of air, in s-1) |
! rate of ozone by chemistry, per unit mass of air, in s-1) |
127 |
! (On the "physics" grid. |
! "c(:, k)" is at middle of layer "k".) |
|
! "c(i, k)" is at longitude "rlon(i)", latitude "rlat(i)", middle of |
|
|
! layer "k".) |
|
128 |
|
|
129 |
real, intent(in):: b(:, :) |
real, intent(in):: b(:, :) |
130 |
! (coefficient of "q" in the net mass production |
! (coefficient of "q" in the net mass production rate of ozone by |
131 |
! rate of ozone by chemistry, per unit mass of air, in s-1) |
! chemistry, per unit mass of air, in s-1) |
132 |
! (On the "physics" grid. |
! ("b(:, k)" is at middle of layer "k".) |
|
! "b(i, k)" is at longitude "rlon(i)", latitude "rlat(i)", middle of |
|
|
! layer "k".) |
|
133 |
|
|
134 |
real o3_prod(klon, llm) |
real o3_prod(klon, llm) |
135 |
! (net mass production rate of ozone by chemistry, per unit mass |
! (net mass production rate of ozone by chemistry, per unit mass |
136 |
! of air, in s-1) |
! of air, in s-1) |
137 |
! (On the "physics" grid. |
! ("o3_prod(:, k)" is at middle of layer "k".) |
|
! "o3_prod(i, k)" is at longitude "rlon(i)", latitude "rlat(i)", middle of |
|
|
! layer "k".) |
|
138 |
|
|
139 |
! Variables local to the procedure: |
! Variables local to the procedure: |
140 |
|
|
141 |
real sigma_mass(klon, llm) |
real sigma_mass(klon, llm) |
142 |
! (mass column-density of ozone above point, in kg m-2) |
! (mass column-density of ozone above point, in kg m-2) |
143 |
! (On the "physics" grid. |
! ("sigma_mass(:, k)" is at middle of layer "k".) |
|
! "sigma_mass(i, k)" is at longitude "rlon(i)", latitude |
|
|
! "rlat(i)", middle of layer "k".) |
|
144 |
|
|
145 |
integer k |
integer k |
146 |
|
|
159 |
sigma_mass(:, k) = sigma_mass(:, k+1) + zmasse(:, k) * q(:, k) |
sigma_mass(:, k) = sigma_mass(:, k+1) + zmasse(:, k) * q(:, k) |
160 |
end do |
end do |
161 |
|
|
162 |
o3_prod = c + b * q + a6_mass(:, :, month) * sigma_mass |
o3_prod = c + b * q + a6_mass * sigma_mass |
163 |
|
|
164 |
end function o3_prod |
end function o3_prod |
165 |
|
|