61 |
! Variables local to the procedure: |
! Variables local to the procedure: |
62 |
integer ncid ! for NetCDF |
integer ncid ! for NetCDF |
63 |
|
|
|
real, pointer:: plev(:) |
|
|
! (pressure level of input data, converted to Pa, in strictly |
|
|
! increasing order) |
|
|
|
|
|
integer n_plev ! number of pressure levels in the input data |
|
|
|
|
|
real, allocatable:: press_in_edg(:) |
|
|
! (edges of pressure intervals for input data, in Pa, in strictly |
|
|
! increasing order) |
|
|
|
|
64 |
real coefoz(klon, llm) |
real coefoz(klon, llm) |
65 |
! (temporary storage for an ozone coefficient) |
! (temporary storage for an ozone coefficient) |
66 |
! (On the "physics" grid. |
! (On the "physics" grid. |
87 |
|
|
88 |
call nf95_open("coefoz_LMDZ.nc", nf90_nowrite, ncid) |
call nf95_open("coefoz_LMDZ.nc", nf90_nowrite, ncid) |
89 |
|
|
90 |
call nf95_get_coord(ncid, "plev", plev) |
call regr_pr_av_coefoz(ncid, "a2", julien, a2) |
|
! Convert from hPa to Pa because "regr_pr_av" and "regr_pr_int" require so: |
|
|
plev = plev * 100. |
|
|
n_plev = size(plev) |
|
|
|
|
|
! Compute edges of pressure intervals: |
|
|
allocate(press_in_edg(n_plev + 1)) |
|
|
press_in_edg(1) = 0. |
|
|
! We choose edges halfway in logarithm: |
|
|
forall (k = 2:n_plev) press_in_edg(k) = sqrt(plev(k - 1) * plev(k)) |
|
|
press_in_edg(n_plev + 1) = huge(0.) |
|
|
! (infinity, but any value guaranteed to be greater than the |
|
|
! surface pressure would do) |
|
|
|
|
|
call regr_pr_av_coefoz(ncid, "a2", julien, press_in_edg, a2) |
|
91 |
|
|
92 |
call regr_pr_av_coefoz(ncid, "a4", julien, press_in_edg, a4_mass) |
call regr_pr_av_coefoz(ncid, "a4", julien, a4_mass) |
93 |
a4_mass = a4_mass * 48. / 29. |
a4_mass = a4_mass * 48. / 29. |
94 |
|
|
95 |
call regr_pr_av_coefoz(ncid, "a6", julien, press_in_edg, a6) |
call regr_pr_av_coefoz(ncid, "a6", julien, a6) |
96 |
|
|
97 |
! Compute "a6_mass" avoiding underflow, do not divide by 1e4 |
! Compute "a6_mass" avoiding underflow, do not divide by 1e4 |
98 |
! before dividing by molecular mass: |
! before dividing by molecular mass: |
103 |
! (We use as few local variables as possible, in order to spare |
! (We use as few local variables as possible, in order to spare |
104 |
! main memory.) |
! main memory.) |
105 |
|
|
106 |
call regr_pr_av_coefoz(ncid, "P_net_Mob", julien, press_in_edg, c_Mob) |
call regr_pr_av_coefoz(ncid, "P_net_Mob", julien, c_Mob) |
107 |
|
|
108 |
call regr_pr_av_coefoz(ncid, "r_Mob", julien, press_in_edg, coefoz) |
call regr_pr_av_coefoz(ncid, "r_Mob", julien, coefoz) |
109 |
c_mob = c_mob - a2 * coefoz |
c_mob = c_mob - a2 * coefoz |
110 |
|
|
111 |
call regr_pr_int_coefoz(ncid, "Sigma_Mob", julien, plev, top_value=0., & |
call regr_pr_int_coefoz(ncid, "Sigma_Mob", julien, top_value=0., v3=coefoz) |
|
v3=coefoz) |
|
112 |
c_mob = (c_mob - a6 * coefoz) * 48. / 29. |
c_mob = (c_mob - a6 * coefoz) * 48. / 29. |
113 |
|
|
114 |
call regr_pr_av_coefoz(ncid, "temp_Mob", julien, press_in_edg, coefoz) |
call regr_pr_av_coefoz(ncid, "temp_Mob", julien, coefoz) |
115 |
c_mob = c_mob - a4_mass * coefoz |
c_mob = c_mob - a4_mass * coefoz |
116 |
|
|
117 |
call regr_pr_av_coefoz(ncid, "R_Het", julien, press_in_edg, r_het_interm) |
call regr_pr_av_coefoz(ncid, "R_Het", julien, r_het_interm) |
118 |
! Heterogeneous chemistry is only at high latitudes: |
! Heterogeneous chemistry is only at high latitudes: |
119 |
forall (k = 1: llm) |
forall (k = 1: llm) |
120 |
where (abs(rlat) <= 45.) r_het_interm(:, k) = 0. |
where (abs(rlat) <= 45.) r_het_interm(:, k) = 0. |
121 |
end forall |
end forall |
122 |
r_het_interm = r_het_interm * (Clx / 3.8e-9)**2 |
r_het_interm = r_het_interm * (Clx / 3.8e-9)**2 |
123 |
|
|
|
deallocate(plev) ! pointer |
|
124 |
call nf95_close(ncid) |
call nf95_close(ncid) |
125 |
|
|
126 |
end subroutine regr_pr_comb_coefoz |
end subroutine regr_pr_comb_coefoz |