38 |
! layer "k".) |
! layer "k".) |
39 |
|
|
40 |
! Variables local to the procedure: |
! Variables local to the procedure: |
41 |
integer month, k |
integer k |
42 |
|
|
43 |
real c(klon, llm) |
real c(klon, llm) |
44 |
! (constant term during a time step in the net mass production |
! (constant term during a time step in the net mass production |
73 |
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)/), & |
74 |
"o3_chem llm") |
"o3_chem llm") |
75 |
|
|
76 |
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 |
|
77 |
|
|
78 |
! Compute coefficient "b": |
! Compute coefficient "b": |
79 |
|
|
80 |
! Heterogeneous chemistry is only at low temperature: |
! Heterogeneous chemistry is only at low temperature: |
81 |
where (t_seri < 195.) |
where (t_seri < 195.) |
82 |
b = r_het_interm(:, :, month) |
b = r_het_interm |
83 |
elsewhere |
elsewhere |
84 |
b = 0. |
b = 0. |
85 |
end where |
end where |
91 |
where (pmu0 <= cos(87. / 180. * pi)) b(:, k) = 0. |
where (pmu0 <= cos(87. / 180. * pi)) b(:, k) = 0. |
92 |
end forall |
end forall |
93 |
|
|
94 |
b = b + a2(:, :, month) |
b = b + a2 |
95 |
|
|
96 |
! Midpoint method: |
! Midpoint method: |
97 |
|
|
98 |
! Trial step to the midpoint: |
! Trial step to the midpoint: |
99 |
dq_o3_chem = o3_prod(q, month, zmasse, c, b) * pdtphys / 2 |
dq_o3_chem = o3_prod(q, zmasse, c, b) * pdtphys / 2 |
100 |
! "Real" step across the whole interval: |
! "Real" step across the whole interval: |
101 |
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 |
102 |
q = q + dq_o3_chem |
q = q + dq_o3_chem |
103 |
|
|
104 |
! Confine the mass fraction: |
! Confine the mass fraction: |
108 |
|
|
109 |
!************************************************* |
!************************************************* |
110 |
|
|
111 |
function o3_prod(q, month, zmasse, c, b) |
function o3_prod(q, zmasse, c, b) |
112 |
|
|
113 |
! This function computes the production rate of ozone by chemistry. |
! This function computes the production rate of ozone by chemistry. |
114 |
|
|
122 |
! "q(i, k)" is at longitude "rlon(i)", latitude "rlat(i)", middle of |
! "q(i, k)" is at longitude "rlon(i)", latitude "rlat(i)", middle of |
123 |
! layer "k".) |
! layer "k".) |
124 |
|
|
|
integer, intent(in):: month |
|
|
|
|
125 |
real, intent(in):: zmasse(:, :) |
real, intent(in):: zmasse(:, :) |
126 |
! (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) |
127 |
! (On the "physics" grid. |
! (On the "physics" grid. |
174 |
sigma_mass(:, k) = sigma_mass(:, k+1) + zmasse(:, k) * q(:, k) |
sigma_mass(:, k) = sigma_mass(:, k+1) + zmasse(:, k) * q(:, k) |
175 |
end do |
end do |
176 |
|
|
177 |
o3_prod = c + b * q + a6_mass(:, :, month) * sigma_mass |
o3_prod = c + b * q + a6_mass * sigma_mass |
178 |
|
|
179 |
end function o3_prod |
end function o3_prod |
180 |
|
|