source: LMDZ6/branches/Amaury_dev/libf/phylmd/aeropt_5wv.F90 @ 5218

Last change on this file since 5218 was 5144, checked in by abarral, 5 months ago

Put YOMCST.h into modules

  • Property copyright set to
    Name of program: LMDZ
    Creation date: 1984
    Version: LMDZ5
    License: CeCILL version 2
    Holder: Laboratoire de m\'et\'eorologie dynamique, CNRS, UMR 8539
    See the license file in the root directory
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 35.2 KB
Line 
1! $Id: aeropt_5wv.F90 5144 2024-07-29 21:01:04Z abarral $
2
3SUBROUTINE AEROPT_5WV(&
4        pdel, m_allaer, delt, &
5        RHcl, ai, flag_aerosol, &
6        pplay, t_seri, &
7        tausum, tau, presnivs)
8
9  USE DIMPHY
10  USE aero_mod
11  USE phys_local_var_mod, ONLY: od550aer, od865aer, ec550aer, od550lt1aer
12  USE lmdz_pres2lev
13  USE lmdz_abort_physic, ONLY: abort_physic
14  USE lmdz_yomcst
15
16  !    Yves Balkanski le 12 avril 2006
17  !    Celine Deandreis
18  !    Anne Cozic  Avril 2009
19  !    a partir d'une sous-routine de Johannes Quaas pour les sulfates
20
21
22  ! Refractive indices for seasalt come from Shettle and Fenn (1979)
23
24  ! Refractive indices from water come from Hale and Querry (1973)
25
26  ! Refractive indices from Ammonium Sulfate Toon and Pollack (1976)
27
28  ! Refractive indices for Dust, internal mixture of minerals coated with 1.5% hematite
29  ! by Volume (Balkanski et al., 2006)
30
31  ! Refractive indices for POM: Kinne (pers. Communication
32
33  ! Refractive index for BC from Shettle and Fenn (1979)
34
35  ! Shettle, E. P., & Fenn, R. W. (1979), Models for the aerosols of the lower atmosphere and
36  ! the effects of humidity variations on their optical properties, U.S. Air Force Geophysics
37  ! Laboratory Rept. AFGL-TR-79-0214, Hanscomb Air Force Base, MA.
38
39  ! Hale, G. M. and M. R. Querry, Optical constants of water in the 200-nm to 200-m
40  ! wavelength region, Appl. Opt., 12, 555-563, 1973.
41
42  ! Toon, O. B. and J. B. Pollack, The optical constants of several atmospheric aerosol species:
43  ! Ammonium sulfate, aluminum oxide, and sodium chloride, J. Geohys. Res., 81, 5733-5748,
44  ! 1976.
45
46  ! Balkanski, Y., M. Schulz, T. Claquin And O. Boucher, Reevaluation of mineral aerosol
47  ! radiative forcings suggests a better agreement with satellite and AERONET data, Atmospheric
48  ! Chemistry and Physics Discussions., 6, pp 8383-8419, 2006.
49
50  IMPLICIT NONE
51
52  ! Input arguments:
53
54  REAL, DIMENSION(klon, klev), INTENT(IN) :: pdel
55  REAL, INTENT(IN) :: delt
56  REAL, DIMENSION(klon, klev, naero_tot), INTENT(IN) :: m_allaer
57  REAL, DIMENSION(klon, klev), INTENT(IN) :: RHcl     ! humidite relative ciel clair
58  INTEGER, INTENT(IN) :: flag_aerosol
59  REAL, DIMENSION(klon, klev), INTENT(IN) :: pplay
60  REAL, DIMENSION(klon, klev), INTENT(IN) :: t_seri
61  REAL, DIMENSION(klev), INTENT(IN) :: presnivs
62
63  ! Output arguments:
64
65  REAL, DIMENSION(klon), INTENT(OUT) :: ai      ! POLDER aerosol index
66  REAL, DIMENSION(klon, nwave, naero_tot), INTENT(OUT) :: tausum
67  REAL, DIMENSION(klon, klev, nwave, naero_tot), INTENT(OUT) :: tau
68
69  ! Local
70
71  INTEGER, PARAMETER :: las = nwave_sw
72  LOGICAL :: soluble
73
74  INTEGER :: i, k, ierr, m, aerindex
75  INTEGER :: spsol, spinsol, spss, la
76  INTEGER :: RH_num(klon, klev)
77  INTEGER, PARAMETER :: la443 = 1
78  INTEGER, PARAMETER :: la550 = 2
79  INTEGER, PARAMETER :: la670 = 3
80  INTEGER, PARAMETER :: la765 = 4
81  INTEGER, PARAMETER :: la865 = 5
82  INTEGER, PARAMETER :: nbre_RH = 12
83  INTEGER, PARAMETER :: naero_soluble = 7   !  1- BC soluble; 2- POM soluble; 3- SO4 acc.
84  !  4- SO4 coarse; 5 seasalt super-C; 6 seasalt coarse; 7 seasalt acc.
85  INTEGER, PARAMETER :: naero_insoluble = 3 !  1- Dust; 2- BC insoluble; 3- POM insoluble
86  INTEGER, PARAMETER :: nb_level = 19     ! number of vertical levels
87  LOGICAL, SAVE :: firstcall = .TRUE.
88  !$OMP THREADPRIVATE(firstcall)
89
90  REAL :: zrho
91
92  ! Coefficient optiques sur 19 niveaux
93  REAL, SAVE, DIMENSION(nb_level) :: presnivs_19  ! Pression milieux couche pour 19 niveaux (nb_level)
94  !$OMP THREADPRIVATE(presnivs_19)
95
96  REAL, SAVE, DIMENSION(nb_level) :: A1_ASSSM_19, A2_ASSSM_19, A3_ASSSM_19, &
97          B1_ASSSM_19, B2_ASSSM_19, C1_ASSSM_19, C2_ASSSM_19, &
98          A1_CSSSM_19, A2_CSSSM_19, A3_CSSSM_19, &
99          B1_CSSSM_19, B2_CSSSM_19, C1_CSSSM_19, C2_CSSSM_19, &
100          A1_SSSSM_19, A2_SSSSM_19, A3_SSSSM_19, &
101          B1_SSSSM_19, B2_SSSSM_19, C1_SSSSM_19, C2_SSSSM_19
102  !$OMP THREADPRIVATE(A1_ASSSM_19, A2_ASSSM_19, A3_ASSSM_19)
103  !$OMP THREADPRIVATE(B1_ASSSM_19, B2_ASSSM_19, C1_ASSSM_19, C2_ASSSM_19)
104  !$OMP THREADPRIVATE(A1_CSSSM_19, A2_CSSSM_19, A3_CSSSM_19)
105  !$OMP THREADPRIVATE(B1_CSSSM_19, B2_CSSSM_19, C1_CSSSM_19, C2_CSSSM_19)
106  !$OMP THREADPRIVATE(A1_SSSSM_19, A2_SSSSM_19, A3_SSSSM_19)
107  !$OMP THREADPRIVATE(B1_SSSSM_19, B2_SSSSM_19, C1_SSSSM_19, C2_SSSSM_19)
108
109  ! Coefficient optiques interpole sur le nombre de niveau du modele
110  REAL, ALLOCATABLE, DIMENSION(:), SAVE :: &
111          A1_ASSSM, A2_ASSSM, A3_ASSSM, &
112          B1_ASSSM, B2_ASSSM, C1_ASSSM, C2_ASSSM, &
113          A1_CSSSM, A2_CSSSM, A3_CSSSM, &
114          B1_CSSSM, B2_CSSSM, C1_CSSSM, C2_CSSSM, &
115          A1_SSSSM, A2_SSSSM, A3_SSSSM, &
116          B1_SSSSM, B2_SSSSM, C1_SSSSM, C2_SSSSM
117  !$OMP THREADPRIVATE(A1_ASSSM, A2_ASSSM, A3_ASSSM)
118  !$OMP THREADPRIVATE(B1_ASSSM, B2_ASSSM, C1_ASSSM, C2_ASSSM)
119  !$OMP THREADPRIVATE(A1_CSSSM, A2_CSSSM, A3_CSSSM)
120  !$OMP THREADPRIVATE(B1_CSSSM, B2_CSSSM, C1_CSSSM, C2_CSSSM)
121  !$OMP THREADPRIVATE(A1_SSSSM, A2_SSSSM, A3_SSSSM)
122  !$OMP THREADPRIVATE(B1_SSSSM, B2_SSSSM, C1_SSSSM, C2_SSSSM)
123
124  REAL, PARAMETER :: RH_tab(nbre_RH) = (/0., 10., 20., 30., 40., 50., 60., 70., 80., 85., 90., 95./)
125  REAL :: DELTA(klon, klev), rh(klon, klev), H
126  REAL :: tau_ae5wv_int ! Intermediate computation of epaisseur optique aerosol
127  REAL :: piz_ae5wv_int ! Intermediate single scattering albedo aerosol
128  REAL :: cg_ae5wv_int  ! Intermediate asymmetry parameter aerosol
129  REAL, PARAMETER :: RH_MAX = 95.
130  REAL :: taue670(klon)       ! epaisseur optique aerosol absorption 550 nm
131  REAL :: taue865(klon)       ! epaisseur optique aerosol extinction 865 nm
132  REAL :: fac
133  INTEGER, ALLOCATABLE, DIMENSION(:) :: aerosol_name
134  INTEGER :: nb_aer
135
136  REAL :: tau3d(klon, klev), piz3d(klon, klev), cg3d(klon, klev)
137  REAL :: abs3d(klon, klev)     ! epaisseur optique d'absorption
138  REAL :: dh(klon, klev)
139
140  REAL :: alpha_aers_5wv(nbre_RH, las, naero_soluble)   ! ext. coeff. Soluble comp. units *** m2/g
141  !  1- BC soluble; 2- POM soluble; 3- SO4 acc.; 4- SO4 coarse; 5 seasalt super-C; 6 seasalt coarse; 7 seasalt acc.
142  REAL :: alpha_aeri_5wv(las, naero_insoluble)         ! ext. coeff. Insoluble comp. 1- Dust: 2- BC; 3- POM
143  REAL :: cg_aers_5wv(nbre_RH, las, naero_soluble)      ! Asym. param. soluble comp.
144  !  1- BC soluble; 2- POM soluble; 3- SO4 acc.; 4- SO4 coarse; 5 seasalt super-C; 6 seasalt coarse; 7 seasalt acc.
145  REAL :: cg_aeri_5wv(las, naero_insoluble)            ! Asym. param. insoluble comp. 1- Dust: 2- BC; 3- POM
146  REAL :: piz_aers_5wv(nbre_RH, las, naero_soluble)
147  !  1- BC soluble; 2- POM soluble; 3- SO4 acc.; 4- SO4 coarse; 5 seasalt super-C; 6 seasalt coarse; 7 seasalt acc.
148  REAL :: piz_aeri_5wv(las, naero_insoluble)           ! Insoluble comp. 1- Dust: 2- BC; 3- POM
149
150  ! Proprietes optiques
151
152  REAL :: fact_RH(nbre_RH)
153  LOGICAL :: used_tau(naero_spc)
154  INTEGER :: n
155
156  DATA presnivs_19/&
157          100426.5, 98327.6, 95346.5, 90966.8, 84776.9, &
158          76536.5, 66292.2, 54559.3, 42501.8, 31806, &
159          23787.5, 18252.7, 13996, 10320.8, 7191.1, &
160          4661.7, 2732.9, 1345.6, 388.2/
161
162  !!ACCUMULATION MODE
163  DATA A1_ASSSM_19/ 4.373E+00, 4.361E+00, 4.331E+00, &
164          4.278E+00, 4.223E+00, 4.162E+00, &
165          4.103E+00, 4.035E+00, 3.962E+00, &
166          3.904E+00, 3.871E+00, 3.847E+00, &
167          3.824E+00, 3.780E+00, 3.646E+00, &
168          3.448E+00, 3.179E+00, 2.855E+00, 2.630E+00/
169  DATA A2_ASSSM_19/ 2.496E+00, 2.489E+00, 2.472E+00, &
170          2.442E+00, 2.411E+00, 2.376E+00, &
171          2.342E+00, 2.303E+00, 2.261E+00, &
172          2.228E+00, 2.210E+00, 2.196E+00, &
173          2.183E+00, 2.158E+00, 2.081E+00, &
174          1.968E+00, 1.814E+00, 1.630E+00, 1.501E+00/
175  DATA A3_ASSSM_19/-4.688E-02, -4.676E-02, -4.644E-02, &
176          -4.587E-02, -4.528E-02, -4.463E-02, &
177          -4.399E-02, -4.326E-02, -4.248E-02, &
178          -4.186E-02, -4.151E-02, -4.125E-02, &
179          -4.100E-02, -4.053E-02, -3.910E-02, &
180          -3.697E-02, -3.408E-02, -3.061E-02, -2.819E-02/
181  DATA B1_ASSSM_19/ 1.165E-08, 1.145E-08, 1.097E-08, &
182          1.012E-08, 9.233E-09, 8.261E-09, &
183          7.297E-09, 6.201E-09, 5.026E-09, &
184          4.098E-09, 3.567E-09, 3.187E-09, &
185          2.807E-09, 2.291E-09, 2.075E-09, &
186          1.756E-09, 1.322E-09, 8.011E-10, 4.379E-10/
187  DATA B2_ASSSM_19/ 2.193E-08, 2.192E-08, 2.187E-08, &
188          2.179E-08, 2.171E-08, 2.162E-08, &
189          2.153E-08, 2.143E-08, 2.132E-08, &
190          2.124E-08, 2.119E-08, 2.115E-08, &
191          2.112E-08, 2.106E-08, 2.100E-08, &
192          2.090E-08, 2.077E-08, 2.061E-08, 2.049E-08/
193  DATA C1_ASSSM_19/ 7.365E-01, 7.365E-01, 7.365E-01, &
194          7.364E-01, 7.363E-01, 7.362E-01, &
195          7.361E-01, 7.359E-01, 7.358E-01, &
196          7.357E-01, 7.356E-01, 7.356E-01, &
197          7.356E-01, 7.355E-01, 7.354E-01, &
198          7.352E-01, 7.350E-01, 7.347E-01, 7.345E-01/
199  DATA C2_ASSSM_19/ 5.833E-02, 5.835E-02, 5.841E-02, &
200          5.850E-02, 5.859E-02, 5.870E-02, &
201          5.880E-02, 5.891E-02, 5.904E-02, &
202          5.914E-02, 5.920E-02, 5.924E-02, &
203          5.928E-02, 5.934E-02, 5.944E-02, &
204          5.959E-02, 5.979E-02, 6.003E-02, 6.020E-02/
205  !COARSE MODE
206  DATA A1_CSSSM_19/ 7.403E-01, 7.422E-01, 7.626E-01, &
207          8.019E-01, 8.270E-01, 8.527E-01, &
208          8.702E-01, 8.806E-01, 8.937E-01, &
209          9.489E-01, 1.030E+00, 1.105E+00, &
210          1.199E+00, 1.357E+00, 1.660E+00, &
211          2.540E+00, 4.421E+00, 2.151E+00, 9.518E-01/
212  DATA A2_CSSSM_19/ 4.522E-01, 4.532E-01, 4.644E-01, &
213          4.859E-01, 4.996E-01, 5.137E-01, &
214          5.233E-01, 5.290E-01, 5.361E-01, &
215          5.655E-01, 6.085E-01, 6.483E-01, &
216          6.979E-01, 7.819E-01, 9.488E-01, &
217          1.450E+00, 2.523E+00, 1.228E+00, 5.433E-01/
218  DATA A3_CSSSM_19/-8.516E-03, -8.535E-03, -8.744E-03, &
219          -9.148E-03, -9.406E-03, -9.668E-03, &
220          -9.848E-03, -9.955E-03, -1.009E-02, &
221          -1.064E-02, -1.145E-02, -1.219E-02, &
222          -1.312E-02, -1.470E-02, -1.783E-02, &
223          -2.724E-02, -4.740E-02, -2.306E-02, -1.021E-02/
224  DATA B1_CSSSM_19/ 2.535E-07, 2.530E-07, 2.479E-07, &
225          2.380E-07, 2.317E-07, 2.252E-07, &
226          2.208E-07, 2.182E-07, 2.149E-07, &
227          2.051E-07, 1.912E-07, 1.784E-07, &
228          1.624E-07, 1.353E-07, 1.012E-07, &
229          6.016E-08, 2.102E-08, 0.000E+00, 0.000E+00/
230  DATA B2_CSSSM_19/ 1.221E-07, 1.217E-07, 1.179E-07, &
231          1.104E-07, 1.056E-07, 1.008E-07, &
232          9.744E-08, 9.546E-08, 9.299E-08, &
233          8.807E-08, 8.150E-08, 7.544E-08, &
234          6.786E-08, 5.504E-08, 4.080E-08, &
235          2.960E-08, 2.300E-08, 2.030E-08, 1.997E-08/
236  DATA C1_CSSSM_19/ 7.659E-01, 7.658E-01, 7.652E-01, &
237          7.639E-01, 7.631E-01, 7.623E-01, &
238          7.618E-01, 7.614E-01, 7.610E-01, &
239          7.598E-01, 7.581E-01, 7.566E-01, &
240          7.546E-01, 7.513E-01, 7.472E-01, &
241          7.423E-01, 7.376E-01, 7.342E-01, 7.334E-01/
242  DATA C2_CSSSM_19/ 3.691E-02, 3.694E-02, 3.729E-02, &
243          3.796E-02, 3.839E-02, 3.883E-02, &
244          3.913E-02, 3.931E-02, 3.953E-02, &
245          4.035E-02, 4.153E-02, 4.263E-02, &
246          4.400E-02, 4.631E-02, 4.933E-02, &
247          5.331E-02, 5.734E-02, 6.053E-02, 6.128E-02/
248  !SUPER COARSE MODE
249  DATA A1_SSSSM_19/ 2.836E-01, 2.876E-01, 2.563E-01, &
250          2.414E-01, 2.541E-01, 2.546E-01, &
251          2.572E-01, 2.638E-01, 2.781E-01, &
252          3.167E-01, 4.209E-01, 5.286E-01, &
253          6.959E-01, 9.233E-01, 1.282E+00, &
254          1.836E+00, 2.981E+00, 4.355E+00, 4.059E+00/
255  DATA A2_SSSSM_19/ 1.608E-01, 1.651E-01, 1.577E-01, &
256          1.587E-01, 1.686E-01, 1.690E-01, &
257          1.711E-01, 1.762E-01, 1.874E-01, &
258          2.138E-01, 2.751E-01, 3.363E-01, &
259          4.279E-01, 5.519E-01, 7.421E-01, &
260          1.048E+00, 1.702E+00, 2.485E+00, 2.317E+00/
261  DATA A3_SSSSM_19/-3.025E-03, -3.111E-03, -2.981E-03, &
262          -3.005E-03, -3.193E-03, -3.200E-03, &
263          -3.239E-03, -3.336E-03, -3.548E-03, &
264          -4.047E-03, -5.196E-03, -6.345E-03, &
265          -8.061E-03, -1.038E-02, -1.395E-02, &
266          -1.970E-02, -3.197E-02, -4.669E-02, -4.352E-02/
267  DATA B1_SSSSM_19/ 6.759E-07, 6.246E-07, 5.542E-07, &
268          4.953E-07, 4.746E-07, 4.738E-07, &
269          4.695E-07, 4.588E-07, 4.354E-07, &
270          3.947E-07, 3.461E-07, 3.067E-07, &
271          2.646E-07, 2.095E-07, 1.481E-07, &
272          9.024E-08, 5.747E-08, 2.384E-08, 6.599E-09/
273  DATA B2_SSSSM_19/ 5.977E-07, 5.390E-07, 4.468E-07, &
274          3.696E-07, 3.443E-07, 3.433E-07, &
275          3.380E-07, 3.249E-07, 2.962E-07, &
276          2.483E-07, 1.989E-07, 1.623E-07, &
277          1.305E-07, 9.015E-08, 6.111E-08, &
278          3.761E-08, 2.903E-08, 2.337E-08, 2.147E-08/
279  DATA C1_SSSSM_19/ 8.120E-01, 8.084E-01, 8.016E-01, &
280          7.953E-01, 7.929E-01, 7.928E-01, &
281          7.923E-01, 7.910E-01, 7.882E-01, &
282          7.834E-01, 7.774E-01, 7.725E-01, &
283          7.673E-01, 7.604E-01, 7.529E-01, &
284          7.458E-01, 7.419E-01, 7.379E-01, 7.360E-01/
285  DATA C2_SSSSM_19/ 2.388E-02, 2.392E-02, 2.457E-02, 2.552E-02, &
286          2.615E-02, 2.618E-02, 2.631E-02, 2.663E-02, &
287          2.735E-02, 2.875E-02, 3.113E-02, 3.330E-02, &
288          3.615E-02, 3.997E-02, 4.521E-02, 5.038E-02, &
289          5.358E-02, 5.705E-02, 5.887E-02/
290  !*********************************************************************
291
292
293  ! From here on we look at the optical parameters at 5 wavelengths:
294  ! 443nm, 550, 670, 765 and 865 nm
295  !                                   le 12 AVRIL 2006
296
297  DATA alpha_aers_5wv/ &
298          ! bc soluble
299          7.930, 7.930, 7.930, 7.930, 7.930, 7.930, &
300          7.930, 7.930, 10.893, 12.618, 14.550, 16.613, &
301          7.658, 7.658, 7.658, 7.658, 7.658, 7.658, &
302          7.658, 7.658, 10.351, 11.879, 13.642, 15.510, &
303          7.195, 7.195, 7.195, 7.195, 7.195, 7.195, &
304          7.195, 7.195, 9.551, 10.847, 12.381, 13.994, &
305          6.736, 6.736, 6.736, 6.736, 6.736, 6.736, &
306          6.736, 6.736, 8.818, 9.938, 11.283, 12.687, &
307          6.277, 6.277, 6.277, 6.277, 6.277, 6.277, &
308          6.277, 6.277, 8.123, 9.094, 10.275, 11.501, &
309          ! pom soluble
310          6.676, 6.676, 6.676, 6.676, 6.710, 6.934, &
311          7.141, 7.569, 8.034, 8.529, 9.456, 10.511, &
312          5.109, 5.109, 5.109, 5.109, 5.189, 5.535, &
313          5.960, 6.852, 8.008, 9.712, 12.897, 19.676, &
314          3.718, 3.718, 3.718, 3.718, 3.779, 4.042, &
315          4.364, 5.052, 5.956, 7.314, 9.896, 15.688, &
316          2.849, 2.849, 2.849, 2.849, 2.897, 3.107, &
317          3.365, 3.916, 4.649, 5.760, 7.900, 12.863, &
318          2.229, 2.229, 2.229, 2.229, 2.268, 2.437, &
319          2.645, 3.095, 3.692, 4.608, 6.391, 10.633, &
320          ! Sulfate (Accumulation)
321          5.751, 6.215, 6.690, 7.024, 7.599, 8.195, &
322          9.156, 10.355, 12.660, 14.823, 18.908, 24.508, &
323          4.320, 4.675, 5.052, 5.375, 5.787, 6.274, &
324          7.066, 8.083, 10.088, 12.003, 15.697, 21.133, &
325          3.079, 3.351, 3.639, 3.886, 4.205, 4.584, &
326          5.206, 6.019, 7.648, 9.234, 12.391, 17.220, &
327          2.336, 2.552, 2.781, 2.979, 3.236, 3.540, &
328          4.046, 4.711, 6.056, 7.388, 10.093, 14.313, &
329          1.777, 1.949, 2.134, 2.292, 2.503, 2.751, &
330          3.166, 3.712, 4.828, 5.949, 8.264, 11.922, &
331          ! Sulfate (Coarse)
332          5.751, 6.215, 6.690, 7.024, 7.599, 8.195, &
333          9.156, 10.355, 12.660, 14.823, 18.908, 24.508, &
334          4.320, 4.675, 5.052, 5.375, 5.787, 6.274, &
335          7.066, 8.083, 10.088, 12.003, 15.697, 21.133, &
336          3.079, 3.351, 3.639, 3.886, 4.205, 4.584, &
337          5.206, 6.019, 7.648, 9.234, 12.391, 17.220, &
338          2.336, 2.552, 2.781, 2.979, 3.236, 3.540, &
339          4.046, 4.711, 6.056, 7.388, 10.093, 14.313, &
340          1.777, 1.949, 2.134, 2.292, 2.503, 2.751, &
341          3.166, 3.712, 4.828, 5.949, 8.264, 11.922, &
342          ! Seasalt soluble super_coarse (computed below for 550nm)
343          0.50, 0.90, 1.05, 1.21, 1.40, 2.41, &
344          2.66, 3.11, 3.88, 4.52, 5.69, 8.84, &
345          0.000, 0.000, 0.000, 0.000, 0.000, 0.000, &
346          0.000, 0.000, 0.000, 0.000, 0.000, 0.000, &
347          0.52, 0.93, 1.08, 1.24, 1.43, 2.47, &
348          2.73, 3.20, 3.99, 4.64, 5.84, 9.04, &
349          0.52, 0.93, 1.09, 1.25, 1.44, 2.50, &
350          2.76, 3.23, 4.03, 4.68, 5.89, 9.14, &
351          0.52, 0.94, 1.09, 1.26, 1.45, 2.51, &
352          2.78, 3.25, 4.06, 4.72, 5.94, 9.22, &
353          ! seasalt soluble coarse (computed below for 550nm)
354          0.50, 0.90, 1.05, 1.21, 1.40, 2.41, &
355          2.66, 3.11, 3.88, 4.52, 5.69, 8.84, &
356          0.000, 0.000, 0.000, 0.000, 0.000, 0.000, &
357          0.000, 0.000, 0.000, 0.000, 0.000, 0.000, &
358          0.52, 0.93, 1.08, 1.24, 1.43, 2.47, &
359          2.73, 3.20, 3.99, 4.64, 5.84, 9.04, &
360          0.52, 0.93, 1.09, 1.25, 1.44, 2.50, &
361          2.76, 3.23, 4.03, 4.68, 5.89, 9.14, &
362          0.52, 0.94, 1.09, 1.26, 1.45, 2.51, &
363          2.78, 3.25, 4.06, 4.72, 5.94, 9.22, &
364          ! seasalt soluble accumulation (computed below for 550nm)
365          4.28, 7.17, 8.44, 9.85, 11.60, 22.44, &
366          25.34, 30.54, 39.38, 46.52, 59.33, 91.77, &
367          0.000, 0.000, 0.000, 0.000, 0.000, 0.000, &
368          0.000, 0.000, 0.000, 0.000, 0.000, 0.000, &
369          2.48, 4.22, 5.02, 5.94, 7.11, 15.29, &
370          17.70, 22.31, 30.73, 38.06, 52.15, 90.59, &
371          1.90, 3.29, 3.94, 4.69, 5.65, 12.58, &
372          14.68, 18.77, 26.41, 33.25, 46.77, 85.50, &
373          1.47, 2.59, 3.12, 3.74, 4.54, 10.42, &
374          12.24, 15.82, 22.66, 28.91, 41.54, 79.33/
375
376  DATA alpha_aeri_5wv/ &
377          ! dust insoluble
378          0.759, 0.770, 0.775, 0.775, 0.772, &
379          !!jb bc insoluble
380          11.536, 10.033, 8.422, 7.234, 6.270, &
381          ! pom insoluble
382          5.042, 3.101, 1.890, 1.294, 0.934/
383
384  DATA cg_aers_5wv/ &
385          ! bc soluble
386          .651, .651, .651, .651, .651, .651, &
387          .651, .651, .738, .764, .785, .800, &
388          .597, .597, .597, .597, .597, .597, &
389          .597, .597, .695, .725, .751, .770, &
390          .543, .543, .543, .543, .543, .543, &
391          .543, .543, .650, .684, .714, .736, &
392          .504, .504, .504, .504, .504, .504, &
393          .504, .504, .614, .651, .683, .708, &
394          .469, .469, .469, .469, .469, .469, &
395          .469, .469, .582, .620, .655, .681, &
396          ! pom soluble
397          .679, .679, .679, .679, .683, .691, &
398          .703, .720, .736, .751, .766, .784, &
399          .656, .656, .656, .656, .659, .669, &
400          .681, .699, .717, .735, .750, .779, &
401          .623, .623, .623, .623, .627, .637, &
402          .649, .668, .688, .709, .734, .762, &
403          .592, .592, .592, .592, .595, .605, &
404          .618, .639, .660, .682, .711, .743, &
405          .561, .561, .561, .561, .565, .575, &
406          .588, .609, .632, .656, .688, .724, &
407          ! Accumulation sulfate
408          .671, .684, .697, .704, .714, .723, &
409          .734, .746, .762, .771, .781, .789, &
410          .653, .666, .678, .687, .697, .707, &
411          .719, .732, .751, .762, .775, .789, &
412          .622, .635, .648, .657, .667, .678, &
413          .691, .705, .728, .741, .758, .777, &
414          .591, .604, .617, .627, .638, .650, &
415          .664, .679, .704, .719, .739, .761, &
416          .560, .574, .587, .597, .609, .621, &
417          .637, .653, .680, .697, .719, .745, &
418          ! Coarse sulfate
419          .671, .684, .697, .704, .714, .723, &
420          .734, .746, .762, .771, .781, .789, &
421          .653, .666, .678, .687, .697, .707, &
422          .719, .732, .751, .762, .775, .789, &
423          .622, .635, .648, .657, .667, .678, &
424          .691, .705, .728, .741, .758, .777, &
425          .591, .604, .617, .627, .638, .650, &
426          .664, .679, .704, .719, .739, .761, &
427          .560, .574, .587, .597, .609, .621, &
428          .637, .653, .680, .697, .719, .745, &
429          ! For super coarse seasalt (computed below for 550nm!)
430          0.730, 0.753, 0.760, 0.766, 0.772, 0.793, &
431          0.797, 0.802, 0.809, 0.813, 0.820, 0.830, &
432          0.000, 0.000, 0.000, 0.000, 0.000, 0.000, &
433          0.000, 0.000, 0.000, 0.000, 0.000, 0.000, &
434          0.721, 0.744, 0.750, 0.756, 0.762, 0.784, &
435          0.787, 0.793, 0.800, 0.804, 0.811, 0.822, &
436          0.717, 0.741, 0.747, 0.753, 0.759, 0.780, &
437          0.784, 0.789, 0.795, 0.800, 0.806, 0.817, &
438          0.715, 0.739, 0.745, 0.751, 0.757, 0.777, &
439          0.781, 0.786, 0.793, 0.797, 0.803, 0.814, &
440          ! For coarse-soluble seasalt (computed below for 550nm!)
441          0.730, 0.753, 0.760, 0.766, 0.772, 0.793, &
442          0.797, 0.802, 0.809, 0.813, 0.820, 0.830, &
443          0.000, 0.000, 0.000, 0.000, 0.000, 0.000, &
444          0.000, 0.000, 0.000, 0.000, 0.000, 0.000, &
445          0.721, 0.744, 0.750, 0.756, 0.762, 0.784, &
446          0.787, 0.793, 0.800, 0.804, 0.811, 0.822, &
447          0.717, 0.741, 0.747, 0.753, 0.759, 0.780, &
448          0.784, 0.789, 0.795, 0.800, 0.806, 0.817, &
449          0.715, 0.739, 0.745, 0.751, 0.757, 0.777, &
450          0.781, 0.786, 0.793, 0.797, 0.803, 0.814, &
451          ! accumulation-seasalt soluble (computed below for 550nm!)
452          0.698, 0.722, 0.729, 0.736, 0.743, 0.765, &
453          0.768, 0.773, 0.777, 0.779, 0.781, 0.779, &
454          0.000, 0.000, 0.000, 0.000, 0.000, 0.000, &
455          0.000, 0.000, 0.000, 0.000, 0.000, 0.000, &
456          0.658, 0.691, 0.701, 0.710, 0.720, 0.756, &
457          0.763, 0.771, 0.782, 0.788, 0.795, 0.801, &
458          0.632, 0.668, 0.679, 0.690, 0.701, 0.743, &
459          0.750, 0.762, 0.775, 0.783, 0.792, 0.804, &
460          0.605, 0.644, 0.656, 0.669, 0.681, 0.729, &
461          0.737, 0.750, 0.765, 0.775, 0.787, 0.803/
462
463  DATA cg_aeri_5wv/&
464          ! dust insoluble
465          0.714, 0.697, 0.688, 0.683, 0.679, &
466          ! bc insoluble
467          0.511, 0.445, 0.384, 0.342, 0.307, &
468          !c pom insoluble
469          0.596, 0.536, 0.466, 0.409, 0.359/
470
471  DATA piz_aers_5wv/&
472          ! bc soluble
473          .445, .445, .445, .445, .445, .445, &
474          .445, .445, .470, .487, .508, .531, &
475          .442, .442, .442, .442, .442, .442, &
476          .442, .442, .462, .481, .506, .533, &
477          .427, .427, .427, .427, .427, .427, &
478          .427, .427, .449, .470, .497, .526, &
479          .413, .413, .413, .413, .413, .413, &
480          .413, .413, .437, .458, .486, .516, &
481          .399, .399, .399, .399, .399, .399, &
482          .399, .399, .423, .445, .473, .506, &
483          ! pom soluble
484          .975, .975, .975, .975, .975, .977, &
485          .979, .982, .984, .987, .990, .994, &
486          .972, .972, .972, .972, .973, .974, &
487          .977, .980, .983, .986, .989, .993, &
488          .963, .963, .963, .963, .964, .966, &
489          .969, .974, .977, .982, .986, .991, &
490          .955, .955, .955, .955, .955, .958, &
491          .962, .967, .972, .977, .983, .989, &
492          .944, .944, .944, .944, .944, .948, &
493          .952, .959, .962, .972, .979, .987, &
494          ! sulfate soluble accumulation
495          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
496          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
497          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
498          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
499          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
500          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
501          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
502          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
503          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
504          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
505          ! sulfate soluble coarse
506          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
507          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
508          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
509          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
510          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
511          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
512          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
513          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
514          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
515          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
516          ! seasalt super coarse (computed below for 550nm)
517          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
518          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
519          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
520          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
521          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
522          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
523          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
524          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
525          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
526          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
527          ! seasalt coarse (computed below for 550nm)
528          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
529          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
530          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
531          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
532          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
533          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
534          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
535          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
536          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
537          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
538          ! seasalt soluble accumulation (computed below for 550nm)
539          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
540          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
541          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
542          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
543          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
544          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
545          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
546          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
547          1.000, 1.000, 1.000, 1.000, 1.000, 1.000, &
548          1.000, 1.000, 1.000, 1.000, 1.000, 1.000/
549
550  DATA piz_aeri_5wv/&
551          ! dust insoluble
552          0.944, 0.970, 0.977, 0.982, 0.987, &
553          ! bc insoluble
554          0.415, 0.387, 0.355, 0.328, 0.301, &
555          ! pom insoluble
556          0.972, 0.963, 0.943, 0.923, 0.897/
557
558  ! Interpolation des coefficients optiques de 19 niveaux vers le nombre des niveaux du model
559  IF (firstcall) THEN
560    firstcall = .FALSE.
561    ! Allocation
562    IF (.NOT. ALLOCATED(A1_ASSSM)) THEN
563      ALLOCATE(A1_ASSSM(klev), A2_ASSSM(klev), A3_ASSSM(klev), &
564              B1_ASSSM(klev), B2_ASSSM(klev), C1_ASSSM(klev), C2_ASSSM(klev), &
565              A1_CSSSM(klev), A2_CSSSM(klev), A3_CSSSM(klev), &
566              B1_CSSSM(klev), B2_CSSSM(klev), C1_CSSSM(klev), C2_CSSSM(klev), &
567              A1_SSSSM(klev), A2_SSSSM(klev), A3_SSSSM(klev), &
568              B1_SSSSM(klev), B2_SSSSM(klev), C1_SSSSM(klev), C2_SSSSM(klev), stat = ierr)
569      IF (ierr /= 0) CALL abort_physic('aeropt_5mw', 'pb in allocation 1', 1)
570    END IF
571
572    !Accumulation mode
573    CALL pres2lev(A1_ASSSM_19, A1_ASSSM, nb_level, klev, presnivs_19, presnivs, 1, 1, .FALSE.)
574    CALL pres2lev(A2_ASSSM_19, A2_ASSSM, nb_level, klev, presnivs_19, presnivs, 1, 1, .FALSE.)
575    CALL pres2lev(A3_ASSSM_19, A3_ASSSM, nb_level, klev, presnivs_19, presnivs, 1, 1, .FALSE.)
576    CALL pres2lev(B1_ASSSM_19, B1_ASSSM, nb_level, klev, presnivs_19, presnivs, 1, 1, .FALSE.)
577    CALL pres2lev(B2_ASSSM_19, B2_ASSSM, nb_level, klev, presnivs_19, presnivs, 1, 1, .FALSE.)
578    CALL pres2lev(C1_ASSSM_19, C1_ASSSM, nb_level, klev, presnivs_19, presnivs, 1, 1, .FALSE.)
579    CALL pres2lev(C2_ASSSM_19, C2_ASSSM, nb_level, klev, presnivs_19, presnivs, 1, 1, .FALSE.)
580    !Coarse mode
581    CALL pres2lev(A1_CSSSM_19, A1_CSSSM, nb_level, klev, presnivs_19, presnivs, 1, 1, .FALSE.)
582    CALL pres2lev(A2_CSSSM_19, A2_CSSSM, nb_level, klev, presnivs_19, presnivs, 1, 1, .FALSE.)
583    CALL pres2lev(A3_CSSSM_19, A3_CSSSM, nb_level, klev, presnivs_19, presnivs, 1, 1, .FALSE.)
584    CALL pres2lev(B1_CSSSM_19, B1_CSSSM, nb_level, klev, presnivs_19, presnivs, 1, 1, .FALSE.)
585    CALL pres2lev(B2_CSSSM_19, B2_CSSSM, nb_level, klev, presnivs_19, presnivs, 1, 1, .FALSE.)
586    CALL pres2lev(C1_CSSSM_19, C1_CSSSM, nb_level, klev, presnivs_19, presnivs, 1, 1, .FALSE.)
587    CALL pres2lev(C2_CSSSM_19, C2_CSSSM, nb_level, klev, presnivs_19, presnivs, 1, 1, .FALSE.)
588    !Super coarse mode
589    CALL pres2lev(A1_SSSSM_19, A1_SSSSM, nb_level, klev, presnivs_19, presnivs, 1, 1, .FALSE.)
590    CALL pres2lev(A2_SSSSM_19, A2_SSSSM, nb_level, klev, presnivs_19, presnivs, 1, 1, .FALSE.)
591    CALL pres2lev(A3_SSSSM_19, A3_SSSSM, nb_level, klev, presnivs_19, presnivs, 1, 1, .FALSE.)
592    CALL pres2lev(B1_SSSSM_19, B1_SSSSM, nb_level, klev, presnivs_19, presnivs, 1, 1, .FALSE.)
593    CALL pres2lev(B2_SSSSM_19, B2_SSSSM, nb_level, klev, presnivs_19, presnivs, 1, 1, .FALSE.)
594    CALL pres2lev(C1_SSSSM_19, C1_SSSSM, nb_level, klev, presnivs_19, presnivs, 1, 1, .FALSE.)
595    CALL pres2lev(C2_SSSSM_19, C2_SSSSM, nb_level, klev, presnivs_19, presnivs, 1, 1, .FALSE.)
596
597  END IF ! firstcall
598
599  ! Initialisations
600  tau(:, :, :, :) = 0.
601  tausum(:, :, :) = 0.
602  ai(:) = 0.0
603
604  DO k = 1, klev
605    DO i = 1, klon
606      zrho = pplay(i, k) / t_seri(i, k) / RD     ! kg/m3
607      dh(i, k) = pdel(i, k) / (RG * zrho)    ! m
608    ENDDO
609  ENDDO
610
611  IF (flag_aerosol == 1) THEN
612    nb_aer = 2
613    ALLOCATE (aerosol_name(nb_aer))
614    aerosol_name(1) = id_ASSO4M_phy
615    aerosol_name(2) = id_CSSO4M_phy
616  ELSEIF (flag_aerosol == 2) THEN
617    nb_aer = 2
618    ALLOCATE (aerosol_name(nb_aer))
619    aerosol_name(1) = id_ASBCM_phy
620    aerosol_name(2) = id_AIBCM_phy
621  ELSEIF (flag_aerosol == 3) THEN
622    nb_aer = 2
623    ALLOCATE (aerosol_name(nb_aer))
624    aerosol_name(1) = id_ASPOMM_phy
625    aerosol_name(2) = id_AIPOMM_phy
626  ELSEIF (flag_aerosol == 4) THEN
627    nb_aer = 3
628    ALLOCATE (aerosol_name(nb_aer))
629    aerosol_name(1) = id_CSSSM_phy
630    aerosol_name(2) = id_SSSSM_phy
631    aerosol_name(3) = id_ASSSM_phy
632  ELSEIF (flag_aerosol == 5) THEN
633    nb_aer = 1
634    ALLOCATE (aerosol_name(nb_aer))
635    aerosol_name(1) = id_CIDUSTM_phy
636  ELSEIF (flag_aerosol == 6) THEN
637    nb_aer = 10
638    ALLOCATE (aerosol_name(nb_aer))
639    aerosol_name(1) = id_ASSO4M_phy
640    aerosol_name(2) = id_ASBCM_phy
641    aerosol_name(3) = id_AIBCM_phy
642    aerosol_name(4) = id_ASPOMM_phy
643    aerosol_name(5) = id_AIPOMM_phy
644    aerosol_name(6) = id_CSSSM_phy
645    aerosol_name(7) = id_SSSSM_phy
646    aerosol_name(8) = id_ASSSM_phy
647    aerosol_name(9) = id_CIDUSTM_phy
648    aerosol_name(10) = id_CSSO4M_phy
649  ENDIF
650
651  ! loop over modes, use of precalculated nmd and corresponding sigma
652  !    loop over wavelengths
653  !    for each mass species in mode
654  !      interpolate from Sext to retrieve Sext_at_gridpoint_per_species
655  !      compute optical_thickness_at_gridpoint_per_species
656
657  ! Calculations that need to be done since we are not in the subroutines INCA
658
659  DO n = 1, nbre_RH - 1
660    fact_RH(n) = 1. / (RH_tab(n + 1) - RH_tab(n))
661  ENDDO
662
663  DO k = 1, klev
664    DO i = 1, klon
665      rh(i, k) = MIN(RHcl(i, k) * 100., RH_MAX)
666      RH_num(i, k) = INT(rh(i, k) / 10. + 1.)
667      !--test olivier pour pas de reindicage
668      !      RH_num(i,k) =1
669      IF (rh(i, k)>85.) RH_num(i, k) = 10
670      IF (rh(i, k)>90.) RH_num(i, k) = 11
671      DELTA(i, k) = (rh(i, k) - RH_tab(RH_num(i, k))) * fact_RH(RH_num(i, k))
672    ENDDO
673  ENDDO
674
675  used_tau(:) = .FALSE.
676
677  DO m = 1, nb_aer   ! tau is only computed for each mass
678    fac = 1.0
679    IF (aerosol_name(m)==id_ASBCM_phy) THEN
680      soluble = .TRUE.
681      spsol = 1
682      spss = 0
683    ELSEIF (aerosol_name(m)==id_ASPOMM_phy) THEN
684      soluble = .TRUE.
685      spsol = 2
686      spss = 0
687    ELSEIF (aerosol_name(m)==id_ASSO4M_phy) THEN
688      soluble = .TRUE.
689      spsol = 3
690      spss = 0
691      fac = 1.375    ! (NH4)2-SO4/SO4 132/96 mass conversion factor for OD
692    ELSEIF (aerosol_name(m)==id_CSSO4M_phy) THEN
693      soluble = .TRUE.
694      spsol = 4
695      spss = 0
696      fac = 1.375    ! (NH4)2-SO4/SO4 132/96 mass conversion factor for OD
697    ELSEIF (aerosol_name(m)==id_SSSSM_phy) THEN
698      soluble = .TRUE.
699      spsol = 5
700      spss = 3
701    ELSEIF (aerosol_name(m)==id_CSSSM_phy) THEN
702      soluble = .TRUE.
703      spsol = 6
704      spss = 2
705    ELSEIF (aerosol_name(m)==id_ASSSM_phy) THEN
706      soluble = .TRUE.
707      spsol = 7
708      spss = 1
709    ELSEIF (aerosol_name(m)==id_CIDUSTM_phy) THEN
710      soluble = .FALSE.
711      spinsol = 1
712      spss = 0
713    ELSEIF  (aerosol_name(m)==id_AIBCM_phy) THEN
714      soluble = .FALSE.
715      spinsol = 2
716      spss = 0
717    ELSEIF (aerosol_name(m)==id_AIPOMM_phy) THEN
718      soluble = .FALSE.
719      spinsol = 3
720      spss = 0
721    ELSE
722      CYCLE
723    ENDIF
724
725    IF (soluble) THEN
726      used_tau(spsol) = .TRUE.
727    ELSE
728      used_tau(naero_soluble + spinsol) = .TRUE.
729    ENDIF
730
731    aerindex = aerosol_name(m)
732
733    DO la = 1, las
734
735      !--only 550 and 865 nm are used
736      IF (la/=la550.AND.la/=la865) CYCLE
737
738      IF (soluble) THEN
739
740        IF ((la==2).AND.(spss/=0)) THEN !la=2 corresponds to 550 nm
741          IF (spss==1) THEN !accumulation mode
742            DO k = 1, klev
743              DO i = 1, klon
744                H = rh(i, k) / 100.
745                tau_ae5wv_int = A1_ASSSM(k) + A2_ASSSM(k) * H + A3_ASSSM(k) / (H - 1.05)
746                tau(i, k, la, aerindex) = m_allaer(i, k, aerindex) / 1.e6 * dh(i, k) * tau_ae5wv_int * fac
747                tausum(i, la, aerindex) = tausum(i, la, aerindex) + tau(i, k, la, aerindex)
748              ENDDO
749            ENDDO
750          ENDIF
751
752          IF (spss==2) THEN !coarse mode
753            DO k = 1, klev
754              DO i = 1, klon
755                H = rh(i, k) / 100.
756                tau_ae5wv_int = A1_CSSSM(k) + A2_CSSSM(k) * H + A3_CSSSM(k) / (H - 1.05)
757                tau(i, k, la, aerindex) = m_allaer(i, k, aerindex) / 1.e6 * dh(i, k) * tau_ae5wv_int * fac
758                tausum(i, la, aerindex) = tausum(i, la, aerindex) + tau(i, k, la, aerindex)
759              ENDDO
760            ENDDO
761          ENDIF
762
763          IF (spss==3) THEN !super coarse mode
764            DO k = 1, klev
765              DO i = 1, klon
766                H = rh(i, k) / 100.
767                tau_ae5wv_int = A1_SSSSM(k) + A2_SSSSM(k) * H + A3_SSSSM(k) / (H - 1.05)
768                tau(i, k, la, aerindex) = m_allaer(i, k, aerindex) / 1.e6 * dh(i, k) * tau_ae5wv_int * fac
769                tausum(i, la, aerindex) = tausum(i, la, aerindex) + tau(i, k, la, aerindex)
770              ENDDO
771            ENDDO
772          ENDIF
773
774        ELSE
775          DO k = 1, klev
776            DO i = 1, klon
777              tau_ae5wv_int = alpha_aers_5wv(RH_num(i, k), la, spsol) + DELTA(i, k) * &
778                      (alpha_aers_5wv(RH_num(i, k) + 1, la, spsol) - &
779                              alpha_aers_5wv(RH_num(i, k), la, spsol))
780              tau(i, k, la, aerindex) = m_allaer(i, k, aerindex) / 1.e6 * dh(i, k) * tau_ae5wv_int * fac
781              tausum(i, la, aerindex) = tausum(i, la, aerindex) + tau(i, k, la, aerindex)
782            ENDDO
783          ENDDO
784        ENDIF
785
786      ELSE                                                  ! For insoluble aerosol
787
788        DO k = 1, klev
789          DO i = 1, klon
790            tau_ae5wv_int = alpha_aeri_5wv(la, spinsol)
791            tau(i, k, la, aerindex) = m_allaer(i, k, aerindex) / 1.e6 * dh(i, k) * tau_ae5wv_int * fac
792            tausum(i, la, aerindex) = tausum(i, la, aerindex) + tau(i, k, la, aerindex)
793          ENDDO
794        ENDDO
795
796      ENDIF
797
798    ENDDO   ! boucle sur les longueurs d'onde
799  ENDDO     ! Boucle  sur les masses de traceurs
800
801  DO m = 1, naero_spc
802    IF (.NOT.used_tau(m)) tau(:, :, :, m) = 0.
803  ENDDO
804
805  !--AOD calculations for diagnostics
806  od550aer(:) = SUM(tausum(:, la550, :), dim = 2)
807  od865aer(:) = SUM(tausum(:, la865, :), dim = 2)
808
809  !--extinction coefficient for diagnostic
810  ec550aer(:, :) = SUM(tau(:, :, la550, :), dim = 3) / dh(:, :)
811
812  !--acc mode AOD calculation for diagnostic
813  od550lt1aer(:) = tausum(:, la550, id_ASSO4M_phy) + tausum(:, la550, id_ASBCM_phy) + tausum(:, la550, id_AIBCM_phy) + &
814          tausum(:, la550, id_ASPOMM_phy) + tausum(:, la550, id_AIPOMM_phy) + tausum(:, la550, id_ASSSM_phy) + &
815          0.03 * tausum(:, la550, id_CSSSM_phy) + 0.4 * tausum(:, la550, id_CIDUSTM_phy)
816
817  DEALLOCATE(aerosol_name)
818
819END SUBROUTINE AEROPT_5WV
Note: See TracBrowser for help on using the repository browser.