1 |
module regr_pr_comb_coefoz_m |
module regr_pr_comb_coefoz_m |
2 |
|
|
|
! This module is clean: no C preprocessor directive, no include line. |
|
|
|
|
3 |
use dimens_m, only: llm |
use dimens_m, only: llm |
4 |
use dimphy, only: klon |
use dimphy, only: klon |
5 |
|
|
46 |
! -- packs the coefficients to the "physics" horizontal grid ; |
! -- packs the coefficients to the "physics" horizontal grid ; |
47 |
! -- combines the eight coefficients to define the five module variables. |
! -- combines the eight coefficients to define the five module variables. |
48 |
|
|
|
! We assume that, in "coefoz_LMDZ.nc", the pressure levels are in hPa |
|
|
! and strictly increasing. |
|
|
|
|
|
use netcdf95, only: nf95_open, nf95_close, nf95_get_coord |
|
49 |
use netcdf, only: nf90_nowrite |
use netcdf, only: nf90_nowrite |
50 |
use regr_pr_coefoz, only: regr_pr_av_coefoz, regr_pr_int_coefoz |
use netcdf95, only: nf95_open, nf95_close |
51 |
use phyetat0_m, only: rlat |
use phyetat0_m, only: rlat |
52 |
|
use regr_pr_av_m, only: regr_pr_av |
53 |
|
use regr_pr_int_m, only: regr_pr_int |
54 |
|
|
55 |
integer, intent(in):: julien ! jour julien, 1 <= julien <= 360 |
integer, intent(in):: julien ! jour julien, 1 <= julien <= 360 |
56 |
|
|
57 |
! Variables local to the procedure: |
! Variables local to the procedure: |
58 |
|
|
59 |
integer ncid ! for NetCDF |
integer ncid ! for NetCDF |
60 |
|
|
61 |
real coefoz(klon, llm) |
real coefoz(klon, llm) |
84 |
|
|
85 |
call nf95_open("coefoz_LMDZ.nc", nf90_nowrite, ncid) |
call nf95_open("coefoz_LMDZ.nc", nf90_nowrite, ncid) |
86 |
|
|
87 |
call regr_pr_av_coefoz(ncid, "a2", julien, a2) |
call regr_pr_av(ncid, "a2", julien, a2) |
88 |
|
|
89 |
call regr_pr_av_coefoz(ncid, "a4", julien, a4_mass) |
call regr_pr_av(ncid, "a4", julien, a4_mass) |
90 |
a4_mass = a4_mass * 48. / 29. |
a4_mass = a4_mass * 48. / 29. |
91 |
|
|
92 |
call regr_pr_av_coefoz(ncid, "a6", julien, a6) |
call regr_pr_av(ncid, "a6", julien, a6) |
93 |
|
|
94 |
! Compute "a6_mass" avoiding underflow, do not divide by 1e4 |
! Compute "a6_mass" avoiding underflow, do not divide by 1e4 |
95 |
! before dividing by molecular mass: |
! before dividing by molecular mass: |
100 |
! (We use as few local variables as possible, in order to spare |
! (We use as few local variables as possible, in order to spare |
101 |
! main memory.) |
! main memory.) |
102 |
|
|
103 |
call regr_pr_av_coefoz(ncid, "P_net_Mob", julien, c_Mob) |
call regr_pr_av(ncid, "P_net_Mob", julien, c_Mob) |
104 |
|
|
105 |
call regr_pr_av_coefoz(ncid, "r_Mob", julien, coefoz) |
call regr_pr_av(ncid, "r_Mob", julien, coefoz) |
106 |
c_mob = c_mob - a2 * coefoz |
c_mob = c_mob - a2 * coefoz |
107 |
|
|
108 |
call regr_pr_int_coefoz(ncid, "Sigma_Mob", julien, top_value=0., v3=coefoz) |
call regr_pr_int(ncid, "Sigma_Mob", julien, top_value=0., v3=coefoz) |
109 |
c_mob = (c_mob - a6 * coefoz) * 48. / 29. |
c_mob = (c_mob - a6 * coefoz) * 48. / 29. |
110 |
|
|
111 |
call regr_pr_av_coefoz(ncid, "temp_Mob", julien, coefoz) |
call regr_pr_av(ncid, "temp_Mob", julien, coefoz) |
112 |
c_mob = c_mob - a4_mass * coefoz |
c_mob = c_mob - a4_mass * coefoz |
113 |
|
|
114 |
call regr_pr_av_coefoz(ncid, "R_Het", julien, r_het_interm) |
call regr_pr_av(ncid, "R_Het", julien, r_het_interm) |
115 |
! Heterogeneous chemistry is only at high latitudes: |
! Heterogeneous chemistry is only at high latitudes: |
116 |
forall (k = 1: llm) |
forall (k = 1: llm) |
117 |
where (abs(rlat) <= 45.) r_het_interm(:, k) = 0. |
where (abs(rlat) <= 45.) r_het_interm(:, k) = 0. |