source: LMDZ6/trunk/libf/phylmd/phys_local_var_mod.F90 @ 4693

Last change on this file since 4693 was 4677, checked in by idelkadi, 15 months ago

Implementation in the LMDZ code of the double call of the ECRAD radiative transfer code to estimate the 3D radiative effect of clouds.

  • This double call of Ecrad is controlled by the ok_3Deffect logic key.
  • If this key is enabled, 2 files of parameter configuration "namelists" for ECRAD are required at runtime: namelist_ecrad and namelist_ecrad_s2.
  • If this key is deactivated, the configuration and initialization part (reading namelist and netcdf files) is performed only once during simulation (1st call to ECRAD). Otherwise, configuration and initialization are performed each time Ecrad is called.
  • 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 Id
File size: 55.5 KB
Line 
1!
2! $Id: phys_local_var_mod.F90 4677 2023-09-07 11:07:27Z fairhead $
3!
4      MODULE phys_local_var_mod
5! Variables locales pour effectuer les appels en serie
6!======================================================================
7!
8!
9!======================================================================
10! Declaration des variables
11
12      REAL, SAVE, ALLOCATABLE :: t_seri(:,:), q_seri(:,:)
13      !$OMP THREADPRIVATE(t_seri, q_seri)
14      REAL, SAVE, ALLOCATABLE :: ql_seri(:,:),qs_seri(:,:)
15      !$OMP THREADPRIVATE(ql_seri,qs_seri)
16      REAL, SAVE, ALLOCATABLE :: qbs_seri(:,:)
17      !$OMP THREADPRIVATE(qbs_seri)
18      REAL, SAVE, ALLOCATABLE :: u_seri(:,:), v_seri(:,:)
19      !$OMP THREADPRIVATE(u_seri, v_seri)
20      REAL, SAVE, ALLOCATABLE :: rneb_seri(:,:)
21      !$OMP THREADPRIVATE(rneb_seri)
22      REAL, SAVE, ALLOCATABLE :: d_rneb_dyn(:,:)
23      !$OMP THREADPRIVATE(d_rneb_dyn)
24      REAL, SAVE, ALLOCATABLE :: l_mixmin(:,:,:),l_mix(:,:,:),tke_dissip(:,:,:),wprime(:,:,:)
25      !$OMP THREADPRIVATE(l_mixmin, l_mix, tke_dissip,wprime)
26      REAL, SAVE, ALLOCATABLE :: tr_seri(:,:,:)
27      !$OMP THREADPRIVATE(tr_seri)
28      REAL, SAVE, ALLOCATABLE :: rhcl(:,:)
29      !$OMP THREADPRIVATE(rhcl)
30      REAL, SAVE, ALLOCATABLE :: d_t_dyn(:,:), d_q_dyn(:,:)
31      !$OMP THREADPRIVATE(d_t_dyn, d_q_dyn)
32      REAL, SAVE, ALLOCATABLE :: d_ql_dyn(:,:), d_qs_dyn(:,:), d_qbs_dyn(:,:)
33      !$OMP THREADPRIVATE(d_ql_dyn, d_qs_dyn, d_qbs_dyn)
34      REAL, SAVE, ALLOCATABLE :: d_q_dyn2d(:), d_ql_dyn2d(:), d_qs_dyn2d(:), d_qbs_dyn2d(:)
35      !$OMP THREADPRIVATE(d_q_dyn2d, d_ql_dyn2d, d_qs_dyn2d, d_qbs_dyn2d)
36      REAL, SAVE, ALLOCATABLE :: d_u_dyn(:,:), d_v_dyn(:,:)
37      !$OMP THREADPRIVATE(d_u_dyn, d_v_dyn)
38      REAL, SAVE, ALLOCATABLE :: d_tr_dyn(:,:,:)
39      !$OMP THREADPRIVATE(d_tr_dyn)
40      REAL, SAVE, ALLOCATABLE :: d_t_con(:,:),d_q_con(:,:)
41      !$OMP THREADPRIVATE(d_t_con,d_q_con)
42      REAL, SAVE, ALLOCATABLE :: d_u_con(:,:),d_v_con(:,:)
43      !$OMP THREADPRIVATE(d_u_con,d_v_con)
44      REAL, SAVE, ALLOCATABLE :: d_t_wake(:,:),d_q_wake(:,:)
45      !$OMP THREADPRIVATE( d_t_wake,d_q_wake)
46      REAL, SAVE, ALLOCATABLE :: d_t_lsc(:,:),d_q_lsc(:,:),d_ql_lsc(:,:),d_qi_lsc(:,:)
47      !$OMP THREADPRIVATE(d_t_lsc,d_q_lsc,d_ql_lsc,d_qi_lsc)
48      REAL, SAVE, ALLOCATABLE :: d_t_lwr(:,:),d_t_lw0(:,:),d_t_swr(:,:),d_t_sw0(:,:)
49      !$OMP THREADPRIVATE(d_t_lwr,d_t_lw0,d_t_swr,d_t_sw0)
50      REAL, SAVE, ALLOCATABLE :: d_t_ajsb(:,:), d_q_ajsb(:,:)
51      !$OMP THREADPRIVATE(d_t_ajsb, d_q_ajsb)
52      REAL, SAVE, ALLOCATABLE :: d_t_ajs(:,:), d_q_ajs(:,:)
53      !$OMP THREADPRIVATE(d_t_ajs, d_q_ajs)
54      REAL, SAVE, ALLOCATABLE :: d_u_ajs(:,:), d_v_ajs(:,:)
55      !$OMP THREADPRIVATE(d_u_ajs, d_v_ajs)
56!nrlmd<
57      REAL, SAVE, ALLOCATABLE :: d_t_ajs_w(:,:), d_q_ajs_w(:,:)
58      !$OMP THREADPRIVATE(d_t_ajs_w, d_q_ajs_w)
59      REAL, SAVE, ALLOCATABLE :: d_t_ajs_x(:,:), d_q_ajs_x(:,:)
60      !$OMP THREADPRIVATE(d_t_ajs_x, d_q_ajs_x)
61!>nrlmd
62      REAL, SAVE, ALLOCATABLE :: d_t_eva(:,:),d_q_eva(:,:),d_ql_eva(:,:),d_qi_eva(:,:)
63      !$OMP THREADPRIVATE(d_t_eva,d_q_eva,d_ql_eva,d_qi_eva)
64      REAL, SAVE, ALLOCATABLE :: d_t_lscst(:,:),d_q_lscst(:,:)
65      !$OMP THREADPRIVATE(d_t_lscst,d_q_lscst)
66      REAL, SAVE, ALLOCATABLE :: d_t_lscth(:,:),d_q_lscth(:,:)
67      !$OMP THREADPRIVATE(d_t_lscth,d_q_lscth)
68      REAL, SAVE, ALLOCATABLE :: plul_th(:),plul_st(:)
69      !$OMP THREADPRIVATE(plul_th,plul_st)
70!tendances dues a oro et lif
71      REAL, SAVE, ALLOCATABLE :: d_t_oli(:,:)
72      !$OMP THREADPRIVATE(d_t_oli)
73      REAL, SAVE, ALLOCATABLE :: d_u_oli(:,:), d_v_oli(:,:)
74      !$OMP THREADPRIVATE(d_u_oli, d_v_oli)
75      REAL, SAVE, ALLOCATABLE :: d_t_vdf(:,:), d_q_vdf(:,:), d_qbs_vdf(:,:), d_t_diss(:,:)
76      !$OMP THREADPRIVATE( d_t_vdf, d_q_vdf, d_qbs_vdf, d_t_diss)
77      REAL, SAVE, ALLOCATABLE :: d_u_vdf(:,:), d_v_vdf(:,:)
78      !$OMP THREADPRIVATE(d_u_vdf, d_v_vdf)
79!nrlmd+jyg<
80      REAL, SAVE, ALLOCATABLE :: d_t_vdf_w(:,:), d_q_vdf_w(:,:)
81      !$OMP THREADPRIVATE( d_t_vdf_w, d_q_vdf_w)
82      REAL, SAVE, ALLOCATABLE :: d_t_vdf_x(:,:), d_q_vdf_x(:,:)
83      !$OMP THREADPRIVATE( d_t_vdf_x, d_q_vdf_x)
84      REAL, SAVE, ALLOCATABLE :: d_t_bs(:,:), d_q_bs(:,:), d_qbs_bs(:,:)
85      !$OMP THREADPRIVATE( d_t_bs,d_q_bs, d_qbs_bs)
86!>nrlmd+jyg
87      REAL, SAVE, ALLOCATABLE :: d_t_oro(:,:)
88      !$OMP THREADPRIVATE(d_t_oro)
89      REAL, SAVE, ALLOCATABLE :: d_u_oro(:,:), d_v_oro(:,:)
90      !$OMP THREADPRIVATE(d_u_oro, d_v_oro)
91      REAL, SAVE, ALLOCATABLE :: d_t_oro_gw(:,:)
92      !$OMP THREADPRIVATE(d_t_oro_gw)
93      REAL, SAVE, ALLOCATABLE :: d_u_oro_gw(:,:), d_v_oro_gw(:,:)
94      !$OMP THREADPRIVATE(d_u_oro_gw, d_v_oro_gw)
95      REAL, SAVE, ALLOCATABLE :: d_t_lif(:,:)
96      !$OMP THREADPRIVATE(d_t_lif)
97      REAL, SAVE, ALLOCATABLE :: d_u_lif(:,:), d_v_lif(:,:)
98      !$OMP THREADPRIVATE(d_u_lif, d_v_lif)
99! Tendances Ondes de G non oro (runs strato).
100      REAL, SAVE, ALLOCATABLE :: du_gwd_hines(:,:)
101      !$OMP THREADPRIVATE(du_gwd_hines)
102      REAL, SAVE, ALLOCATABLE :: dv_gwd_hines(:,:)
103      !$OMP THREADPRIVATE(dv_gwd_hines)
104      REAL, SAVE, ALLOCATABLE :: dv_gwd_rando(:,:)
105      !$OMP THREADPRIVATE(dv_gwd_rando)
106      REAL, SAVE, ALLOCATABLE :: dv_gwd_front(:,:)
107      !$OMP THREADPRIVATE(dv_gwd_front)
108      REAL, SAVE, ALLOCATABLE :: east_gwstress(:,:)
109      !$OMP THREADPRIVATE(east_gwstress)
110      REAL, SAVE, ALLOCATABLE :: west_gwstress(:,:)
111      !$OMP THREADPRIVATE(west_gwstress)
112      REAL, SAVE, ALLOCATABLE :: d_t_hin(:,:)
113      !$OMP THREADPRIVATE(d_t_hin)
114! tendance due a l'oxydation du methane
115      REAL, SAVE, ALLOCATABLE :: d_q_ch4(:,:)
116      !$OMP THREADPRIVATE(d_q_ch4)
117
118! tendance du a la conersion Ec -> E thermique
119      REAL, SAVE, ALLOCATABLE :: d_t_ec(:,:)
120      !$OMP THREADPRIVATE(d_t_ec)
121      REAL, SAVE, ALLOCATABLE :: d_ts(:,:), d_tr(:,:,:)
122      !$OMP THREADPRIVATE(d_ts, d_tr)
123
124! aerosols
125      REAL, SAVE, ALLOCATABLE :: m_allaer (:,:,:)
126      !$OMP THREADPRIVATE(m_allaer)
127! diagnostique pour le rayonnement
128      REAL, SAVE, ALLOCATABLE :: topswad_aero(:),  solswad_aero(:)      ! diag
129      !$OMP THREADPRIVATE(topswad_aero,solswad_aero)
130      REAL, SAVE, ALLOCATABLE :: topswai_aero(:),  solswai_aero(:)      ! diag
131      !$OMP THREADPRIVATE(topswai_aero,solswai_aero)
132      REAL, SAVE, ALLOCATABLE :: topswad0_aero(:), solswad0_aero(:)     ! diag
133      !$OMP THREADPRIVATE(topswad0_aero,solswad0_aero)
134      REAL, SAVE, ALLOCATABLE :: topsw_aero(:,:),  solsw_aero(:,:)      ! diag
135      !$OMP THREADPRIVATE(topsw_aero,solsw_aero)
136      REAL, SAVE, ALLOCATABLE :: topsw0_aero(:,:), solsw0_aero(:,:)     ! diag
137      !$OMP THREADPRIVATE(topsw0_aero,solsw0_aero)
138      REAL, SAVE, ALLOCATABLE :: topswcf_aero(:,:),  solswcf_aero(:,:)  ! diag
139      !$OMP THREADPRIVATE(topswcf_aero,solswcf_aero)
140! LW radiation diagnostics CK
141      REAL, SAVE, ALLOCATABLE :: toplwad_aero(:),  sollwad_aero(:)      ! diag
142      !$OMP THREADPRIVATE(toplwad_aero,sollwad_aero)
143      REAL, SAVE, ALLOCATABLE :: toplwai_aero(:),  sollwai_aero(:)      ! diag
144      !$OMP THREADPRIVATE(toplwai_aero,sollwai_aero)
145      REAL, SAVE, ALLOCATABLE :: toplwad0_aero(:), sollwad0_aero(:)     ! diag
146      !$OMP THREADPRIVATE(toplwad0_aero,sollwad0_aero)
147! Special RRTM
148      REAL, SAVE, ALLOCATABLE :: ZLWFT0_i(:,:),  ZSWFT0_i(:,:)      ! diag
149      !$OMP THREADPRIVATE(ZLWFT0_i,ZSWFT0_i)
150      REAL, SAVE, ALLOCATABLE :: ZFLDN0(:,:),  ZFLUP0(:,:)      ! diag
151      !$OMP THREADPRIVATE(ZFLDN0,ZFLUP0)
152      REAL, SAVE, ALLOCATABLE :: ZFSDN0(:,:),  ZFSUP0(:,:)      ! diag
153      !$OMP THREADPRIVATE(ZFSDN0,ZFSUP0)
154!
155      REAL, SAVE, ALLOCATABLE :: stratomask(:,:)
156      !$OMP THREADPRIVATE(stratomask)
157      REAL, SAVE, ALLOCATABLE :: tausum_aero(:,:,:)
158      !$OMP THREADPRIVATE(tausum_aero)
159      REAL, SAVE, ALLOCATABLE :: drytausum_aero(:,:)
160      !$OMP THREADPRIVATE(drytausum_aero)
161      REAL, SAVE, ALLOCATABLE :: tau3d_aero(:,:,:,:)
162      !$OMP THREADPRIVATE(tau3d_aero)
163      REAL, SAVE, ALLOCATABLE :: scdnc(:,:)
164      !$OMP THREADPRIVATE(scdnc)
165      REAL, SAVE, ALLOCATABLE :: dNovrN(:)
166      !$OMP THREADPRIVATE(dNovrN)
167      REAL, SAVE, ALLOCATABLE :: cldncl(:)
168      !$OMP THREADPRIVATE(cldncl)
169      REAL, SAVE, ALLOCATABLE :: reffclwtop(:)
170      !$OMP THREADPRIVATE(reffclwtop)
171      REAL, SAVE, ALLOCATABLE :: lcc(:)
172      !$OMP THREADPRIVATE(lcc)
173      REAL, SAVE, ALLOCATABLE :: reffclws(:,:)
174      !$OMP THREADPRIVATE(reffclws)
175      REAL, SAVE, ALLOCATABLE :: reffclwc(:,:)
176      !$OMP THREADPRIVATE(reffclwc)
177      REAL, SAVE, ALLOCATABLE :: cldnvi(:)
178      !$OMP THREADPRIVATE(cldnvi)
179      REAL, SAVE, ALLOCATABLE :: lcc3d(:,:)
180      !$OMP THREADPRIVATE(lcc3d)
181      REAL, SAVE, ALLOCATABLE :: lcc3dcon(:,:)
182      !$OMP THREADPRIVATE(lcc3dcon)
183      REAL, SAVE, ALLOCATABLE :: lcc3dstra(:,:)
184      !$OMP THREADPRIVATE(lcc3dstra)
185      REAL, SAVE, ALLOCATABLE :: icc3dcon(:,:)
186      !$OMP THREADPRIVATE(icc3dcon)
187      REAL, SAVE, ALLOCATABLE :: icc3dstra(:,:)
188      !$OMP THREADPRIVATE(icc3dstra)
189      REAL, SAVE, ALLOCATABLE :: zfice(:,:)
190      !$OMP THREADPRIVATE(zfice)
191      REAL, SAVE, ALLOCATABLE :: od443aer(:)
192      !$OMP THREADPRIVATE(od443aer)
193      REAL, SAVE, ALLOCATABLE :: od550aer(:)
194      !$OMP THREADPRIVATE(od550aer)
195      REAL, SAVE, ALLOCATABLE :: dryod550aer(:)
196      !$OMP THREADPRIVATE(dryod550aer)
197      REAL, SAVE, ALLOCATABLE :: abs550aer(:)
198      !$OMP THREADPRIVATE(abs550aer)
199      REAL, SAVE, ALLOCATABLE :: od865aer(:)
200      !$OMP THREADPRIVATE(od865aer)
201      REAL, SAVE, ALLOCATABLE :: ec550aer(:,:)
202      !$OMP THREADPRIVATE(ec550aer)
203      REAL, SAVE, ALLOCATABLE :: od550lt1aer(:)
204      !$OMP THREADPRIVATE(od550lt1aer)
205      REAL, SAVE, ALLOCATABLE :: sconcso4(:)
206      !$OMP THREADPRIVATE(sconcso4)
207      REAL, SAVE, ALLOCATABLE :: sconcno3(:)
208      !$OMP THREADPRIVATE(sconcno3)
209      REAL, SAVE, ALLOCATABLE :: sconcoa(:)
210      !$OMP THREADPRIVATE(sconcoa)
211      REAL, SAVE, ALLOCATABLE :: sconcbc(:)
212      !$OMP THREADPRIVATE(sconcbc)
213      REAL, SAVE, ALLOCATABLE :: sconcss(:)
214      !$OMP THREADPRIVATE(sconcss)
215      REAL, SAVE, ALLOCATABLE :: sconcdust(:)
216      !$OMP THREADPRIVATE(sconcdust)
217      REAL, SAVE, ALLOCATABLE :: concso4(:,:)
218      !$OMP THREADPRIVATE(concso4)
219      REAL, SAVE, ALLOCATABLE :: concno3(:,:)
220      !$OMP THREADPRIVATE(concno3)
221      REAL, SAVE, ALLOCATABLE :: concoa(:,:)
222      !$OMP THREADPRIVATE(concoa)
223      REAL, SAVE, ALLOCATABLE :: concbc(:,:)
224      !$OMP THREADPRIVATE(concbc)
225      REAL, SAVE, ALLOCATABLE :: concss(:,:)
226      !$OMP THREADPRIVATE(concss)
227      REAL, SAVE, ALLOCATABLE :: concdust(:,:)
228      !$OMP THREADPRIVATE(concdust)
229      REAL, SAVE, ALLOCATABLE :: loadso4(:)
230      !$OMP THREADPRIVATE(loadso4)
231      REAL, SAVE, ALLOCATABLE :: loadoa(:)
232      !$OMP THREADPRIVATE(loadoa)
233      REAL, SAVE, ALLOCATABLE :: loadbc(:)
234      !$OMP THREADPRIVATE(loadbc)
235      REAL, SAVE, ALLOCATABLE :: loadss(:)
236      !$OMP THREADPRIVATE(loadss)
237      REAL, SAVE, ALLOCATABLE :: loaddust(:)
238      !$OMP THREADPRIVATE(loaddust)
239      REAL, SAVE, ALLOCATABLE :: loadno3(:)
240      !$OMP THREADPRIVATE(loadno3)
241      REAL, SAVE, ALLOCATABLE :: load_tmp1(:), load_tmp2(:)
242      !$OMP THREADPRIVATE(load_tmp1, load_tmp2)
243      REAL, SAVE, ALLOCATABLE :: load_tmp3(:), load_tmp4(:)
244      !$OMP THREADPRIVATE(load_tmp3, load_tmp4)
245      REAL, SAVE, ALLOCATABLE :: load_tmp5(:), load_tmp6(:)
246      !$OMP THREADPRIVATE(load_tmp5, load_tmp6)
247      REAL, SAVE, ALLOCATABLE :: load_tmp7(:), load_tmp8(:)
248      !$OMP THREADPRIVATE(load_tmp7, load_tmp8)
249      REAL, SAVE, ALLOCATABLE :: load_tmp9(:), load_tmp10(:)
250      !$OMP THREADPRIVATE(load_tmp9, load_tmp10)
251
252!IM ajout variables CFMIP2/CMIP5
253      REAL,ALLOCATABLE,SAVE :: topswad_aerop(:), solswad_aerop(:)
254!$OMP THREADPRIVATE(topswad_aerop, solswad_aerop)
255      REAL,ALLOCATABLE,SAVE :: topswai_aerop(:), solswai_aerop(:)
256!$OMP THREADPRIVATE(topswai_aerop, solswai_aerop)
257      REAL,ALLOCATABLE,SAVE :: topswad0_aerop(:), solswad0_aerop(:)
258!$OMP THREADPRIVATE(topswad0_aerop, solswad0_aerop)
259      REAL,ALLOCATABLE,SAVE :: topsw_aerop(:,:), topsw0_aerop(:,:) 
260!$OMP THREADPRIVATE(topsw_aerop, topsw0_aerop)
261      REAL,ALLOCATABLE,SAVE :: solsw_aerop(:,:), solsw0_aerop(:,:)
262!$OMP THREADPRIVATE(solsw_aerop, solsw0_aerop)
263      REAL,ALLOCATABLE,SAVE :: topswcf_aerop(:,:), solswcf_aerop(:,:)
264!$OMP THREADPRIVATE(topswcf_aerop, solswcf_aerop)
265
266! additional LW variables CK
267      REAL,ALLOCATABLE,SAVE :: toplwad_aerop(:), sollwad_aerop(:)
268!$OMP THREADPRIVATE(toplwad_aerop, sollwad_aerop)
269      REAL,ALLOCATABLE,SAVE :: toplwai_aerop(:), sollwai_aerop(:)
270!$OMP THREADPRIVATE(toplwai_aerop, sollwai_aerop)
271      REAL,ALLOCATABLE,SAVE :: toplwad0_aerop(:), sollwad0_aerop(:)
272!$OMP THREADPRIVATE(toplwad0_aerop, sollwad0_aerop)
273
274!AI 08 2023 ajout pour Ecrad
275      REAL,ALLOCATABLE,SAVE :: topswad_aero_s2(:), solswad_aero_s2(:)
276!$OMP THREADPRIVATE(topswad_aero_s2, solswad_aero_s2)
277      REAL,ALLOCATABLE,SAVE :: topswai_aero_s2(:), solswai_aero_s2(:)
278!$OMP THREADPRIVATE(topswai_aero_s2, solswai_aero_s2)
279      REAL,ALLOCATABLE,SAVE :: topswad0_aero_s2(:), solswad0_aero_s2(:)
280!$OMP THREADPRIVATE(topswad0_aero_s2, solswad0_aero_s2)
281      REAL,ALLOCATABLE,SAVE :: topsw_aero_s2(:,:), topsw0_aero_s2(:,:)
282!$OMP THREADPRIVATE(topsw_aero_s2, topsw0_aero_s2)
283      REAL,ALLOCATABLE,SAVE :: solsw_aero_s2(:,:), solsw0_aero_s2(:,:)
284!$OMP THREADPRIVATE(solsw_aero_s2, solsw0_aero_s2)
285      REAL,ALLOCATABLE,SAVE :: topswcf_aero_s2(:,:), solswcf_aero_s2(:,:)
286!$OMP THREADPRIVATE(topswcf_aero_s2, solswcf_aero_s2)
287! additional LW variables CK
288      REAL,ALLOCATABLE,SAVE :: toplwad_aero_s2(:), sollwad_aero_s2(:)
289!$OMP THREADPRIVATE(toplwad_aero_s2, sollwad_aero_s2)
290      REAL,ALLOCATABLE,SAVE :: toplwai_aero_s2(:), sollwai_aero_s2(:)
291!$OMP THREADPRIVATE(toplwai_aero_s2, sollwai_aero_s2)
292      REAL,ALLOCATABLE,SAVE :: toplwad0_aero_s2(:), sollwad0_aero_s2(:)
293!$OMP THREADPRIVATE(toplwad0_aero_s2, sollwad0_aero_s2)
294
295!Ajout de celles n??cessaires au phys_output_write_mod
296      REAL, SAVE, ALLOCATABLE :: tal1(:), pal1(:), pab1(:), pab2(:)
297!$OMP THREADPRIVATE(tal1, pal1, pab1, pab2)
298      REAL, SAVE, ALLOCATABLE :: ptstar(:), pt0(:), slp(:)
299!$OMP THREADPRIVATE(ptstar, pt0, slp)
300      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: sens, flwp, fiwp
301!$OMP THREADPRIVATE(sens, flwp, fiwp)
302!!
303!FC
304      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: zxfluxt, zxfluxq
305!$OMP THREADPRIVATE(zxfluxt, zxfluxq)
306!FC
307!!         Wake variables
308      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: alp_wake
309!$OMP THREADPRIVATE(alp_wake)           
310!!jyg!      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: wake_h,wake_k
311      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: wake_h
312      INTEGER,ALLOCATABLE,SAVE,DIMENSION(:)         :: wake_k
313!$OMP THREADPRIVATE(wake_h,wake_k)                       
314    REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)            :: wake_omg
315!$OMP THREADPRIVATE(wake_omg)                     
316    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_wk, d_deltaq_wk
317!$OMP THREADPRIVATE(d_deltat_wk, d_deltaq_wk)
318      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: d_s_wk, d_dens_a_wk, d_dens_wk
319!$OMP THREADPRIVATE(d_s_wk, d_dens_a_wk, d_dens_wk)
320    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_wk_gw, d_deltaq_wk_gw
321!$OMP THREADPRIVATE(d_deltat_wk_gw, d_deltaq_wk_gw)
322    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_vdf, d_deltaq_vdf
323!$OMP THREADPRIVATE(d_deltat_vdf, d_deltaq_vdf)
324!!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:)          :: d_s_vdf, d_dens_vdf
325!!!OMP THREADPRIVATE(d_s_vdf, d_dens_vdf)
326    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_the, d_deltaq_the
327!$OMP THREADPRIVATE(d_deltat_the, d_deltaq_the)
328!!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:)          :: d_s_the, d_dens_the
329!!!OMP THREADPRIVATE(d_s_the, d_dens_the)
330      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)           :: d_deltat_ajs_cv, d_deltaq_ajs_cv
331!$OMP THREADPRIVATE(d_deltat_ajs_cv, d_deltaq_ajs_cv)                       
332!!         End of Wake variables
333!!
334      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: bils
335!$OMP THREADPRIVATE(bils)
336      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cdragm, cdragh
337!$OMP THREADPRIVATE(cdragm, cdragh)
338      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cldh, cldl, cldm, cldq, cldt, qsat2m
339!$OMP THREADPRIVATE(cldh, cldl, cldm, cldq, cldt, qsat2m )
340!AS: cldhjn, cldljn, cldmjn,cldtjn pas utilisés en tant que variables, juste noms de diagnostics
341      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: JrNt
342!$OMP THREADPRIVATE(JrNt)
343      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: dthmin, evap, snowerosion, fder, plcl, plfc, prw, prlw, prsw, prbsw
344!$OMP THREADPRIVATE(dthmin, evap, snowerosion, fder, plcl, plfc, prw, prlw, prsw, prbsw)
345      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zustar, zu10m, zv10m, rh2m
346!$OMP THREADPRIVATE(zustar, zu10m, zv10m, rh2m)
347      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: s_lcl, s_pblh, s_pblt, s_therm
348!$OMP THREADPRIVATE(s_lcl, s_pblh, s_pblt, s_therm)
349!
350!nrlmd+jyg<
351      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: s_pblh_x, s_pblh_w
352!$OMP THREADPRIVATE(s_pblh_x, s_pblh_w)
353      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: s_lcl_x, s_lcl_w
354!$OMP THREADPRIVATE(s_lcl_x, s_lcl_w)
355!>nrlmd+jyg
356!
357      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: slab_wfbils
358!$OMP THREADPRIVATE(slab_wfbils)
359      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: tpot, tpote, ue, uq, uwat, ve, vq, vwat, zxffonte
360!$OMP THREADPRIVATE(tpot, tpote, ue, uq, uwat, ve, vq, vwat, zxffonte)
361      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxustartlic, zxrhoslic
362!$OMP THREADPRIVATE(zxustartlic, zxrhoslic)
363      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxfqcalving
364!$OMP THREADPRIVATE(zxfqcalving)
365      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxfluxlat, zxtsol, snow_lsc, zxfqfonte
366!$OMP THREADPRIVATE(zxfluxlat, zxtsol, snow_lsc, zxfqfonte)
367      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxrunofflic
368!$OMP THREADPRIVATE(zxrunofflic)
369      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxqsurf, rain_lsc, rain_num
370!$OMP THREADPRIVATE(zxqsurf, rain_lsc, rain_num)
371!
372!jyg+nrlmd<
373!!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
374!                                                                          c
375!       Declarations liees a la couche limite differentiee w-x             c
376!                                                                          c
377!!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
378      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: sens_x, sens_w
379!$OMP THREADPRIVATE(sens_x, sens_w)
380      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxfluxlat_x, zxfluxlat_w
381!$OMP THREADPRIVATE(zxfluxlat_x, zxfluxlat_w)
382      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: delta_qsurf
383!$OMP THREADPRIVATE(delta_qsurf)
384!jyg<
385!!! Entrees supplementaires couche-limite
386!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: t_x, t_w
387!!!$OMP THREADPRIVATE(t_x, t_w)
388!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: q_x, q_w
389!!!$OMP THREADPRIVATE(q_x, q_w)
390!>jyg
391!!! Sorties ferret
392      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dtvdf_x, dtvdf_w
393!$OMP THREADPRIVATE(dtvdf_x, dtvdf_w)
394      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dqvdf_x, dqvdf_w
395!$OMP THREADPRIVATE(dqvdf_x, dqvdf_w)
396! Variables supplementaires dans physiq.F relative au splitting de la surface
397      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: pbl_tke_input
398!$OMP THREADPRIVATE(pbl_tke_input)
399! Entree supplementaire Thermiques :
400      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: t_therm, q_therm, u_therm, v_therm
401!$OMP THREADPRIVATE(t_therm, q_therm, u_therm, v_therm)
402      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cdragh_x, cdragh_w
403!$OMP THREADPRIVATE(cdragh_x, cdragh_w)
404      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cdragm_x, cdragm_w
405!$OMP THREADPRIVATE(cdragm_x, cdragm_w)
406      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: kh, kh_x, kh_w
407!$OMP THREADPRIVATE(kh, kh_x, kh_w)
408!!!
409!!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
410      LOGICAL, SAVE, ALLOCATABLE :: ptconv(:,:)
411      !$OMP THREADPRIVATE(ptconv)
412      REAL, SAVE, ALLOCATABLE :: ratqsc(:,:)
413      !$OMP THREADPRIVATE(ratqsc)
414!>jyg+nrlmd
415  !
416      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: wbeff, convoccur, zmax_th, zq2m, zt2m
417!$OMP THREADPRIVATE(wbeff, convoccur, zmax_th, zq2m, zt2m)
418      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zt2m_min_mon, zt2m_max_mon
419!$OMP THREADPRIVATE(zt2m_min_mon, zt2m_max_mon)
420      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: t2m_min_mon, t2m_max_mon
421!$OMP THREADPRIVATE(t2m_min_mon, t2m_max_mon)
422      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: weak_inversion
423!$OMP THREADPRIVATE(weak_inversion)
424      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: alp_bl_conv,alp_bl_det
425!$OMP THREADPRIVATE(alp_bl_conv,alp_bl_det)
426      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: alp_bl_fluct_m,alp_bl_fluct_tke
427!$OMP THREADPRIVATE(alp_bl_fluct_m,alp_bl_fluct_tke)
428      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: alp_bl_stat, n2, s2
429!$OMP THREADPRIVATE(alp_bl_stat, n2, s2)
430      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: proba_notrig, random_notrig
431!$OMP THREADPRIVATE(proba_notrig, random_notrig)
432      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: fsolsw, wfbils, wfbilo
433!$OMP THREADPRIVATE(fsolsw, wfbils, wfbilo)
434      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: wfevap, wfrain, wfsnow
435!$OMP THREADPRIVATE(wfevap,wfrain,wfsnow)
436      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: t2m, fluxlat, fsollw,evap_pot
437!$OMP THREADPRIVATE(t2m, fluxlat, fsollw,evap_pot)
438      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dnwd0, omega
439!$OMP THREADPRIVATE(dnwd0, omega)
440      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: epmax_diag ! epmax_cape
441!$OMP THREADPRIVATE(epmax_diag)
442!
443!  Deep convective variables used in phytrac
444      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: ep ! epmax_cape
445!$OMP THREADPRIVATE(ep)
446      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: dnwd, upwd
447!$OMP THREADPRIVATE(dnwd, upwd)
448      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: pmflxr, pmflxs
449!$OMP THREADPRIVATE(pmflxr, pmflxs)
450      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: wdtrainA, wdtrainS, wdtrainM
451!$OMP THREADPRIVATE(wdtrainA, wdtrainS, wdtrainM)
452      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: da, mp
453!$OMP THREADPRIVATE(da, mp)
454      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: wght_cvfd
455!$OMP THREADPRIVATE(wght_cvfd)
456      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:):: phi, phi2, elij, epmlmMm
457!$OMP THREADPRIVATE(phi, phi2, elij, epmlmMm)
458      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: d1a, dam
459!$OMP THREADPRIVATE(d1a, dam)
460      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: ev
461!$OMP THREADPRIVATE(ev)
462      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: qtaa
463!$OMP THREADPRIVATE(qtaa)
464      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: clw
465!$OMP THREADPRIVATE(clw)
466      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: eplaMm
467!$OMP THREADPRIVATE(eplaMm)
468      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:):: sij
469!$OMP THREADPRIVATE(sij)
470!
471!      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: coefh, coefm, lambda_th
472      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: lambda_th
473!$OMP THREADPRIVATE(lambda_th)
474      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: cldemi, cldfra, cldtau, fiwc, fl, re, flwc
475!$OMP THREADPRIVATE(cldemi, cldfra, cldtau, fiwc, fl, re, flwc)
476      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: qlth, qith, qsith, wiceth
477!$OMP THREADPRIVATE(qlth, qith, qsith, wiceth)
478      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: ref_liq, ref_ice, theta, zphi
479!$OMP THREADPRIVATE(ref_liq, ref_ice, theta, zphi)
480      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: ref_liq_pi, ref_ice_pi
481!$OMP THREADPRIVATE(ref_liq_pi, ref_ice_pi)
482      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: zx_rh, zx_rhl, zx_rhi
483!$OMP THREADPRIVATE(zx_rh, zx_rhl, zx_rhi)
484      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: prfl, psfl, fraca, bsfl
485!$OMP THREADPRIVATE(prfl, psfl, fraca, bsfl)
486      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: Vprecip, zw2
487!$OMP THREADPRIVATE(Vprecip, zw2)
488      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: pmfd, pmfu
489!$OMP THREADPRIVATE(pmfd, pmfu)
490      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: fluxt, fluxu, fluxv
491!$OMP THREADPRIVATE(fluxt, fluxu, fluxv)
492      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: uwriteSTD, vwriteSTD, wwriteSTD
493!$OMP THREADPRIVATE(uwriteSTD, vwriteSTD, wwriteSTD)
494      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: phiwriteSTD, qwriteSTD, twriteSTD, rhwriteSTD
495!$OMP THREADPRIVATE(phiwriteSTD, qwriteSTD, twriteSTD, rhwriteSTD)
496
497
498! ug et d'autres encore:
499      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: beta_prec
500!$OMP THREADPRIVATE(beta_prec)
501      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: rneb,rnebjn,rneblsvol
502!$OMP THREADPRIVATE(rneb,rnebjn,rneblsvol)
503      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: pfraclr,pfracld
504!$OMP THREADPRIVATE(pfraclr,pfracld)
505
506! variables de sorties MM
507      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: zxsnow,snowhgt,qsnow,to_ice
508      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: sissnow,runoff,albsol3_lic
509!$OMP THREADPRIVATE(zxsnow,snowhgt,qsnow,to_ice)
510!$OMP THREADPRIVATE(sissnow,runoff,albsol3_lic)
511
512      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: p_tropopause, z_tropopause, t_tropopause
513!$OMP THREADPRIVATE(p_tropopause, z_tropopause, t_tropopause)
514
515      INTEGER,ALLOCATABLE,SAVE,DIMENSION(:,:) :: zn2mout
516!$OMP THREADPRIVATE(zn2mout)
517
518      REAL, SAVE, ALLOCATABLE :: qclr(:,:)
519      !$OMP THREADPRIVATE(qclr)
520      REAL, SAVE, ALLOCATABLE :: qcld(:,:)
521      !$OMP THREADPRIVATE(qcld)
522      REAL, SAVE, ALLOCATABLE :: qss(:,:)
523      !$OMP THREADPRIVATE(qss)
524      REAL, SAVE, ALLOCATABLE :: qvc(:,:)
525      !$OMP THREADPRIVATE(qvc)
526      REAL, SAVE, ALLOCATABLE :: rnebclr(:,:)
527      !$OMP THREADPRIVATE(rnebclr)
528      REAL, SAVE, ALLOCATABLE :: rnebss(:,:)
529      !$OMP THREADPRIVATE(rnebss)
530      REAL, SAVE, ALLOCATABLE :: gamma_ss(:,:)
531      !$OMP THREADPRIVATE(gamma_ss)
532      REAL, SAVE, ALLOCATABLE :: N1_ss(:,:)
533      !$OMP THREADPRIVATE(N1_ss)
534      REAL, SAVE, ALLOCATABLE :: N2_ss(:,:)
535      !$OMP THREADPRIVATE(N2_ss)
536      REAL, SAVE, ALLOCATABLE :: drneb_sub(:,:)
537      !$OMP THREADPRIVATE(drneb_sub)
538      REAL, SAVE, ALLOCATABLE :: drneb_con(:,:)
539      !$OMP THREADPRIVATE(drneb_con)
540      REAL, SAVE, ALLOCATABLE :: drneb_tur(:,:)
541      !$OMP THREADPRIVATE(drneb_tur)
542      REAL, SAVE, ALLOCATABLE :: drneb_avi(:,:)
543      !$OMP THREADPRIVATE(drneb_avi)
544      REAL, SAVE, ALLOCATABLE :: zqsatl(:,:)
545      !$OMP THREADPRIVATE(zqsatl)
546      REAL, SAVE, ALLOCATABLE :: zqsats(:,:)
547      !$OMP THREADPRIVATE(zqsats)
548      REAL, SAVE, ALLOCATABLE :: Tcontr(:,:)
549      !$OMP THREADPRIVATE(Tcontr)
550      REAL, SAVE, ALLOCATABLE :: qcontr(:,:)
551      !$OMP THREADPRIVATE(qcontr)
552      REAL, SAVE, ALLOCATABLE :: qcontr2(:,:)
553      !$OMP THREADPRIVATE(qcontr2)
554      REAL, SAVE, ALLOCATABLE :: fcontrN(:,:)
555      !$OMP THREADPRIVATE(fcontrN)
556      REAL, SAVE, ALLOCATABLE :: fcontrP(:,:)
557      !$OMP THREADPRIVATE(fcontrP)
558      REAL, SAVE, ALLOCATABLE :: distcltop(:,:)
559      !$OMP THREADPRIVATE(distcltop)
560      REAL, SAVE, ALLOCATABLE :: temp_cltop(:,:)
561      !$OMP THREADPRIVATE(temp_cltop)
562
563
564#ifdef CPP_StratAer
565!
566! variables for stratospheric aerosol
567      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: d_q_emiss
568!$OMP THREADPRIVATE(d_q_emiss)
569      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: R2SO4
570!$OMP THREADPRIVATE(R2SO4)
571      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: DENSO4
572!$OMP THREADPRIVATE(DENSO4)
573      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: f_r_wet
574!$OMP THREADPRIVATE(f_r_wet)
575      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: decfluxaer
576!$OMP THREADPRIVATE(decfluxaer)
577      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: mdw
578!$OMP THREADPRIVATE(mdw)
579      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: OCS_lifetime
580!$OMP THREADPRIVATE(OCS_lifetime)
581      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: SO2_lifetime
582!$OMP THREADPRIVATE(SO2_lifetime)
583      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: H2SO4_lifetime
584!$OMP THREADPRIVATE(H2SO4_lifetime)
585      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: O3_clim
586!$OMP THREADPRIVATE(O3_clim)
587      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: alpha_bin
588!$OMP THREADPRIVATE(alpha_bin)
589      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: piz_bin
590!$OMP THREADPRIVATE(piz_bin)
591      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: cg_bin
592!$OMP THREADPRIVATE(cg_bin)
593      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tau_strat_550
594!$OMP THREADPRIVATE(tau_strat_550)
595      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tau_strat_1020
596!$OMP THREADPRIVATE(tau_strat_1020)
597      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tausum_strat
598!$OMP THREADPRIVATE(tausum_strat)
599      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: surf_PM25_sulf
600!$OMP THREADPRIVATE(surf_PM25_sulf)
601      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: vsed_aer
602!$OMP THREADPRIVATE(vsed_aer)
603!
604!---3D budget variables
605      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_nucl
606!$OMP THREADPRIVATE(budg_3D_nucl)
607      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_cond_evap
608!$OMP THREADPRIVATE(budg_3D_cond_evap)
609      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_ocs_to_so2
610!$OMP THREADPRIVATE(budg_3D_ocs_to_so2)
611      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_so2_to_h2so4
612!$OMP THREADPRIVATE(budg_3D_so2_to_h2so4)
613      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_backgr_ocs
614!$OMP THREADPRIVATE(budg_3D_backgr_ocs)
615      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_backgr_so2
616!$OMP THREADPRIVATE(budg_3D_backgr_so2)
617!
618!---2D budget variables
619      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_ocs
620      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_so2
621      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_h2so4
622      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_part
623!$OMP THREADPRIVATE(budg_dep_dry_ocs,budg_dep_dry_so2,budg_dep_dry_h2so4,budg_dep_dry_part)
624      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_ocs
625      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_so2
626      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_h2so4
627      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_part
628!$OMP THREADPRIVATE(budg_dep_wet_ocs,budg_dep_wet_so2,budg_dep_wet_h2so4,budg_dep_wet_part)
629      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_ocs
630      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_so2
631      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_h2so4
632      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_part
633!$OMP THREADPRIVATE(budg_emi_ocs,budg_emi_so2,budg_emi_h2so4,budg_emi_part)
634      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_ocs_to_so2
635      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_so2_to_h2so4
636      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_h2so4_to_part
637!$OMP THREADPRIVATE(budg_ocs_to_so2,budg_so2_to_h2so4,budg_h2so4_to_part)
638      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_sed_part
639!$OMP THREADPRIVATE(budg_sed_part)
640#endif
641
642CONTAINS
643
644!======================================================================
645SUBROUTINE phys_local_var_init
646USE dimphy
647USE infotrac_phy, ONLY : nbtr
648USE aero_mod
649USE indice_sol_mod
650USE phys_output_var_mod
651USE phys_state_var_mod
652
653IMPLICIT NONE
654      ALLOCATE(t_seri(klon,klev),q_seri(klon,klev),ql_seri(klon,klev),qs_seri(klon,klev), qbs_seri(klon,klev))
655      ALLOCATE(u_seri(klon,klev),v_seri(klon,klev))
656      ALLOCATE(l_mixmin(klon,klev+1,nbsrf),l_mix(klon,klev+1,nbsrf),tke_dissip(klon,klev+1,nbsrf),wprime(klon,klev+1,nbsrf))
657      l_mix(:,:,:)=0.;l_mixmin(:,:,:)=0.;tke_dissip(:,:,:)=0.;wprime(:,:,:)=0. ! doit etre initialse car pas toujours remplis
658
659      ALLOCATE(rhcl(klon,klev))
660      ALLOCATE(tr_seri(klon,klev,nbtr))
661      ALLOCATE(d_t_dyn(klon,klev),d_q_dyn(klon,klev))
662      ALLOCATE(d_ql_dyn(klon,klev),d_qs_dyn(klon,klev), d_qbs_dyn(klon,klev))
663      ALLOCATE(d_q_dyn2d(klon),d_ql_dyn2d(klon),d_qs_dyn2d(klon), d_qbs_dyn2d(klon))
664      ALLOCATE(d_u_dyn(klon,klev),d_v_dyn(klon,klev))
665      ALLOCATE(d_tr_dyn(klon,klev,nbtr))                   !RomP
666      ALLOCATE(d_t_con(klon,klev),d_q_con(klon,klev))
667      ALLOCATE(d_u_con(klon,klev),d_v_con(klon,klev))
668      ALLOCATE(d_t_wake(klon,klev),d_q_wake(klon,klev))
669      ALLOCATE(d_t_lsc(klon,klev),d_q_lsc(klon,klev))
670      ALLOCATE(d_t_lwr(klon,klev),d_t_lw0(klon,klev))
671      ALLOCATE(d_t_swr(klon,klev),d_t_sw0(klon,klev))
672      ALLOCATE(d_ql_lsc(klon,klev),d_qi_lsc(klon,klev))
673      ALLOCATE(d_t_ajsb(klon,klev),d_q_ajsb(klon,klev))
674      ALLOCATE(d_t_ajs(klon,klev),d_q_ajs(klon,klev))
675!nrlmd<
676      ALLOCATE(d_t_ajs_w(klon,klev),d_q_ajs_w(klon,klev))
677      ALLOCATE(d_t_ajs_x(klon,klev),d_q_ajs_x(klon,klev))
678!>nrlmd
679      ALLOCATE(d_u_ajs(klon,klev),d_v_ajs(klon,klev))
680      ALLOCATE(d_t_eva(klon,klev),d_q_eva(klon,klev))
681      ALLOCATE(d_ql_eva(klon,klev),d_qi_eva(klon,klev))
682      ALLOCATE(d_t_lscst(klon,klev),d_q_lscst(klon,klev))
683      ALLOCATE(d_t_lscth(klon,klev),d_q_lscth(klon,klev))
684      ALLOCATE(plul_st(klon),plul_th(klon))
685      ALLOCATE(d_t_vdf(klon,klev),d_q_vdf(klon,klev),d_t_diss(klon,klev))
686      ALLOCATE (d_qbs_vdf(klon,klev))
687      ALLOCATE(d_t_bs(klon,klev),d_q_bs(klon,klev),d_qbs_bs(klon,klev))
688      ALLOCATE(d_t_vdf_w(klon,klev),d_q_vdf_w(klon,klev))
689      ALLOCATE(d_t_vdf_x(klon,klev),d_q_vdf_x(klon,klev))
690
691      ALLOCATE(d_u_vdf(klon,klev),d_v_vdf(klon,klev))
692      ALLOCATE(d_t_oli(klon,klev),d_t_oro(klon,klev))
693      ALLOCATE(d_u_oli(klon,klev),d_v_oli(klon,klev))
694      ALLOCATE(d_u_oro(klon,klev),d_v_oro(klon,klev))
695      ALLOCATE(d_u_oro_gw(klon,klev),d_v_oro_gw(klon,klev))
696      ALLOCATE(d_t_oro_gw(klon,klev))
697      ALLOCATE(d_t_lif(klon,klev),d_t_ec(klon,klev))
698      ALLOCATE(d_u_lif(klon,klev),d_v_lif(klon,klev))
699      ALLOCATE(d_ts(klon,nbsrf), d_tr(klon,klev,nbtr))
700
701! aerosols
702      ALLOCATE(m_allaer(klon,klev,naero_tot))
703! Special RRTM
704      ALLOCATE(ZLWFT0_i(klon,klev+1),ZSWFT0_i(klon,klev+1),ZFLDN0(klon,klev+1))
705      ZFLDN0= 0.
706      ALLOCATE(ZFLUP0(klon,klev+1),ZFSDN0(klon,klev+1),ZFSUP0(klon,klev+1))
707!
708      ALLOCATE(topswad_aero(klon), solswad_aero(klon))
709      ALLOCATE(topswai_aero(klon), solswai_aero(klon))
710      ALLOCATE(topswad0_aero(klon), solswad0_aero(klon))
711      ALLOCATE(toplwad_aero(klon), sollwad_aero(klon))
712      ALLOCATE(toplwai_aero(klon), sollwai_aero(klon))
713      ALLOCATE(toplwad0_aero(klon), sollwad0_aero(klon))
714      ALLOCATE(topsw_aero(klon,naero_grp), solsw_aero(klon,naero_grp))
715      ALLOCATE(topsw0_aero(klon,naero_grp), solsw0_aero(klon,naero_grp))
716      ALLOCATE(topswcf_aero(klon,3), solswcf_aero(klon,3))
717      ALLOCATE(du_gwd_hines(klon,klev),dv_gwd_hines(klon,klev))
718      ALLOCATE(dv_gwd_rando(klon,klev),dv_gwd_front(klon,klev))
719      ALLOCATE(east_gwstress(klon,klev),west_gwstress(klon,klev))
720      east_gwstress(:,:)=0 !ym missing init
721      west_gwstress(:,:)=0 !ym missing init
722      ALLOCATE(d_t_hin(klon,klev))
723      ALLOCATE(d_q_ch4(klon,klev))
724      ALLOCATE(stratomask(klon,klev))
725      ALLOCATE(tausum_aero(klon,nwave,naero_tot))
726      ALLOCATE(drytausum_aero(klon,naero_tot))
727      ALLOCATE(tau3d_aero(klon,klev,nwave,naero_tot))
728      ALLOCATE(scdnc(klon, klev))
729      ALLOCATE(dNovrN(klon))
730      ALLOCATE(cldncl(klon))
731      ALLOCATE(reffclwtop(klon))
732      ALLOCATE(lcc(klon))
733      ALLOCATE(reffclws(klon, klev))
734      ALLOCATE(reffclwc(klon, klev))
735      ALLOCATE(cldnvi(klon))
736      ALLOCATE(lcc3d(klon, klev))
737      ALLOCATE(lcc3dcon(klon, klev))
738      ALLOCATE(lcc3dstra(klon, klev))
739      ALLOCATE(icc3dcon(klon, klev))
740      ALLOCATE(icc3dstra(klon, klev))
741      ALLOCATE(zfice(klon, klev))
742      ALLOCATE(od443aer(klon))
743      ALLOCATE(od550aer(klon))
744      ALLOCATE(od865aer(klon))
745      ALLOCATE(dryod550aer(klon))
746      dryod550aer(:) = 0.
747      ALLOCATE(abs550aer(klon))
748      abs550aer(:) = 0.
749      ALLOCATE(ec550aer(klon,klev))
750      ALLOCATE(od550lt1aer(klon))
751      ALLOCATE(sconcso4(klon))
752      ALLOCATE(sconcno3(klon))
753      ALLOCATE(sconcoa(klon))
754      ALLOCATE(sconcbc(klon))
755      ALLOCATE(sconcss(klon))
756      ALLOCATE(sconcdust(klon))
757      ALLOCATE(concso4(klon,klev))
758      ALLOCATE(concno3(klon,klev))
759      ALLOCATE(concoa(klon,klev))
760      ALLOCATE(concbc(klon,klev))
761      ALLOCATE(concss(klon,klev))
762      ALLOCATE(concdust(klon,klev))
763      ALLOCATE(loadso4(klon))
764      ALLOCATE(loadoa(klon))
765      ALLOCATE(loadbc(klon))
766      ALLOCATE(loadss(klon))
767      ALLOCATE(loaddust(klon))
768      ALLOCATE(loadno3(klon))
769      ALLOCATE(load_tmp1(klon))
770      ALLOCATE(load_tmp2(klon))
771      ALLOCATE(load_tmp3(klon))
772      ALLOCATE(load_tmp4(klon))
773      ALLOCATE(load_tmp5(klon))
774      ALLOCATE(load_tmp6(klon))
775      ALLOCATE(load_tmp7(klon))
776      ALLOCATE(load_tmp8(klon))
777      ALLOCATE(load_tmp9(klon))
778      ALLOCATE(load_tmp10(klon))
779
780!IM ajout variables CFMIP2/CMIP5
781      ALLOCATE(topswad_aerop(klon), solswad_aerop(klon))
782      ALLOCATE(topswai_aerop(klon), solswai_aerop(klon))
783      ALLOCATE(topswad0_aerop(klon), solswad0_aerop(klon))
784      ALLOCATE(topsw_aerop(klon,naero_grp), topsw0_aerop(klon,naero_grp))
785      ALLOCATE(solsw_aerop(klon,naero_grp), solsw0_aerop(klon,naero_grp))
786      ALLOCATE(topswcf_aerop(klon,naero_grp), solswcf_aerop(klon,naero_grp))
787
788! additional LW variables CK
789      ALLOCATE(toplwad_aerop(klon), sollwad_aerop(klon))
790      ALLOCATE(toplwai_aerop(klon), sollwai_aerop(klon))
791      ALLOCATE(toplwad0_aerop(klon), sollwad0_aerop(klon))
792
793!AI Ajout Ecrad (3Deffect)
794      ALLOCATE(topswad_aero_s2(klon), solswad_aero_s2(klon))
795      ALLOCATE(topswai_aero_s2(klon), solswai_aero_s2(klon))
796      ALLOCATE(topswad0_aero_s2(klon), solswad0_aero_s2(klon))
797      ALLOCATE(topsw_aero_s2(klon,naero_grp), topsw0_aero_s2(klon,naero_grp))
798      ALLOCATE(solsw_aero_s2(klon,naero_grp), solsw0_aero_s2(klon,naero_grp))
799      ALLOCATE(topswcf_aero_s2(klon,naero_grp), solswcf_aero_s2(klon,naero_grp))
800! additional LW variables CK
801      ALLOCATE(toplwad_aero_s2(klon), sollwad_aero_s2(klon))
802      ALLOCATE(toplwai_aero_s2(klon), sollwai_aero_s2(klon))
803      ALLOCATE(toplwad0_aero_s2(klon), sollwad0_aero_s2(klon))
804
805
806! FH Ajout de celles necessaires au phys_output_write_mod
807
808      ALLOCATE(tal1(klon), pal1(klon), pab1(klon), pab2(klon))
809      ALLOCATE(ptstar(klon),pt0(klon),slp(klon))
810!!
811!!          Wake variables
812      ALLOCATE(alp_wake(klon))
813      ALLOCATE(wake_h(klon),wake_k(klon))
814      ALLOCATE(wake_omg(klon, klev))
815      ALLOCATE(d_deltat_wk(klon, klev), d_deltaq_wk(klon, klev))
816      ALLOCATE(d_s_wk(klon), d_dens_a_wk(klon), d_dens_wk(klon))
817      ALLOCATE(d_deltat_wk_gw(klon, klev), d_deltaq_wk_gw(klon, klev))
818      ALLOCATE(d_deltat_vdf(klon, klev), d_deltaq_vdf(klon, klev))
819!!      ALLOCATE( d_s_vdf(klon), d_dens_vdf(klon))
820      ALLOCATE(d_deltat_the(klon, klev), d_deltaq_the(klon, klev))
821!!      ALLOCATE( d_s_the(klon), d_dens_the(klon))
822      ALLOCATE(d_deltat_ajs_cv(klon, klev), d_deltaq_ajs_cv(klon, klev))
823!!         End of wake variables
824!!
825      ALLOCATE(bils(klon))
826      ALLOCATE(cdragm(klon), cdragh(klon), cldh(klon), cldl(klon))
827      ALLOCATE(cldm(klon), cldq(klon), cldt(klon), qsat2m(klon))
828      ALLOCATE(JrNt(klon))
829      ALLOCATE(dthmin(klon), evap(klon), snowerosion(klon), fder(klon), plcl(klon), plfc(klon))
830      ALLOCATE(prw(klon), prlw(klon), prsw(klon), prbsw(klon), zustar(klon), zu10m(klon), zv10m(klon), rh2m(klon))
831      ALLOCATE(s_lcl(klon))
832      ALLOCATE(s_pblh(klon), s_pblt(klon), s_therm(klon))
833!
834!nrlmd+jyg<
835      ALLOCATE(s_pblh_x(klon), s_pblh_w(klon))
836      ALLOCATE(s_lcl_x(klon), s_lcl_w(klon))
837!>nrlmd+jyg
838!
839      ALLOCATE(slab_wfbils(klon), tpot(klon), tpote(klon), ue(klon))
840      ALLOCATE(uq(klon), ve(klon), vq(klon), zxffonte(klon))
841      ALLOCATE(uwat(klon), vwat(klon))
842      ALLOCATE(zxfqcalving(klon), zxfluxlat(klon))
843      ALLOCATE(zxtsol(klon), snow_lsc(klon), zxfqfonte(klon), zxqsurf(klon))
844      ALLOCATE(zxrunofflic(klon))
845      ALLOCATE(zxustartlic(klon), zxrhoslic(klon))
846      zxustartlic(:)=0. ; zxrhoslic(:)=0.
847      ALLOCATE(rain_lsc(klon))
848      ALLOCATE(rain_num(klon))
849      ALLOCATE(qlth(klon,klev), qith(klon,klev), qsith(klon,klev), wiceth(klon,klev))
850      !
851      ALLOCATE(sens_x(klon), sens_w(klon))
852      ALLOCATE(zxfluxlat_x(klon), zxfluxlat_w(klon))
853      ALLOCATE(delta_qsurf(klon))
854!jyg<
855!!      ALLOCATE(t_x(klon,klev), t_w(klon,klev))
856!!      ALLOCATE(q_x(klon,klev), q_w(klon,klev))
857!>jyg
858      ALLOCATE(dtvdf_x(klon,klev), dtvdf_w(klon,klev))
859      dtvdf_x = 0 ; dtvdf_w=0 ;   !ym missing init
860      ALLOCATE(dqvdf_x(klon,klev), dqvdf_w(klon,klev))
861      dqvdf_x = 0 ; dqvdf_w=0 ;   !ym missing init
862      ALLOCATE(pbl_tke_input(klon,klev+1,nbsrf))
863      ALLOCATE(t_therm(klon,klev), q_therm(klon,klev),u_therm(klon,klev), v_therm(klon,klev))
864      ALLOCATE(cdragh_x(klon), cdragh_w(klon))
865      ALLOCATE(cdragm_x(klon), cdragm_w(klon))
866      ALLOCATE(kh(klon), kh_x(klon), kh_w(klon))
867!
868      ALLOCATE(ptconv(klon,klev))
869      ALLOCATE(ratqsc(klon,klev))
870!
871      ALLOCATE(wbeff(klon), convoccur(klon), zmax_th(klon))
872      ALLOCATE(zq2m(klon), zt2m(klon), weak_inversion(klon))
873      ALLOCATE(zt2m_min_mon(klon), zt2m_max_mon(klon))
874      ALLOCATE(t2m_min_mon(klon), t2m_max_mon(klon))
875      ALLOCATE(sens(klon), flwp(klon), fiwp(klon))
876      ALLOCATE(alp_bl_conv(klon), alp_bl_det(klon))
877      alp_bl_conv(:)=0 ;  alp_bl_det(:)=0
878      ALLOCATE(alp_bl_fluct_m(klon), alp_bl_fluct_tke(klon))
879      alp_bl_fluct_m(:)=0 ; alp_bl_fluct_tke(:)= 0.
880      ALLOCATE(alp_bl_stat(klon), n2(klon), s2(klon))
881      alp_bl_stat(:)=0
882      ALLOCATE(proba_notrig(klon), random_notrig(klon))
883
884      ALLOCATE(dnwd0(klon, klev))
885!      ALLOCATE(upwd(klon, klev), omega(klon, klev), coefh(klon, klev))
886      ALLOCATE(omega(klon, klev))
887      ALLOCATE(epmax_diag(klon)) ! epmax_cape
888!      ALLOCATE(coefm(klon, klev), lambda_th(klon, klev), cldemi(klon, klev))
889      ALLOCATE(lambda_th(klon, klev), cldemi(klon, klev))
890      ALLOCATE(cldfra(klon, klev), cldtau(klon, klev), fiwc(klon, klev))
891      ALLOCATE(fl(klon, klev), re(klon, klev), flwc(klon, klev))
892      ALLOCATE(ref_liq(klon, klev), ref_ice(klon, klev), theta(klon, klev))
893      ALLOCATE(ref_liq_pi(klon, klev), ref_ice_pi(klon, klev))
894      ALLOCATE(zphi(klon, klev), zx_rh(klon, klev), zx_rhl(klon,klev), zx_rhi(klon,klev))
895      zx_rhl(:,:)=0.; zx_rhi(:,:)=0. ! because not always defined
896      ALLOCATE(pmfd(klon, klev), pmfu(klon, klev))
897
898      ALLOCATE(t2m(klon, nbsrf), fluxlat(klon, nbsrf))
899      ALLOCATE(fsollw(klon, nbsrf))
900      ALLOCATE(fsolsw(klon, nbsrf), wfbils(klon, nbsrf), wfbilo(klon, nbsrf))
901      ALLOCATE(wfevap(klon, nbsrf), wfrain(klon,nbsrf), wfsnow(klon, nbsrf))
902      ALLOCATE(evap_pot(klon, nbsrf))
903! FC
904      ALLOCATE(zxfluxq(klon,klev),zxfluxt(klon,klev))
905!
906!  Deep convective variables used in phytrac
907      ALLOCATE(pmflxr(klon, klev+1), pmflxs(klon, klev+1))
908      ALLOCATE(wdtrainA(klon,klev),wdtrainS(klon,klev),wdtrainM(klon,klev))
909      ALLOCATE(dnwd(klon, klev), upwd(klon, klev) )
910      ALLOCATE(ep(klon,klev))                          ! epmax_cape
911      ALLOCATE(da(klon,klev), mp(klon,klev) )
912      ALLOCATE(phi(klon,klev,klev) )
913      ALLOCATE(wght_cvfd(klon,klev) )
914      ALLOCATE(phi2(klon,klev,klev) )
915      ALLOCATE(d1a(klon,klev), dam(klon,klev))
916      ALLOCATE(ev(klon,klev) )
917      ALLOCATE(elij(klon,klev,klev) )
918      ALLOCATE(qtaa(klon,klev) )
919      ALLOCATE(clw(klon,klev) )
920      ALLOCATE(epmlmMm(klon,klev,klev), eplaMm(klon,klev) )
921      ALLOCATE(sij(klon,klev,klev) )
922
923      ALLOCATE(prfl(klon, klev+1))
924      ALLOCATE(psfl(klon, klev+1), fraca(klon, klev+1), Vprecip(klon, klev+1))
925      ALLOCATE(bsfl(klon,klev+1))
926      ALLOCATE(zw2(klon, klev+1))
927
928      ALLOCATE(fluxu(klon, klev, nbsrf), fluxv(klon, klev, nbsrf))
929      ALLOCATE(fluxt(klon, klev, nbsrf))
930
931      ALLOCATE(uwriteSTD(klon,nlevSTD,nfiles), vwriteSTD(klon,nlevSTD,nfiles))
932      ALLOCATE(wwriteSTD(klon,nlevSTD,nfiles), phiwriteSTD(klon,nlevSTD,nfiles))
933      ALLOCATE(qwriteSTD(klon,nlevSTD,nfiles), twriteSTD(klon,nlevSTD,nfiles))
934      ALLOCATE(rhwriteSTD(klon,nlevSTD,nfiles))
935
936! ug et d'autres encore:
937      ALLOCATE(beta_prec(klon,klev))
938      ALLOCATE(rneb(klon,klev),rnebjn(klon,klev),rneblsvol(klon,klev))
939      ALLOCATE(pfraclr(klon,klev),pfracld(klon,klev))
940      pfraclr(:,:)=0. ; pfracld(:,:)=0. ! because not always defined
941      ALLOCATE(distcltop(klon,klev))
942      ALLOCATE(temp_cltop(klon,klev))
943
944
945      ALLOCATE (zxsnow(klon),snowhgt(klon),qsnow(klon),to_ice(klon))
946      ALLOCATE (sissnow(klon),runoff(klon),albsol3_lic(klon))
947
948      ALLOCATE (p_tropopause(klon))
949      ALLOCATE (z_tropopause(klon))
950      ALLOCATE (t_tropopause(klon))
951
952      ALLOCATE(zn2mout(klon,6))
953
954! Supersaturation
955      ALLOCATE(rneb_seri(klon,klev))
956      ALLOCATE(d_rneb_dyn(klon,klev))
957      ALLOCATE(qclr(klon,klev), qcld(klon,klev), qss(klon,klev), qvc(klon,klev))
958      ALLOCATE(rnebclr(klon,klev), rnebss(klon,klev), gamma_ss(klon,klev))
959      ALLOCATE(N1_ss(klon,klev), N2_ss(klon,klev))
960      ALLOCATE(drneb_sub(klon,klev), drneb_con(klon,klev), drneb_tur(klon,klev), drneb_avi(klon,klev))
961      ALLOCATE(zqsatl(klon,klev), zqsats(klon,klev))
962      ALLOCATE(Tcontr(klon,klev), qcontr(klon,klev), qcontr2(klon,klev), fcontrN(klon,klev), fcontrP(klon,klev))
963
964#ifdef CPP_StratAer
965      ALLOCATE (d_q_emiss(klon,klev))
966      ALLOCATE (R2SO4(klon,klev))
967      ALLOCATE (DENSO4(klon,klev))
968      ALLOCATE (f_r_wet(klon,klev))
969      ALLOCATE (decfluxaer(klon,nbtr))
970      ALLOCATE (mdw(nbtr))
971      ALLOCATE (budg_3D_nucl(klon,klev))
972      ALLOCATE (budg_3D_cond_evap(klon,klev))
973      ALLOCATE (budg_3D_ocs_to_so2(klon,klev))
974      ALLOCATE (budg_3D_so2_to_h2so4(klon,klev))
975      ALLOCATE (budg_3D_backgr_ocs(klon,klev))
976      ALLOCATE (budg_3D_backgr_so2(klon,klev))
977      ALLOCATE (OCS_lifetime(klon,klev))
978      ALLOCATE (SO2_lifetime(klon,klev))
979      ALLOCATE (H2SO4_lifetime(klon,klev))
980      ALLOCATE (O3_clim(klon,klev))
981      ALLOCATE (alpha_bin(nbands_sw_rrtm+nbands_lw_rrtm+nwave,nbtr))
982      ALLOCATE (piz_bin(nbands_sw_rrtm+nbands_lw_rrtm+nwave,nbtr))
983      ALLOCATE (cg_bin(nbands_sw_rrtm+nbands_lw_rrtm+nwave,nbtr))
984      ALLOCATE (tau_strat_550(klon,klev))
985      ALLOCATE (tau_strat_1020(klon,klev))
986      ALLOCATE (tausum_strat(klon,3))
987      ALLOCATE (budg_dep_dry_ocs(klon))
988      ALLOCATE (budg_dep_wet_ocs(klon))
989      ALLOCATE (budg_dep_dry_so2(klon))
990      ALLOCATE (budg_dep_wet_so2(klon))
991      ALLOCATE (budg_dep_dry_h2so4(klon))
992      ALLOCATE (budg_dep_wet_h2so4(klon))
993      ALLOCATE (budg_dep_dry_part(klon))
994      ALLOCATE (budg_dep_wet_part(klon))
995      ALLOCATE (budg_emi_ocs(klon))
996      ALLOCATE (budg_emi_so2(klon))
997      ALLOCATE (budg_emi_h2so4(klon))
998      ALLOCATE (budg_emi_part(klon))
999      ALLOCATE (budg_ocs_to_so2(klon))
1000      ALLOCATE (budg_so2_to_h2so4(klon))
1001      ALLOCATE (budg_h2so4_to_part(klon))
1002      ALLOCATE (budg_sed_part(klon))
1003      ALLOCATE (surf_PM25_sulf(klon))
1004      ALLOCATE (vsed_aer(klon,klev))
1005#endif
1006
1007END SUBROUTINE phys_local_var_init
1008
1009!======================================================================
1010SUBROUTINE phys_local_var_end
1011USE dimphy
1012USE indice_sol_mod
1013IMPLICIT NONE
1014      DEALLOCATE(t_seri,q_seri,ql_seri,qs_seri, qbs_seri)
1015      DEALLOCATE(u_seri,v_seri)
1016      DEALLOCATE(l_mixmin,l_mix, tke_dissip,wprime)
1017
1018      DEALLOCATE(rhcl)
1019      DEALLOCATE(tr_seri)
1020      DEALLOCATE(d_t_dyn,d_q_dyn)
1021      DEALLOCATE(d_ql_dyn,d_qs_dyn, d_qbs_dyn)
1022      DEALLOCATE(d_q_dyn2d,d_ql_dyn2d,d_qs_dyn2d, d_qbs_dyn2d)
1023      DEALLOCATE(d_u_dyn,d_v_dyn)
1024      DEALLOCATE(d_tr_dyn)                      !RomP
1025      DEALLOCATE(d_t_con,d_q_con)
1026      DEALLOCATE(d_u_con,d_v_con)
1027      DEALLOCATE(d_t_wake,d_q_wake)
1028      DEALLOCATE(d_t_lsc,d_q_lsc)
1029      DEALLOCATE(d_t_lwr,d_t_lw0)
1030      DEALLOCATE(d_t_swr,d_t_sw0)
1031      DEALLOCATE(d_ql_lsc,d_qi_lsc)
1032      DEALLOCATE(d_t_ajsb,d_q_ajsb)
1033      DEALLOCATE(d_t_ajs,d_q_ajs)
1034!nrlmd<
1035      DEALLOCATE(d_t_ajs_w,d_q_ajs_w)
1036      DEALLOCATE(d_t_ajs_x,d_q_ajs_x)
1037!>nrlmd
1038      DEALLOCATE(d_u_ajs,d_v_ajs)
1039      DEALLOCATE(d_t_eva,d_q_eva)
1040      DEALLOCATE(d_ql_eva,d_qi_eva)
1041      DEALLOCATE(d_t_lscst,d_q_lscst)
1042      DEALLOCATE(d_t_lscth,d_q_lscth)
1043      DEALLOCATE(plul_st,plul_th)
1044      DEALLOCATE(d_t_vdf,d_q_vdf,d_t_diss)
1045      DEALLOCATE(d_qbs_vdf)
1046      DEALLOCATE(d_t_bs,d_q_bs,d_qbs_bs)
1047      DEALLOCATE(d_u_vdf,d_v_vdf)
1048      DEALLOCATE(d_t_oli,d_t_oro)
1049      DEALLOCATE(d_u_oli,d_v_oli)
1050      DEALLOCATE(d_u_oro,d_v_oro)
1051      DEALLOCATE(d_t_oro_gw)
1052      DEALLOCATE(d_u_oro_gw,d_v_oro_gw)
1053      DEALLOCATE(d_t_lif,d_t_ec)
1054      DEALLOCATE(d_u_lif,d_v_lif)
1055      DEALLOCATE(d_ts, d_tr)
1056      DEALLOCATE(topswad_aero,solswad_aero)
1057      DEALLOCATE(topswai_aero,solswai_aero)
1058      DEALLOCATE(topswad0_aero,solswad0_aero)
1059      DEALLOCATE(toplwad_aero,sollwad_aero)
1060      DEALLOCATE(toplwai_aero,sollwai_aero)
1061      DEALLOCATE(toplwad0_aero,sollwad0_aero)
1062      DEALLOCATE(topsw_aero,solsw_aero)
1063      DEALLOCATE(topsw0_aero,solsw0_aero)
1064      DEALLOCATE(topswcf_aero,solswcf_aero)
1065      DEALLOCATE(stratomask)
1066      DEALLOCATE(tausum_aero)
1067      DEALLOCATE(drytausum_aero)
1068      DEALLOCATE(tau3d_aero)
1069      DEALLOCATE(scdnc)
1070      DEALLOCATE(dNovrN)
1071      DEALLOCATE(cldncl)
1072      DEALLOCATE(reffclwtop)
1073      DEALLOCATE(lcc)
1074      DEALLOCATE(reffclws)
1075      DEALLOCATE(reffclwc)
1076      DEALLOCATE(cldnvi)
1077      DEALLOCATE(lcc3d)
1078      DEALLOCATE(lcc3dcon)
1079      DEALLOCATE(lcc3dstra)
1080      DEALLOCATE(icc3dcon)
1081      DEALLOCATE(icc3dstra)
1082      DEALLOCATE(zfice)
1083      DEALLOCATE(od443aer)
1084      DEALLOCATE(od550aer)
1085      DEALLOCATE(od865aer)
1086      DEALLOCATE(dryod550aer)
1087      DEALLOCATE(abs550aer)
1088      DEALLOCATE(ec550aer)
1089      DEALLOCATE(od550lt1aer)
1090      DEALLOCATE(sconcso4)
1091      DEALLOCATE(sconcno3)
1092      DEALLOCATE(sconcoa)
1093      DEALLOCATE(sconcbc)
1094      DEALLOCATE(sconcss)
1095      DEALLOCATE(sconcdust)
1096      DEALLOCATE(concso4)
1097      DEALLOCATE(concno3)
1098      DEALLOCATE(concoa)
1099      DEALLOCATE(concbc)
1100      DEALLOCATE(concss)
1101      DEALLOCATE(concdust)
1102      DEALLOCATE(loadso4)
1103      DEALLOCATE(loadoa)
1104      DEALLOCATE(loadbc)
1105      DEALLOCATE(loadss)
1106      DEALLOCATE(loaddust)
1107      DEALLOCATE(loadno3)
1108      DEALLOCATE(load_tmp1)
1109      DEALLOCATE(load_tmp2)
1110      DEALLOCATE(load_tmp3)
1111      DEALLOCATE(load_tmp4)
1112      DEALLOCATE(load_tmp5)
1113      DEALLOCATE(load_tmp6)
1114      DEALLOCATE(load_tmp7)
1115      DEALLOCATE(load_tmp8)
1116      DEALLOCATE(load_tmp9)
1117      DEALLOCATE(load_tmp10)
1118      DEALLOCATE(du_gwd_hines,dv_gwd_hines,d_t_hin)
1119      DEALLOCATE(d_q_ch4)
1120      DEALLOCATE(dv_gwd_rando,dv_gwd_front)
1121      DEALLOCATE(east_gwstress,west_gwstress)
1122
1123!IM ajout variables CFMIP2/CMIP5
1124      DEALLOCATE(topswad_aerop, solswad_aerop)
1125      DEALLOCATE(topswai_aerop, solswai_aerop)
1126      DEALLOCATE(topswad0_aerop, solswad0_aerop)
1127      DEALLOCATE(topsw_aerop, topsw0_aerop)
1128      DEALLOCATE(solsw_aerop, solsw0_aerop)
1129      DEALLOCATE(topswcf_aerop, solswcf_aerop)
1130!AI Aerosols
1131      DEALLOCATE(m_allaer)
1132!CK LW diagnostics
1133      DEALLOCATE(toplwad_aerop, sollwad_aerop)
1134      DEALLOCATE(toplwai_aerop, sollwai_aerop)
1135      DEALLOCATE(toplwad0_aerop, sollwad0_aerop)
1136
1137!AI Ajout pour Ecrad (3Deffect)
1138      DEALLOCATE(topswad_aero_s2, solswad_aero_s2)
1139      DEALLOCATE(topswai_aero_s2, solswai_aero_s2)
1140      DEALLOCATE(topswad0_aero_s2, solswad0_aero_s2)
1141      DEALLOCATE(topsw_aero_s2, topsw0_aero_s2)
1142      DEALLOCATE(solsw_aero_s2, solsw0_aero_s2)
1143      DEALLOCATE(topswcf_aero_s2, solswcf_aero_s2)
1144!CK LW diagnostics
1145      DEALLOCATE(toplwad_aero_s2, sollwad_aero_s2)
1146      DEALLOCATE(toplwai_aero_s2, sollwai_aero_s2)
1147      DEALLOCATE(toplwad0_aero_s2, sollwad0_aero_s2)     
1148
1149! FH Ajout de celles necessaires au phys_output_write_mod
1150      DEALLOCATE(tal1, pal1, pab1, pab2)
1151      DEALLOCATE(ptstar, pt0, slp)
1152!
1153      DEALLOCATE(alp_wake)
1154      DEALLOCATE(wake_h,wake_k)
1155      DEALLOCATE(wake_omg)
1156      DEALLOCATE(d_deltat_wk, d_deltaq_wk)
1157      DEALLOCATE(d_s_wk, d_dens_a_wk, d_dens_wk)
1158      DEALLOCATE(d_deltat_wk_gw, d_deltaq_wk_gw)
1159      DEALLOCATE(d_deltat_vdf, d_deltaq_vdf)
1160!!      DEALLOCATE( d_s_vdf, d_dens_vdf)
1161      DEALLOCATE(d_deltat_the, d_deltaq_the)
1162!!      DEALLOCATE( d_s_the, d_dens_the)
1163      DEALLOCATE(d_deltat_ajs_cv, d_deltaq_ajs_cv)
1164!
1165      DEALLOCATE(bils)
1166      DEALLOCATE(cdragm, cdragh, cldh, cldl)
1167      DEALLOCATE(cldm, cldq, cldt, qsat2m)
1168      DEALLOCATE(JrNt)
1169      DEALLOCATE(dthmin, evap, snowerosion, fder, plcl, plfc)
1170      DEALLOCATE(prw, prlw, prsw, prbsw, zustar, zu10m, zv10m, rh2m, s_lcl)
1171      DEALLOCATE(s_pblh, s_pblt, s_therm)
1172!
1173!nrlmd+jyg<
1174      DEALLOCATE(s_pblh_x, s_pblh_w)
1175      DEALLOCATE(s_lcl_x, s_lcl_w)
1176!>nrlmd+jyg
1177!
1178      DEALLOCATE(slab_wfbils, tpot, tpote, ue)
1179      DEALLOCATE(uq, ve, vq, zxffonte)
1180      DEALLOCATE(uwat, vwat)
1181      DEALLOCATE(zxfqcalving, zxfluxlat)
1182      DEALLOCATE(zxrunofflic)
1183      DEALLOCATE(zxustartlic, zxrhoslic)
1184      DEALLOCATE(zxtsol, snow_lsc, zxfqfonte, zxqsurf)
1185      DEALLOCATE(rain_lsc)
1186      DEALLOCATE(rain_num)
1187      DEALLOCATE(qlth, qith, qsith, wiceth)
1188!
1189      DEALLOCATE(sens_x, sens_w)
1190      DEALLOCATE(zxfluxlat_x, zxfluxlat_w)
1191      DEALLOCATE(delta_qsurf)
1192!jyg<
1193!!      DEALLOCATE(t_x, t_w)
1194!!      DEALLOCATE(q_x, q_w)
1195!>jyg
1196      DEALLOCATE(d_t_vdf_x, d_t_vdf_w)
1197      DEALLOCATE(d_q_vdf_x, d_q_vdf_w)
1198      DEALLOCATE(pbl_tke_input)
1199      DEALLOCATE(t_therm, q_therm, u_therm, v_therm)
1200      DEALLOCATE(cdragh_x, cdragh_w)
1201      DEALLOCATE(cdragm_x, cdragm_w)
1202      DEALLOCATE(kh, kh_x, kh_w)
1203!
1204      DEALLOCATE(ptconv)
1205      DEALLOCATE(ratqsc)
1206!
1207      DEALLOCATE(wbeff, convoccur, zmax_th)
1208      DEALLOCATE(zq2m, zt2m, weak_inversion)
1209      DEALLOCATE(zt2m_min_mon, zt2m_max_mon)
1210      DEALLOCATE(t2m_min_mon, t2m_max_mon)
1211      DEALLOCATE(sens, flwp, fiwp)
1212      DEALLOCATE(alp_bl_conv,alp_bl_det)
1213      DEALLOCATE(alp_bl_fluct_m,alp_bl_fluct_tke)
1214      DEALLOCATE(alp_bl_stat, n2, s2)
1215      DEALLOCATE(proba_notrig, random_notrig)
1216!FC
1217      DEALLOCATE(zxfluxq,zxfluxt)
1218
1219      DEALLOCATE(dnwd0)
1220!      DEALLOCATE(upwd, omega, coefh)
1221      DEALLOCATE(omega)
1222      DEALLOCATE(epmax_diag)
1223!      DEALLOCATE(coefm, lambda_th, cldemi)
1224      DEALLOCATE(lambda_th, cldemi)
1225      DEALLOCATE(cldfra, cldtau, fiwc)
1226      DEALLOCATE(fl, re, flwc)
1227      DEALLOCATE(ref_liq, ref_ice, theta)
1228      DEALLOCATE(ref_liq_pi, ref_ice_pi)
1229      DEALLOCATE(zphi, zx_rh, zx_rhl, zx_rhi)
1230      DEALLOCATE(pmfd, pmfu)
1231
1232      DEALLOCATE(t2m, fluxlat)
1233      DEALLOCATE(fsollw, evap_pot)
1234      DEALLOCATE(fsolsw, wfbils, wfbilo)
1235      DEALLOCATE(wfevap,wfrain,wfsnow)
1236
1237      DEALLOCATE(pmflxr, pmflxs)
1238      DEALLOCATE(wdtrainA, wdtrainS, wdtrainM)
1239      DEALLOCATE(upwd, dnwd)
1240      DEALLOCATE(ep)
1241      DEALLOCATE(da, mp )
1242      DEALLOCATE(phi )
1243      DEALLOCATE(wght_cvfd )
1244      DEALLOCATE(phi2 )
1245      DEALLOCATE(d1a, dam)
1246      DEALLOCATE(ev )
1247      DEALLOCATE(elij )
1248      DEALLOCATE(qtaa )
1249      DEALLOCATE(clw )
1250      DEALLOCATE(epmlmMm, eplaMm )
1251      DEALLOCATE(sij )
1252
1253
1254      DEALLOCATE(prfl, psfl, bsfl, fraca, Vprecip)
1255      DEALLOCATE(zw2)
1256
1257      DEALLOCATE(fluxu, fluxv)
1258      DEALLOCATE(fluxt)
1259
1260      DEALLOCATE(uwriteSTD, vwriteSTD)
1261      DEALLOCATE(wwriteSTD, phiwriteSTD)
1262      DEALLOCATE(qwriteSTD, twriteSTD, rhwriteSTD)
1263
1264! ug et d'autres encore:
1265      DEALLOCATE(beta_prec)
1266      DEALLOCATE(rneb)
1267      DEALLOCATE(pfraclr,pfracld)
1268      DEALLOCATE (zxsnow,snowhgt,qsnow,to_ice,sissnow,runoff,albsol3_lic)
1269      DEALLOCATE(distcltop)
1270      DEALLOCATE(temp_cltop)
1271      DEALLOCATE (p_tropopause)
1272      DEALLOCATE (z_tropopause)
1273      DEALLOCATE (t_tropopause)
1274      DEALLOCATE(zn2mout)
1275
1276! Supersaturation
1277      DEALLOCATE(rneb_seri)
1278      DEALLOCATE(d_rneb_dyn)
1279      DEALLOCATE(qclr, qcld, qss, qvc)
1280      DEALLOCATE(rnebclr, rnebss, gamma_ss)
1281      DEALLOCATE(N1_ss, N2_ss)
1282      DEALLOCATE(drneb_sub, drneb_con, drneb_tur, drneb_avi)
1283      DEALLOCATE(zqsatl, zqsats)
1284      DEALLOCATE(Tcontr, qcontr, qcontr2, fcontrN, fcontrP)
1285
1286#ifdef CPP_StratAer
1287! variables for strat. aerosol CK
1288      DEALLOCATE (d_q_emiss)
1289      DEALLOCATE (R2SO4)
1290      DEALLOCATE (DENSO4)
1291      DEALLOCATE (f_r_wet)
1292      DEALLOCATE (decfluxaer)
1293      DEALLOCATE (mdw)
1294      DEALLOCATE (SO2_lifetime)
1295      DEALLOCATE (OCS_lifetime)
1296      DEALLOCATE (H2SO4_lifetime)
1297      DEALLOCATE (O3_clim)
1298      DEALLOCATE (alpha_bin)
1299      DEALLOCATE (piz_bin)
1300      DEALLOCATE (cg_bin)
1301      DEALLOCATE (tau_strat_550)
1302      DEALLOCATE (tau_strat_1020)
1303      DEALLOCATE (tausum_strat)
1304      DEALLOCATE (surf_PM25_sulf)
1305      DEALLOCATE (vsed_aer)
1306      DEALLOCATE (budg_3D_ocs_to_so2)
1307      DEALLOCATE (budg_3D_so2_to_h2so4)
1308      DEALLOCATE (budg_3D_backgr_ocs)
1309      DEALLOCATE (budg_3D_backgr_so2)
1310      DEALLOCATE (budg_3D_nucl)
1311      DEALLOCATE (budg_3D_cond_evap)
1312      DEALLOCATE (budg_dep_dry_ocs)
1313      DEALLOCATE (budg_dep_wet_ocs)
1314      DEALLOCATE (budg_dep_dry_so2)
1315      DEALLOCATE (budg_dep_wet_so2)
1316      DEALLOCATE (budg_dep_dry_h2so4)
1317      DEALLOCATE (budg_dep_wet_h2so4)
1318      DEALLOCATE (budg_dep_dry_part)
1319      DEALLOCATE (budg_dep_wet_part)
1320      DEALLOCATE (budg_emi_ocs)
1321      DEALLOCATE (budg_emi_so2)
1322      DEALLOCATE (budg_emi_h2so4)
1323      DEALLOCATE (budg_emi_part)
1324      DEALLOCATE (budg_ocs_to_so2)
1325      DEALLOCATE (budg_so2_to_h2so4)
1326      DEALLOCATE (budg_h2so4_to_part)
1327      DEALLOCATE (budg_sed_part)
1328#endif
1329
1330END SUBROUTINE phys_local_var_end
1331
1332END MODULE phys_local_var_mod
Note: See TracBrowser for help on using the repository browser.