source: LMDZ5/branches/IPSLCM6.0.11/libf/phylmd/phys_local_var_mod.F90 @ 5423

Last change on this file since 5423 was 2898, checked in by fhourdin, 8 years ago

Corrections de bugs sur les deux dernieres commissions

  • 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: 43.3 KB
Line 
1!
2! $Id: phys_local_var_mod.F90 2898 2017-05-30 22:52:35Z evignon $
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 :: u_seri(:,:), v_seri(:,:)
17      !$OMP THREADPRIVATE(u_seri, v_seri)
18      REAL, SAVE, ALLOCATABLE :: l_mixmin(:,:,:), l_mix(:,:,:)
19      !$OMP THREADPRIVATE(l_mixmin, l_mix)
20
21      REAL, SAVE, ALLOCATABLE :: tr_seri(:,:,:)
22      !$OMP THREADPRIVATE(tr_seri)
23      REAL, SAVE, ALLOCATABLE :: d_t_dyn(:,:), d_q_dyn(:,:)
24      !$OMP THREADPRIVATE(d_t_dyn, d_q_dyn)
25      REAL, SAVE, ALLOCATABLE :: d_ql_dyn(:,:), d_qs_dyn(:,:)
26      !$OMP THREADPRIVATE(d_ql_dyn, d_qs_dyn)
27      REAL, SAVE, ALLOCATABLE :: d_q_dyn2d(:), d_ql_dyn2d(:), d_qs_dyn2d(:)
28      !$OMP THREADPRIVATE(d_q_dyn2d, d_ql_dyn2d, d_qs_dyn2d)
29      REAL, SAVE, ALLOCATABLE :: d_u_dyn(:,:), d_v_dyn(:,:)
30      !$OMP THREADPRIVATE(d_u_dyn, d_v_dyn)
31      REAL, SAVE, ALLOCATABLE :: d_tr_dyn(:,:,:)
32      !$OMP THREADPRIVATE(d_tr_dyn)
33      REAL, SAVE, ALLOCATABLE :: d_t_con(:,:),d_q_con(:,:)
34      !$OMP THREADPRIVATE(d_t_con,d_q_con)
35      REAL, SAVE, ALLOCATABLE :: d_u_con(:,:),d_v_con(:,:)
36      !$OMP THREADPRIVATE(d_u_con,d_v_con)
37      REAL, SAVE, ALLOCATABLE :: d_t_wake(:,:),d_q_wake(:,:)
38      !$OMP THREADPRIVATE( d_t_wake,d_q_wake)
39      REAL, SAVE, ALLOCATABLE :: d_t_lsc(:,:),d_q_lsc(:,:),d_ql_lsc(:,:),d_qi_lsc(:,:)
40      !$OMP THREADPRIVATE(d_t_lsc,d_q_lsc,d_ql_lsc,d_qi_lsc)
41      REAL, SAVE, ALLOCATABLE :: d_t_lwr(:,:),d_t_lw0(:,:),d_t_swr(:,:),d_t_sw0(:,:)
42      !$OMP THREADPRIVATE(d_t_lwr,d_t_lw0,d_t_swr,d_t_sw0)
43      REAL, SAVE, ALLOCATABLE :: d_t_ajsb(:,:), d_q_ajsb(:,:)
44      !$OMP THREADPRIVATE(d_t_ajsb, d_q_ajsb)
45      REAL, SAVE, ALLOCATABLE :: d_t_ajs(:,:), d_q_ajs(:,:)
46      !$OMP THREADPRIVATE(d_t_ajs, d_q_ajs)
47      REAL, SAVE, ALLOCATABLE :: d_u_ajs(:,:), d_v_ajs(:,:)
48      !$OMP THREADPRIVATE(d_u_ajs, d_v_ajs)
49!nrlmd<
50      REAL, SAVE, ALLOCATABLE :: d_t_ajs_w(:,:), d_q_ajs_w(:,:)
51      !$OMP THREADPRIVATE(d_t_ajs_w, d_q_ajs_w)
52      REAL, SAVE, ALLOCATABLE :: d_t_ajs_x(:,:), d_q_ajs_x(:,:)
53      !$OMP THREADPRIVATE(d_t_ajs_x, d_q_ajs_x)
54!>nrlmd
55      REAL, SAVE, ALLOCATABLE :: d_t_eva(:,:),d_q_eva(:,:),d_ql_eva(:,:),d_qi_eva(:,:)
56      !$OMP THREADPRIVATE(d_t_eva,d_q_eva,d_ql_eva,d_qi_eva)
57      REAL, SAVE, ALLOCATABLE :: d_t_lscst(:,:),d_q_lscst(:,:)
58      !$OMP THREADPRIVATE(d_t_lscst,d_q_lscst)
59      REAL, SAVE, ALLOCATABLE :: d_t_lscth(:,:),d_q_lscth(:,:)
60      !$OMP THREADPRIVATE(d_t_lscth,d_q_lscth)
61      REAL, SAVE, ALLOCATABLE :: plul_th(:),plul_st(:)
62      !$OMP THREADPRIVATE(plul_th,plul_st)
63!tendances dues a oro et lif
64      REAL, SAVE, ALLOCATABLE :: d_t_oli(:,:)
65      !$OMP THREADPRIVATE(d_t_oli)
66      REAL, SAVE, ALLOCATABLE :: d_u_oli(:,:), d_v_oli(:,:)
67      !$OMP THREADPRIVATE(d_u_oli, d_v_oli)
68      REAL, SAVE, ALLOCATABLE :: d_t_vdf(:,:), d_q_vdf(:,:), d_t_diss(:,:)
69      !$OMP THREADPRIVATE( d_t_vdf, d_q_vdf,d_t_diss)
70      REAL, SAVE, ALLOCATABLE :: d_u_vdf(:,:), d_v_vdf(:,:)
71      !$OMP THREADPRIVATE(d_u_vdf, d_v_vdf)
72!nrlmd+jyg<
73      REAL, SAVE, ALLOCATABLE :: d_t_vdf_w(:,:), d_q_vdf_w(:,:)
74      !$OMP THREADPRIVATE( d_t_vdf_w, d_q_vdf_w)
75      REAL, SAVE, ALLOCATABLE :: d_t_vdf_x(:,:), d_q_vdf_x(:,:)
76      !$OMP THREADPRIVATE( d_t_vdf_x, d_q_vdf_x)
77!>nrlmd+jyg
78      REAL, SAVE, ALLOCATABLE :: d_t_oro(:,:)
79      !$OMP THREADPRIVATE(d_t_oro)
80      REAL, SAVE, ALLOCATABLE :: d_u_oro(:,:), d_v_oro(:,:)
81      !$OMP THREADPRIVATE(d_u_oro, d_v_oro)
82      REAL, SAVE, ALLOCATABLE :: d_t_oro_gw(:,:)
83      !$OMP THREADPRIVATE(d_t_oro_gw)
84      REAL, SAVE, ALLOCATABLE :: d_u_oro_gw(:,:), d_v_oro_gw(:,:)
85      !$OMP THREADPRIVATE(d_u_oro_gw, d_v_oro_gw)
86      REAL, SAVE, ALLOCATABLE :: d_t_lif(:,:)
87      !$OMP THREADPRIVATE(d_t_lif)
88      REAL, SAVE, ALLOCATABLE :: d_u_lif(:,:), d_v_lif(:,:)
89      !$OMP THREADPRIVATE(d_u_lif, d_v_lif)
90! Tendances Ondes de G non oro (runs strato).
91      REAL, SAVE, ALLOCATABLE :: du_gwd_hines(:,:)
92      !$OMP THREADPRIVATE(du_gwd_hines)
93      REAL, SAVE, ALLOCATABLE :: dv_gwd_hines(:,:)
94      !$OMP THREADPRIVATE(dv_gwd_hines)
95      REAL, SAVE, ALLOCATABLE :: dv_gwd_rando(:,:)
96      !$OMP THREADPRIVATE(dv_gwd_rando)
97      REAL, SAVE, ALLOCATABLE :: dv_gwd_front(:,:)
98      !$OMP THREADPRIVATE(dv_gwd_front)
99      REAL, SAVE, ALLOCATABLE :: east_gwstress(:,:)
100      !$OMP THREADPRIVATE(east_gwstress)
101      REAL, SAVE, ALLOCATABLE :: west_gwstress(:,:)
102      !$OMP THREADPRIVATE(west_gwstress)
103      REAL, SAVE, ALLOCATABLE :: d_t_hin(:,:)
104      !$OMP THREADPRIVATE(d_t_hin)
105! tendance due a l'oxydation du methane
106      REAL, SAVE, ALLOCATABLE :: d_q_ch4(:,:)
107      !$OMP THREADPRIVATE(d_q_ch4)
108
109! tendance du a la conersion Ec -> E thermique
110      REAL, SAVE, ALLOCATABLE :: d_t_ec(:,:)
111      !$OMP THREADPRIVATE(d_t_ec)
112      REAL, SAVE, ALLOCATABLE :: d_ts(:,:), d_tr(:,:,:)
113      !$OMP THREADPRIVATE(d_ts, d_tr)
114
115! diagnostique pour le rayonnement
116      REAL, SAVE, ALLOCATABLE :: topswad_aero(:),  solswad_aero(:)      ! diag
117      !$OMP THREADPRIVATE(topswad_aero,solswad_aero)
118      REAL, SAVE, ALLOCATABLE :: topswai_aero(:),  solswai_aero(:)      ! diag
119      !$OMP THREADPRIVATE(topswai_aero,solswai_aero)
120      REAL, SAVE, ALLOCATABLE :: topswad0_aero(:), solswad0_aero(:)     ! diag
121      !$OMP THREADPRIVATE(topswad0_aero,solswad0_aero)
122      REAL, SAVE, ALLOCATABLE :: topsw_aero(:,:),  solsw_aero(:,:)      ! diag
123      !$OMP THREADPRIVATE(topsw_aero,solsw_aero)
124      REAL, SAVE, ALLOCATABLE :: topsw0_aero(:,:), solsw0_aero(:,:)     ! diag
125      !$OMP THREADPRIVATE(topsw0_aero,solsw0_aero)
126      REAL, SAVE, ALLOCATABLE :: topswcf_aero(:,:),  solswcf_aero(:,:)  ! diag
127      !$OMP THREADPRIVATE(topswcf_aero,solswcf_aero)
128! LW radiation diagnostics CK
129      REAL, SAVE, ALLOCATABLE :: toplwad_aero(:),  sollwad_aero(:)      ! diag
130      !$OMP THREADPRIVATE(toplwad_aero,sollwad_aero)
131      REAL, SAVE, ALLOCATABLE :: toplwai_aero(:),  sollwai_aero(:)      ! diag
132      !$OMP THREADPRIVATE(toplwai_aero,sollwai_aero)
133      REAL, SAVE, ALLOCATABLE :: toplwad0_aero(:), sollwad0_aero(:)     ! diag
134      !$OMP THREADPRIVATE(toplwad0_aero,sollwad0_aero)
135! Special RRTM
136      REAL, SAVE, ALLOCATABLE :: ZLWFT0_i(:,:),  ZSWFT0_i(:,:)      ! diag
137      !$OMP THREADPRIVATE(ZLWFT0_i,ZSWFT0_i)
138      REAL, SAVE, ALLOCATABLE :: ZFLDN0(:,:),  ZFLUP0(:,:)      ! diag
139      !$OMP THREADPRIVATE(ZFLDN0,ZFLUP0)
140      REAL, SAVE, ALLOCATABLE :: ZFSDN0(:,:),  ZFSUP0(:,:)      ! diag
141      !$OMP THREADPRIVATE(ZFSDN0,ZFSUP0)
142!
143      REAL, SAVE, ALLOCATABLE :: stratomask(:,:)
144      !$OMP THREADPRIVATE(stratomask)
145      REAL, SAVE, ALLOCATABLE :: tausum_aero(:,:,:)
146      !$OMP THREADPRIVATE(tausum_aero)
147      REAL, SAVE, ALLOCATABLE :: drytausum_aero(:,:)
148      !$OMP THREADPRIVATE(drytausum_aero)
149      REAL, SAVE, ALLOCATABLE :: tau3d_aero(:,:,:,:)
150      !$OMP THREADPRIVATE(tau3d_aero)
151      REAL, SAVE, ALLOCATABLE :: scdnc(:,:)
152      !$OMP THREADPRIVATE(scdnc)
153      REAL, SAVE, ALLOCATABLE :: cldncl(:)
154      !$OMP THREADPRIVATE(cldncl)
155      REAL, SAVE, ALLOCATABLE :: reffclwtop(:)
156      !$OMP THREADPRIVATE(reffclwtop)
157      REAL, SAVE, ALLOCATABLE :: lcc(:)
158      !$OMP THREADPRIVATE(lcc)
159      REAL, SAVE, ALLOCATABLE :: reffclws(:,:)
160      !$OMP THREADPRIVATE(reffclws)
161      REAL, SAVE, ALLOCATABLE :: reffclwc(:,:)
162      !$OMP THREADPRIVATE(reffclwc)
163      REAL, SAVE, ALLOCATABLE :: cldnvi(:)
164      !$OMP THREADPRIVATE(cldnvi)
165      REAL, SAVE, ALLOCATABLE :: lcc3d(:,:)
166      !$OMP THREADPRIVATE(lcc3d)
167      REAL, SAVE, ALLOCATABLE :: lcc3dcon(:,:)
168      !$OMP THREADPRIVATE(lcc3dcon)
169      REAL, SAVE, ALLOCATABLE :: lcc3dstra(:,:)
170      !$OMP THREADPRIVATE(lcc3dstra)
171      REAL, SAVE, ALLOCATABLE :: od443aer(:)
172      !$OMP THREADPRIVATE(od443aer)
173      REAL, SAVE, ALLOCATABLE :: od550aer(:)
174      !$OMP THREADPRIVATE(od550aer)
175      REAL, SAVE, ALLOCATABLE :: dryod550aer(:)
176      !$OMP THREADPRIVATE(dryod550aer)
177      REAL, SAVE, ALLOCATABLE :: abs550aer(:)
178      !$OMP THREADPRIVATE(abs550aer)
179      REAL, SAVE, ALLOCATABLE :: od865aer(:)
180      !$OMP THREADPRIVATE(od865aer)
181      REAL, SAVE, ALLOCATABLE :: ec550aer(:,:)
182      !$OMP THREADPRIVATE(ec550aer)
183      REAL, SAVE, ALLOCATABLE :: od550lt1aer(:)
184      !$OMP THREADPRIVATE(od550lt1aer)
185      REAL, SAVE, ALLOCATABLE :: sconcso4(:)
186      !$OMP THREADPRIVATE(sconcso4)
187      REAL, SAVE, ALLOCATABLE :: sconcno3(:)
188      !$OMP THREADPRIVATE(sconcno3)
189      REAL, SAVE, ALLOCATABLE :: sconcoa(:)
190      !$OMP THREADPRIVATE(sconcoa)
191      REAL, SAVE, ALLOCATABLE :: sconcbc(:)
192      !$OMP THREADPRIVATE(sconcbc)
193      REAL, SAVE, ALLOCATABLE :: sconcss(:)
194      !$OMP THREADPRIVATE(sconcss)
195      REAL, SAVE, ALLOCATABLE :: sconcdust(:)
196      !$OMP THREADPRIVATE(sconcdust)
197      REAL, SAVE, ALLOCATABLE :: concso4(:,:)
198      !$OMP THREADPRIVATE(concso4)
199      REAL, SAVE, ALLOCATABLE :: concno3(:,:)
200      !$OMP THREADPRIVATE(concno3)
201      REAL, SAVE, ALLOCATABLE :: concoa(:,:)
202      !$OMP THREADPRIVATE(concoa)
203      REAL, SAVE, ALLOCATABLE :: concbc(:,:)
204      !$OMP THREADPRIVATE(concbc)
205      REAL, SAVE, ALLOCATABLE :: concss(:,:)
206      !$OMP THREADPRIVATE(concss)
207      REAL, SAVE, ALLOCATABLE :: concdust(:,:)
208      !$OMP THREADPRIVATE(concdust)
209      REAL, SAVE, ALLOCATABLE :: loadso4(:)
210      !$OMP THREADPRIVATE(loadso4)
211      REAL, SAVE, ALLOCATABLE :: loadoa(:)
212      !$OMP THREADPRIVATE(loadoa)
213      REAL, SAVE, ALLOCATABLE :: loadbc(:)
214      !$OMP THREADPRIVATE(loadbc)
215      REAL, SAVE, ALLOCATABLE :: loadss(:)
216      !$OMP THREADPRIVATE(loadss)
217      REAL, SAVE, ALLOCATABLE :: loaddust(:)
218      !$OMP THREADPRIVATE(loaddust)
219      REAL, SAVE, ALLOCATABLE :: loadno3(:)
220      !$OMP THREADPRIVATE(loadno3)
221      REAL, SAVE, ALLOCATABLE :: load_tmp1(:)
222      !$OMP THREADPRIVATE(load_tmp1)
223      REAL, SAVE, ALLOCATABLE :: load_tmp2(:)
224      !$OMP THREADPRIVATE(load_tmp2)
225      REAL, SAVE, ALLOCATABLE :: load_tmp3(:)
226      !$OMP THREADPRIVATE(load_tmp3)
227
228!IM ajout variables CFMIP2/CMIP5
229      REAL,ALLOCATABLE,SAVE :: topswad_aerop(:), solswad_aerop(:)
230!$OMP THREADPRIVATE(topswad_aerop, solswad_aerop)
231      REAL,ALLOCATABLE,SAVE :: topswai_aerop(:), solswai_aerop(:)
232!$OMP THREADPRIVATE(topswai_aerop, solswai_aerop)
233      REAL,ALLOCATABLE,SAVE :: topswad0_aerop(:), solswad0_aerop(:)
234!$OMP THREADPRIVATE(topswad0_aerop, solswad0_aerop)
235      REAL,ALLOCATABLE,SAVE :: topsw_aerop(:,:), topsw0_aerop(:,:) 
236!$OMP THREADPRIVATE(topsw_aerop, topsw0_aerop)
237      REAL,ALLOCATABLE,SAVE :: solsw_aerop(:,:), solsw0_aerop(:,:)
238!$OMP THREADPRIVATE(solsw_aerop, solsw0_aerop)
239      REAL,ALLOCATABLE,SAVE :: topswcf_aerop(:,:), solswcf_aerop(:,:)
240!$OMP THREADPRIVATE(topswcf_aerop, solswcf_aerop)
241
242! additional LW variables CK
243      REAL,ALLOCATABLE,SAVE :: toplwad_aerop(:), sollwad_aerop(:)
244!$OMP THREADPRIVATE(toplwad_aerop, sollwad_aerop)
245      REAL,ALLOCATABLE,SAVE :: toplwai_aerop(:), sollwai_aerop(:)
246!$OMP THREADPRIVATE(toplwai_aerop, sollwai_aerop)
247      REAL,ALLOCATABLE,SAVE :: toplwad0_aerop(:), sollwad0_aerop(:)
248!$OMP THREADPRIVATE(toplwad0_aerop, sollwad0_aerop)
249
250!Ajout de celles n??cessaires au phys_output_write_mod
251      REAL, SAVE, ALLOCATABLE :: tal1(:), pal1(:), pab1(:), pab2(:)
252!$OMP THREADPRIVATE(tal1, pal1, pab1, pab2)
253      REAL, SAVE, ALLOCATABLE :: ptstar(:), pt0(:), slp(:)
254!$OMP THREADPRIVATE(ptstar, pt0, slp)
255      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: sens, flwp, fiwp
256!$OMP THREADPRIVATE(sens, flwp, fiwp)
257!!
258!!         Wake variables
259      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: ale_wake, alp_wake
260!$OMP THREADPRIVATE(ale_wake, alp_wake)           
261!!jyg!      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: wake_h,wake_k
262      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: wake_h
263      INTEGER,ALLOCATABLE,SAVE,DIMENSION(:)         :: wake_k
264!$OMP THREADPRIVATE(wake_h,wake_k)                       
265    REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)            :: wake_omg
266!$OMP THREADPRIVATE(wake_omg)                     
267    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_wk, d_deltaq_wk
268!$OMP THREADPRIVATE(d_deltat_wk, d_deltaq_wk)
269      REAL,ALLOCATABLE,SAVE,DIMENSION(:)            :: d_s_wk, d_dens_wk
270!$OMP THREADPRIVATE(d_s_wk, d_dens_wk)
271    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_wk_gw, d_deltaq_wk_gw
272!$OMP THREADPRIVATE(d_deltat_wk_gw, d_deltaq_wk_gw)
273    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_vdf, d_deltaq_vdf
274!$OMP THREADPRIVATE(d_deltat_vdf, d_deltaq_vdf)
275!!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:)          :: d_s_vdf, d_dens_vdf
276!!!OMP THREADPRIVATE(d_s_vdf, d_dens_vdf)
277    REAL, SAVE, ALLOCATABLE,DIMENSION(:,:)          :: d_deltat_the, d_deltaq_the
278!$OMP THREADPRIVATE(d_deltat_the, d_deltaq_the)
279!!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:)          :: d_s_the, d_dens_the
280!!!OMP THREADPRIVATE(d_s_the, d_dens_the)
281      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)           :: d_deltat_ajs_cv, d_deltaq_ajs_cv
282!$OMP THREADPRIVATE(d_deltat_ajs_cv, d_deltaq_ajs_cv)                       
283!!         End of Wake variables
284!!
285      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: bils
286!$OMP THREADPRIVATE(bils)
287      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cdragm, cdragh
288!$OMP THREADPRIVATE(cdragm, cdragh)
289      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cldh, cldl, cldm, cldq, cldt, qsat2m
290!$OMP THREADPRIVATE(cldh, cldl, cldm, cldq, cldt, qsat2m )
291      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cldhjn, cldljn, cldmjn,cldtjn
292!$OMP THREADPRIVATE(cldhjn, cldljn, cldmjn, cldtjn)
293      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: JrNt
294!$OMP THREADPRIVATE(JrNt)
295      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: dthmin, evap, fder, plcl, plfc, prw, prlw, prsw
296!$OMP THREADPRIVATE(dthmin, evap, fder, plcl, plfc, prw, prlw, prsw)
297      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zustar, zu10m, zv10m, rh2m
298!$OMP THREADPRIVATE(zustar, zu10m, zv10m, rh2m)
299      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: s_lcl, s_pblh, s_pblt, s_therm
300!$OMP THREADPRIVATE(s_lcl, s_pblh, s_pblt, s_therm)
301!
302!nrlmd+jyg<
303      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: s_pblh_x, s_pblh_w
304!$OMP THREADPRIVATE(s_pblh_x, s_pblh_w)
305      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: s_lcl_x, s_lcl_w
306!$OMP THREADPRIVATE(s_lcl_x, s_lcl_w)
307!>nrlmd+jyg
308!
309      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: slab_wfbils
310!$OMP THREADPRIVATE(slab_wfbils)
311      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: tpot, tpote, ue, uq, ve, vq, zxffonte
312!$OMP THREADPRIVATE(tpot, tpote, ue, uq, ve, vq, zxffonte)
313      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxfqcalving
314!$OMP THREADPRIVATE(zxfqcalving)
315      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxfluxlat, zxtsol, snow_lsc, zxfqfonte
316!$OMP THREADPRIVATE(zxfluxlat, zxtsol, snow_lsc, zxfqfonte)
317      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxrunofflic
318!$OMP THREADPRIVATE(zxrunofflic)
319      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxqsurf, rain_lsc, rain_num
320!$OMP THREADPRIVATE(zxqsurf, rain_lsc, rain_num)
321!
322!jyg+nrlmd<
323!!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
324!                                                                          c
325!       Declarations liees a la couche limite differentiee w-x             c
326!                                                                          c
327!!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
328      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: sens_x, sens_w
329!$OMP THREADPRIVATE(sens_x, sens_w)
330      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zxfluxlat_x, zxfluxlat_w
331!$OMP THREADPRIVATE(zxfluxlat_x, zxfluxlat_w)
332!jyg<
333!!! Entr\E9es suppl\E9mentaires couche-limite
334!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: t_x, t_w
335!!!$OMP THREADPRIVATE(t_x, t_w)
336!!      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: q_x, q_w
337!!!$OMP THREADPRIVATE(q_x, q_w)
338!>jyg
339!!! Sorties ferret
340      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dtvdf_x, dtvdf_w
341!$OMP THREADPRIVATE(dtvdf_x, dtvdf_w)
342      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dqvdf_x, dqvdf_w
343!$OMP THREADPRIVATE(dqvdf_x, dqvdf_w)
344! Variables suppl\E9mentaires dans physiq.F relative au splitting de la surface
345      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: pbl_tke_input
346!$OMP THREADPRIVATE(pbl_tke_input)
347! Entree supplementaire Thermiques :
348      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: t_therm, q_therm, u_therm, v_therm
349!$OMP THREADPRIVATE(t_therm, q_therm, u_therm, v_therm)
350      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cdragh_x, cdragh_w
351!$OMP THREADPRIVATE(cdragh_x, cdragh_w)
352      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: cdragm_x, cdragm_w
353!$OMP THREADPRIVATE(cdragm_x, cdragm_w)
354      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: kh, kh_x, kh_w
355!$OMP THREADPRIVATE(kh, kh_x, kh_w)
356!!!
357!!!ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
358      LOGICAL, SAVE, ALLOCATABLE :: ptconv(:,:)
359      !$OMP THREADPRIVATE(ptconv)
360!>jyg+nrlmd
361  !
362      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: wbeff, convoccur, zmax_th, zq2m, zt2m
363!$OMP THREADPRIVATE(wbeff, convoccur, zmax_th, zq2m, zt2m)
364      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: zt2m_min_mon, zt2m_max_mon
365!$OMP THREADPRIVATE(zt2m_min_mon, zt2m_max_mon)
366      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: t2m_min_mon, t2m_max_mon
367!$OMP THREADPRIVATE(t2m_min_mon, t2m_max_mon)
368      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: weak_inversion
369!$OMP THREADPRIVATE(weak_inversion)
370      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: ale_bl_stat,alp_bl_conv,alp_bl_det
371!$OMP THREADPRIVATE(ale_bl_stat,alp_bl_conv,alp_bl_det)
372      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: alp_bl_fluct_m,alp_bl_fluct_tke
373!$OMP THREADPRIVATE(alp_bl_fluct_m,alp_bl_fluct_tke)
374      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: alp_bl_stat, n2, s2
375!$OMP THREADPRIVATE(alp_bl_stat, n2, s2)
376      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: proba_notrig, random_notrig
377!$OMP THREADPRIVATE(proba_notrig, random_notrig)
378      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: fsolsw, wfbils, wfbilo
379!$OMP THREADPRIVATE(fsolsw, wfbils, wfbilo)
380      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: wfevap, wfrain, wfsnow
381!$OMP THREADPRIVATE(wfevap,wfrain,wfsnow)
382      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:)  :: t2m, fluxlat, fsollw,evap_pot
383!$OMP THREADPRIVATE(t2m, fluxlat, fsollw,evap_pot)
384      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: dnwd, dnwd0, upwd, omega
385!$OMP THREADPRIVATE(dnwd, dnwd0, upwd, omega)
386      REAL,ALLOCATABLE,SAVE,DIMENSION(:) :: epmax_diag ! epmax_cape
387!$OMP THREADPRIVATE(epmax_diag)
388      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: ep ! epmax_cape
389!$OMP THREADPRIVATE(ep)
390!      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: coefh, coefm, lambda_th
391      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: lambda_th
392!$OMP THREADPRIVATE(lambda_th)
393      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: cldemi, cldfra, cldtau, fiwc, fl, re, flwc
394!$OMP THREADPRIVATE(cldemi, cldfra, cldtau, fiwc, fl, re, flwc)
395      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: ref_liq, ref_ice, theta, zphi
396!$OMP THREADPRIVATE(ref_liq, ref_ice, theta, zphi)
397      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: ref_liq_pi, ref_ice_pi
398!$OMP THREADPRIVATE(ref_liq_pi, ref_ice_pi)
399      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: zx_rh
400!$OMP THREADPRIVATE(zx_rh)
401      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: pmflxr, pmflxs, prfl, psfl, fraca
402!$OMP THREADPRIVATE(pmflxr, pmflxs, prfl, psfl, fraca)
403      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: Vprecip, zw2
404!$OMP THREADPRIVATE(Vprecip, zw2)
405      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: pmfd, pmfu
406!$OMP THREADPRIVATE(pmfd, pmfu)
407      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: fluxt, fluxu, fluxv
408!$OMP THREADPRIVATE(fluxt, fluxu, fluxv)
409      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: uwriteSTD, vwriteSTD, wwriteSTD
410!$OMP THREADPRIVATE(uwriteSTD, vwriteSTD, wwriteSTD)
411      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:,:) :: phiwriteSTD, qwriteSTD, twriteSTD, rhwriteSTD
412!$OMP THREADPRIVATE(phiwriteSTD, qwriteSTD, twriteSTD, rhwriteSTD)
413
414! ug et d'autres encore:
415      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: wdtrainA, wdtrainM
416!$OMP THREADPRIVATE(wdtrainA, wdtrainM)
417      REAL,ALLOCATABLE,SAVE,DIMENSION(:,:) :: beta_prec
418!$OMP THREADPRIVATE(beta_prec)
419      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: rneb,rnebjn
420!$OMP THREADPRIVATE(rneb,rnebjn)
421
422! variables de sorties MM
423      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: zxsnow,snowhgt,qsnow,to_ice
424      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: sissnow,runoff,albsol3_lic
425!$OMP THREADPRIVATE(zxsnow,snowhgt,qsnow,to_ice)
426!$OMP THREADPRIVATE(sissnow,runoff,albsol3_lic)
427
428#ifdef CPP_StratAer
429!
430! variables for stratospheric aerosol
431      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: R2SO4
432!$OMP THREADPRIVATE(R2SO4)
433      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: DENSO4
434!$OMP THREADPRIVATE(DENSO4)
435      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: f_r_wet
436!$OMP THREADPRIVATE(f_r_wet)
437      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: decfluxaer
438!$OMP THREADPRIVATE(decfluxaer)
439      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: mdw
440!$OMP THREADPRIVATE(mdw)
441      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: OCS_lifetime
442!$OMP THREADPRIVATE(OCS_lifetime)
443      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: SO2_lifetime
444!$OMP THREADPRIVATE(SO2_lifetime)
445      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: alpha_bin
446!$OMP THREADPRIVATE(alpha_bin)
447      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: piz_bin
448!$OMP THREADPRIVATE(piz_bin)
449      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: cg_bin
450!$OMP THREADPRIVATE(cg_bin)
451      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tau_strat_550
452!$OMP THREADPRIVATE(tau_strat_550)
453      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tau_strat_1020
454!$OMP THREADPRIVATE(tau_strat_1020)
455      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: tausum_strat
456!$OMP THREADPRIVATE(tausum_strat)
457      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: surf_PM25_sulf
458!$OMP THREADPRIVATE(surf_PM25_sulf)
459      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: p_tropopause
460!$OMP THREADPRIVATE(p_tropopause)
461      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: vsed_aer
462!$OMP THREADPRIVATE(vsed_aer)
463!
464!---3D budget variables
465      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_nucl
466!$OMP THREADPRIVATE(budg_3D_nucl)
467      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_cond_evap
468!$OMP THREADPRIVATE(budg_3D_cond_evap)
469      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_ocs_to_so2
470!$OMP THREADPRIVATE(budg_3D_ocs_to_so2)
471      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_so2_to_h2so4
472!$OMP THREADPRIVATE(budg_3D_so2_to_h2so4)
473      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_backgr_ocs
474!$OMP THREADPRIVATE(budg_3D_backgr_ocs)
475      REAL, ALLOCATABLE, SAVE, DIMENSION(:,:) :: budg_3D_backgr_so2
476!$OMP THREADPRIVATE(budg_3D_backgr_so2)
477!
478!---2D budget variables
479      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_h2so4
480      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_dry_part
481!$OMP THREADPRIVATE(budg_dep_dry_h2so4,budg_dep_dry_part)
482      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_h2so4
483      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_dep_wet_part
484!$OMP THREADPRIVATE(budg_dep_wet_h2so4,budg_dep_wet_part)
485      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_ocs
486      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_so2
487      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_h2so4
488      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_emi_part
489!$OMP THREADPRIVATE(budg_emi_ocs,budg_emi_so2,budg_emi_h2so4,budg_emi_part)
490      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_ocs_to_so2
491      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_so2_to_h2so4
492      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_h2so4_to_part
493!$OMP THREADPRIVATE(budg_ocs_to_so2,budg_so2_to_h2so4,budg_h2so4_to_part)
494      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: budg_sed_part
495!$OMP THREADPRIVATE(budg_sed_part)
496#endif
497      REAL, ALLOCATABLE, SAVE, DIMENSION(:) :: pr_tropopause
498!$OMP THREADPRIVATE(pr_tropopause)
499
500CONTAINS
501
502!======================================================================
503SUBROUTINE phys_local_var_init
504USE dimphy
505USE infotrac_phy, ONLY : nbtr
506USE aero_mod
507USE indice_sol_mod
508USE phys_output_var_mod
509USE phys_state_var_mod
510
511IMPLICIT NONE
512      ALLOCATE(t_seri(klon,klev),q_seri(klon,klev),ql_seri(klon,klev),qs_seri(klon,klev))
513      ALLOCATE(u_seri(klon,klev),v_seri(klon,klev))
514      ALLOCATE(l_mixmin(klon,klev,nbsrf), l_mix(klon,klev,nbsrf))
515      l_mix(:,:,:)=0. ; l_mixmin(:,:,:)=0. ! doit etre initialse car pas toujours remplis
516
517      ALLOCATE(tr_seri(klon,klev,nbtr))
518      ALLOCATE(d_t_dyn(klon,klev),d_q_dyn(klon,klev))
519      ALLOCATE(d_ql_dyn(klon,klev),d_qs_dyn(klon,klev))
520      ALLOCATE(d_q_dyn2d(klon),d_ql_dyn2d(klon),d_qs_dyn2d(klon))
521      ALLOCATE(d_u_dyn(klon,klev),d_v_dyn(klon,klev))
522      ALLOCATE(d_tr_dyn(klon,klev,nbtr))                   !RomP
523      ALLOCATE(d_t_con(klon,klev),d_q_con(klon,klev))
524      ALLOCATE(d_u_con(klon,klev),d_v_con(klon,klev))
525      ALLOCATE(d_t_wake(klon,klev),d_q_wake(klon,klev))
526      ALLOCATE(d_t_lsc(klon,klev),d_q_lsc(klon,klev))
527      ALLOCATE(d_t_lwr(klon,klev),d_t_lw0(klon,klev))
528      ALLOCATE(d_t_swr(klon,klev),d_t_sw0(klon,klev))
529      ALLOCATE(d_ql_lsc(klon,klev),d_qi_lsc(klon,klev))
530      ALLOCATE(d_t_ajsb(klon,klev),d_q_ajsb(klon,klev))
531      ALLOCATE(d_t_ajs(klon,klev),d_q_ajs(klon,klev))
532!nrlmd<
533      ALLOCATE(d_t_ajs_w(klon,klev),d_q_ajs_w(klon,klev))
534      ALLOCATE(d_t_ajs_x(klon,klev),d_q_ajs_x(klon,klev))
535!>nrlmd
536      ALLOCATE(d_u_ajs(klon,klev),d_v_ajs(klon,klev))
537      ALLOCATE(d_t_eva(klon,klev),d_q_eva(klon,klev))
538      ALLOCATE(d_ql_eva(klon,klev),d_qi_eva(klon,klev))
539      ALLOCATE(d_t_lscst(klon,klev),d_q_lscst(klon,klev))
540      ALLOCATE(d_t_lscth(klon,klev),d_q_lscth(klon,klev))
541      ALLOCATE(plul_st(klon),plul_th(klon))
542      ALLOCATE(d_t_vdf(klon,klev),d_q_vdf(klon,klev),d_t_diss(klon,klev))
543!nrlmd+jyg<
544      ALLOCATE(d_t_vdf_w(klon,klev),d_q_vdf_w(klon,klev))
545      ALLOCATE(d_t_vdf_x(klon,klev),d_q_vdf_x(klon,klev))
546!>nrlmd+jyg
547      ALLOCATE(d_u_vdf(klon,klev),d_v_vdf(klon,klev))
548      ALLOCATE(d_t_oli(klon,klev),d_t_oro(klon,klev))
549      ALLOCATE(d_u_oli(klon,klev),d_v_oli(klon,klev))
550      ALLOCATE(d_u_oro(klon,klev),d_v_oro(klon,klev))
551      ALLOCATE(d_u_oro_gw(klon,klev),d_v_oro_gw(klon,klev))
552      ALLOCATE(d_t_oro_gw(klon,klev))
553      ALLOCATE(d_t_lif(klon,klev),d_t_ec(klon,klev))
554      ALLOCATE(d_u_lif(klon,klev),d_v_lif(klon,klev))
555      ALLOCATE(d_ts(klon,nbsrf), d_tr(klon,klev,nbtr))
556! Special RRTM
557      ALLOCATE(ZLWFT0_i(klon,klev+1),ZSWFT0_i(klon,klev+1),ZFLDN0(klon,klev+1))
558      ALLOCATE(ZFLUP0(klon,klev+1),ZFSDN0(klon,klev+1),ZFSUP0(klon,klev+1))
559!
560      ALLOCATE(topswad_aero(klon), solswad_aero(klon))
561      ALLOCATE(topswai_aero(klon), solswai_aero(klon))
562      ALLOCATE(topswad0_aero(klon), solswad0_aero(klon))
563      ALLOCATE(toplwad_aero(klon), sollwad_aero(klon))
564      ALLOCATE(toplwai_aero(klon), sollwai_aero(klon))
565      ALLOCATE(toplwad0_aero(klon), sollwad0_aero(klon))
566      ALLOCATE(topsw_aero(klon,naero_grp), solsw_aero(klon,naero_grp))
567      ALLOCATE(topsw0_aero(klon,naero_grp), solsw0_aero(klon,naero_grp))
568      ALLOCATE(topswcf_aero(klon,3), solswcf_aero(klon,3))
569      ALLOCATE(du_gwd_hines(klon,klev),dv_gwd_hines(klon,klev))
570      ALLOCATE(dv_gwd_rando(klon,klev),dv_gwd_front(klon,klev))
571      ALLOCATE(east_gwstress(klon,klev),west_gwstress(klon,klev))
572      ALLOCATE(d_t_hin(klon,klev))
573      ALLOCATE(d_q_ch4(klon,klev))
574      ALLOCATE(stratomask(klon,klev))
575      ALLOCATE(tausum_aero(klon,nwave,naero_tot))
576      ALLOCATE(drytausum_aero(klon,naero_tot))
577      ALLOCATE(tau3d_aero(klon,klev,nwave,naero_tot))
578      ALLOCATE(scdnc(klon, klev))
579      ALLOCATE(cldncl(klon))
580      ALLOCATE(reffclwtop(klon))
581      ALLOCATE(lcc(klon))
582      ALLOCATE(reffclws(klon, klev))
583      ALLOCATE(reffclwc(klon, klev))
584      ALLOCATE(cldnvi(klon))
585      ALLOCATE(lcc3d(klon, klev))
586      ALLOCATE(lcc3dcon(klon, klev))
587      ALLOCATE(lcc3dstra(klon, klev))
588      ALLOCATE(od443aer(klon))
589      ALLOCATE(od550aer(klon))
590      ALLOCATE(od865aer(klon))
591      ALLOCATE(dryod550aer(klon))
592      ALLOCATE(abs550aer(klon))
593      ALLOCATE(ec550aer(klon,klev))
594      ALLOCATE(od550lt1aer(klon))
595      ALLOCATE(sconcso4(klon))
596      ALLOCATE(sconcno3(klon))
597      ALLOCATE(sconcoa(klon))
598      ALLOCATE(sconcbc(klon))
599      ALLOCATE(sconcss(klon))
600      ALLOCATE(sconcdust(klon))
601      ALLOCATE(concso4(klon,klev))
602      ALLOCATE(concno3(klon,klev))
603      ALLOCATE(concoa(klon,klev))
604      ALLOCATE(concbc(klon,klev))
605      ALLOCATE(concss(klon,klev))
606      ALLOCATE(concdust(klon,klev))
607      ALLOCATE(loadso4(klon))
608      ALLOCATE(loadoa(klon))
609      ALLOCATE(loadbc(klon))
610      ALLOCATE(loadss(klon))
611      ALLOCATE(loaddust(klon))
612      ALLOCATE(loadno3(klon))
613      ALLOCATE(load_tmp1(klon))
614      ALLOCATE(load_tmp2(klon))
615      ALLOCATE(load_tmp3(klon))
616
617!IM ajout variables CFMIP2/CMIP5
618      ALLOCATE(topswad_aerop(klon), solswad_aerop(klon))
619      ALLOCATE(topswai_aerop(klon), solswai_aerop(klon))
620      ALLOCATE(topswad0_aerop(klon), solswad0_aerop(klon))
621      ALLOCATE(topsw_aerop(klon,naero_grp), topsw0_aerop(klon,naero_grp))
622      ALLOCATE(solsw_aerop(klon,naero_grp), solsw0_aerop(klon,naero_grp))
623      ALLOCATE(topswcf_aerop(klon,naero_grp), solswcf_aerop(klon,naero_grp))
624
625! additional LW variables CK
626      ALLOCATE(toplwad_aerop(klon), sollwad_aerop(klon))
627      ALLOCATE(toplwai_aerop(klon), sollwai_aerop(klon))
628      ALLOCATE(toplwad0_aerop(klon), sollwad0_aerop(klon))
629
630! FH Ajout de celles n??cessaires au phys_output_write_mod
631
632      ALLOCATE(tal1(klon), pal1(klon), pab1(klon), pab2(klon))
633      ALLOCATE(ptstar(klon),pt0(klon),slp(klon))
634!!
635!!          Wake variables
636      ALLOCATE(ale_wake(klon), alp_wake(klon))
637      ale_wake(:)=0.
638      ALLOCATE(wake_h(klon),wake_k(klon))
639      ALLOCATE(wake_omg(klon, klev))
640      ALLOCATE(d_deltat_wk(klon, klev), d_deltaq_wk(klon, klev))
641      ALLOCATE(d_s_wk(klon), d_dens_wk(klon))
642      ALLOCATE(d_deltat_wk_gw(klon, klev), d_deltaq_wk_gw(klon, klev))
643      ALLOCATE(d_deltat_vdf(klon, klev), d_deltaq_vdf(klon, klev))
644!!      ALLOCATE( d_s_vdf(klon), d_dens_vdf(klon))
645      ALLOCATE(d_deltat_the(klon, klev), d_deltaq_the(klon, klev))
646!!      ALLOCATE( d_s_the(klon), d_dens_the(klon))
647      ALLOCATE(d_deltat_ajs_cv(klon, klev), d_deltaq_ajs_cv(klon, klev))
648!!         End of wake variables
649!!
650      ALLOCATE(bils(klon))
651      ALLOCATE(cdragm(klon), cdragh(klon), cldh(klon), cldl(klon))
652      ALLOCATE(cldm(klon), cldq(klon), cldt(klon), qsat2m(klon))
653      ALLOCATE(cldhjn(klon), cldljn(klon), cldmjn(klon), cldtjn(klon))
654      ALLOCATE(JrNt(klon))
655      ALLOCATE(dthmin(klon), evap(klon), fder(klon), plcl(klon), plfc(klon))
656      ALLOCATE(prw(klon), prlw(klon), prsw(klon), zustar(klon), zu10m(klon), zv10m(klon), rh2m(klon))
657      ALLOCATE(s_lcl(klon))
658      ALLOCATE(s_pblh(klon), s_pblt(klon), s_therm(klon))
659!
660!nrlmd+jyg<
661      ALLOCATE(s_pblh_x(klon), s_pblh_w(klon))
662      ALLOCATE(s_lcl_x(klon), s_lcl_w(klon))
663!>nrlmd+jyg
664!
665      ALLOCATE(slab_wfbils(klon), tpot(klon), tpote(klon), ue(klon))
666      ALLOCATE(uq(klon), ve(klon), vq(klon), zxffonte(klon))
667      ALLOCATE(zxfqcalving(klon), zxfluxlat(klon))
668      ALLOCATE(zxtsol(klon), snow_lsc(klon), zxfqfonte(klon), zxqsurf(klon))
669      ALLOCATE(zxrunofflic(klon))
670      ALLOCATE(rain_lsc(klon))
671      ALLOCATE(rain_num(klon))
672!
673      ALLOCATE(sens_x(klon), sens_w(klon))
674      ALLOCATE(zxfluxlat_x(klon), zxfluxlat_w(klon))
675!jyg<
676!!      ALLOCATE(t_x(klon,klev), t_w(klon,klev))
677!!      ALLOCATE(q_x(klon,klev), q_w(klon,klev))
678!>jyg
679      ALLOCATE(dtvdf_x(klon,klev), dtvdf_w(klon,klev))
680      ALLOCATE(dqvdf_x(klon,klev), dqvdf_w(klon,klev))
681      ALLOCATE(pbl_tke_input(klon,klev+1,nbsrf))
682      ALLOCATE(t_therm(klon,klev), q_therm(klon,klev),u_therm(klon,klev), v_therm(klon,klev))
683      ALLOCATE(cdragh_x(klon), cdragh_w(klon))
684      ALLOCATE(cdragm_x(klon), cdragm_w(klon))
685      ALLOCATE(kh(klon), kh_x(klon), kh_w(klon))
686!
687      ALLOCATE(ptconv(klon,klev))
688!
689      ALLOCATE(wbeff(klon), convoccur(klon), zmax_th(klon))
690      ALLOCATE(zq2m(klon), zt2m(klon), weak_inversion(klon))
691      ALLOCATE(zt2m_min_mon(klon), zt2m_max_mon(klon))
692      ALLOCATE(t2m_min_mon(klon), t2m_max_mon(klon))
693      ALLOCATE(sens(klon), flwp(klon), fiwp(klon))
694      ALLOCATE(ale_bl_stat(klon), alp_bl_conv(klon), alp_bl_det(klon))
695      ALLOCATE(alp_bl_fluct_m(klon), alp_bl_fluct_tke(klon))
696      ALLOCATE(alp_bl_stat(klon), n2(klon), s2(klon))
697      ALLOCATE(proba_notrig(klon), random_notrig(klon))
698
699      ALLOCATE(dnwd(klon, klev), dnwd0(klon, klev))
700!      ALLOCATE(upwd(klon, klev), omega(klon, klev), coefh(klon, klev))
701      ALLOCATE(upwd(klon, klev), omega(klon, klev))
702      ALLOCATE(epmax_diag(klon)) ! epmax_cape
703      ALLOCATE(ep(klon,klev)) ! epmax_cape
704!      ALLOCATE(coefm(klon, klev), lambda_th(klon, klev), cldemi(klon, klev))
705      ALLOCATE(lambda_th(klon, klev), cldemi(klon, klev))
706      ALLOCATE(cldfra(klon, klev), cldtau(klon, klev), fiwc(klon, klev))
707      ALLOCATE(fl(klon, klev), re(klon, klev), flwc(klon, klev))
708      ALLOCATE(ref_liq(klon, klev), ref_ice(klon, klev), theta(klon, klev))
709      ALLOCATE(ref_liq_pi(klon, klev), ref_ice_pi(klon, klev))
710      ALLOCATE(zphi(klon, klev), zx_rh(klon, klev))
711      ALLOCATE(pmfd(klon, klev), pmfu(klon, klev))
712
713      ALLOCATE(t2m(klon, nbsrf), fluxlat(klon, nbsrf))
714      ALLOCATE(fsollw(klon, nbsrf))
715      ALLOCATE(fsolsw(klon, nbsrf), wfbils(klon, nbsrf), wfbilo(klon, nbsrf))
716      ALLOCATE(wfevap(klon, nbsrf), wfrain(klon,nbsrf), wfsnow(klon, nbsrf))
717      ALLOCATE(evap_pot(klon, nbsrf))
718
719      ALLOCATE(pmflxr(klon, klev+1), pmflxs(klon, klev+1), prfl(klon, klev+1))
720      ALLOCATE(psfl(klon, klev+1), fraca(klon, klev+1), Vprecip(klon, klev+1))
721      ALLOCATE(zw2(klon, klev+1))
722
723      ALLOCATE(fluxu(klon, klev, nbsrf), fluxv(klon, klev, nbsrf))
724      ALLOCATE(fluxt(klon, klev, nbsrf))
725
726      ALLOCATE(uwriteSTD(klon,nlevSTD,nfiles), vwriteSTD(klon,nlevSTD,nfiles))
727      ALLOCATE(wwriteSTD(klon,nlevSTD,nfiles), phiwriteSTD(klon,nlevSTD,nfiles))
728      ALLOCATE(qwriteSTD(klon,nlevSTD,nfiles), twriteSTD(klon,nlevSTD,nfiles))
729      ALLOCATE(rhwriteSTD(klon,nlevSTD,nfiles))
730
731! ug et d'autres encore:
732      ALLOCATE(wdtrainA(klon,klev),wdtrainM(klon,klev))
733      ALLOCATE(beta_prec(klon,klev))
734      ALLOCATE(rneb(klon,klev),rnebjn(klon,klev))
735
736
737      ALLOCATE (zxsnow(klon),snowhgt(klon),qsnow(klon),to_ice(klon))
738      ALLOCATE (sissnow(klon),runoff(klon),albsol3_lic(klon))
739
740#ifdef CPP_StratAer
741      ALLOCATE (R2SO4(klon,klev))
742      ALLOCATE (DENSO4(klon,klev))
743      ALLOCATE (f_r_wet(klon,klev))
744      ALLOCATE (decfluxaer(klon,nbtr))
745      ALLOCATE (mdw(nbtr))
746      ALLOCATE (budg_3D_nucl(klon,klev))
747      ALLOCATE (budg_3D_cond_evap(klon,klev))
748      ALLOCATE (budg_3D_ocs_to_so2(klon,klev))
749      ALLOCATE (budg_3D_so2_to_h2so4(klon,klev))
750      ALLOCATE (budg_3D_backgr_ocs(klon,klev))
751      ALLOCATE (budg_3D_backgr_so2(klon,klev))
752      ALLOCATE (OCS_lifetime(klon,klev))
753      ALLOCATE (SO2_lifetime(klon,klev))
754      ALLOCATE (alpha_bin(nbands_sw_rrtm+nbands_lw_rrtm+nwave+nwave_lw,nbtr))
755      ALLOCATE (piz_bin(nbands_sw_rrtm+nbands_lw_rrtm+nwave+nwave_lw,nbtr))
756      ALLOCATE (cg_bin(nbands_sw_rrtm+nbands_lw_rrtm+nwave+nwave_lw,nbtr))
757      ALLOCATE (tau_strat_550(klon,klev))
758      ALLOCATE (tau_strat_1020(klon,klev))
759      ALLOCATE (tausum_strat(klon,3))
760      ALLOCATE (budg_dep_dry_h2so4(klon))
761      ALLOCATE (budg_dep_wet_h2so4(klon))
762      ALLOCATE (budg_dep_dry_part(klon))
763      ALLOCATE (budg_dep_wet_part(klon))
764      ALLOCATE (budg_emi_ocs(klon))
765      ALLOCATE (budg_emi_so2(klon))
766      ALLOCATE (budg_emi_h2so4(klon))
767      ALLOCATE (budg_emi_part(klon))
768      ALLOCATE (budg_ocs_to_so2(klon))
769      ALLOCATE (budg_so2_to_h2so4(klon))
770      ALLOCATE (budg_h2so4_to_part(klon))
771      ALLOCATE (budg_sed_part(klon))
772      ALLOCATE (surf_PM25_sulf(klon))
773      ALLOCATE (p_tropopause(klon))
774      ALLOCATE (vsed_aer(klon,klev))
775#endif
776      ALLOCATE (pr_tropopause(klon))
777
778END SUBROUTINE phys_local_var_init
779
780!======================================================================
781SUBROUTINE phys_local_var_end
782USE dimphy
783USE indice_sol_mod
784IMPLICIT NONE
785      DEALLOCATE(t_seri,q_seri,ql_seri,qs_seri)
786      DEALLOCATE(u_seri,v_seri)
787      DEALLOCATE(l_mixmin,l_mix)
788
789      DEALLOCATE(tr_seri)
790      DEALLOCATE(d_t_dyn,d_q_dyn)
791      DEALLOCATE(d_ql_dyn,d_qs_dyn)
792      DEALLOCATE(d_q_dyn2d,d_ql_dyn2d,d_qs_dyn2d)
793      DEALLOCATE(d_u_dyn,d_v_dyn)
794      DEALLOCATE(d_tr_dyn)                      !RomP
795      DEALLOCATE(d_t_con,d_q_con)
796      DEALLOCATE(d_u_con,d_v_con)
797      DEALLOCATE(d_t_wake,d_q_wake)
798      DEALLOCATE(d_t_lsc,d_q_lsc)
799      DEALLOCATE(d_t_lwr,d_t_lw0)
800      DEALLOCATE(d_t_swr,d_t_sw0)
801      DEALLOCATE(d_ql_lsc,d_qi_lsc)
802      DEALLOCATE(d_t_ajsb,d_q_ajsb)
803      DEALLOCATE(d_t_ajs,d_q_ajs)
804!nrlmd<
805      DEALLOCATE(d_t_ajs_w,d_q_ajs_w)
806      DEALLOCATE(d_t_ajs_x,d_q_ajs_x)
807!>nrlmd
808      DEALLOCATE(d_u_ajs,d_v_ajs)
809      DEALLOCATE(d_t_eva,d_q_eva)
810      DEALLOCATE(d_ql_eva,d_qi_eva)
811      DEALLOCATE(d_t_lscst,d_q_lscst)
812      DEALLOCATE(d_t_lscth,d_q_lscth)
813      DEALLOCATE(plul_st,plul_th)
814      DEALLOCATE(d_t_vdf,d_q_vdf,d_t_diss)
815!nrlmd+jyg<
816      DEALLOCATE(d_t_vdf_w,d_q_vdf_w)
817      DEALLOCATE(d_t_vdf_x,d_q_vdf_x)
818!>nrlmd+jyg
819      DEALLOCATE(d_u_vdf,d_v_vdf)
820      DEALLOCATE(d_t_oli,d_t_oro)
821      DEALLOCATE(d_u_oli,d_v_oli)
822      DEALLOCATE(d_u_oro,d_v_oro)
823      DEALLOCATE(d_t_oro_gw)
824      DEALLOCATE(d_u_oro_gw,d_v_oro_gw)
825      DEALLOCATE(d_t_lif,d_t_ec)
826      DEALLOCATE(d_u_lif,d_v_lif)
827      DEALLOCATE(d_ts, d_tr)
828      DEALLOCATE(topswad_aero,solswad_aero)
829      DEALLOCATE(topswai_aero,solswai_aero)
830      DEALLOCATE(topswad0_aero,solswad0_aero)
831      DEALLOCATE(toplwad_aero,sollwad_aero)
832      DEALLOCATE(toplwai_aero,sollwai_aero)
833      DEALLOCATE(toplwad0_aero,sollwad0_aero)
834      DEALLOCATE(topsw_aero,solsw_aero)
835      DEALLOCATE(topsw0_aero,solsw0_aero)
836      DEALLOCATE(topswcf_aero,solswcf_aero)
837      DEALLOCATE(stratomask)
838      DEALLOCATE(tausum_aero)
839      DEALLOCATE(drytausum_aero)
840      DEALLOCATE(tau3d_aero)
841      DEALLOCATE(scdnc)
842      DEALLOCATE(cldncl)
843      DEALLOCATE(reffclwtop)
844      DEALLOCATE(lcc)
845      DEALLOCATE(reffclws)
846      DEALLOCATE(reffclwc)
847      DEALLOCATE(cldnvi)
848      DEALLOCATE(lcc3d)
849      DEALLOCATE(lcc3dcon)
850      DEALLOCATE(lcc3dstra)
851      DEALLOCATE(od443aer)
852      DEALLOCATE(od550aer)
853      DEALLOCATE(od865aer)
854      DEALLOCATE(dryod550aer)
855      DEALLOCATE(abs550aer)
856      DEALLOCATE(ec550aer)
857      DEALLOCATE(od550lt1aer)
858      DEALLOCATE(sconcso4)
859      DEALLOCATE(sconcno3)
860      DEALLOCATE(sconcoa)
861      DEALLOCATE(sconcbc)
862      DEALLOCATE(sconcss)
863      DEALLOCATE(sconcdust)
864      DEALLOCATE(concso4)
865      DEALLOCATE(concno3)
866      DEALLOCATE(concoa)
867      DEALLOCATE(concbc)
868      DEALLOCATE(concss)
869      DEALLOCATE(concdust)
870      DEALLOCATE(loadso4)
871      DEALLOCATE(loadoa)
872      DEALLOCATE(loadbc)
873      DEALLOCATE(loadss)
874      DEALLOCATE(loaddust)
875      DEALLOCATE(loadno3)
876      DEALLOCATE(load_tmp1)
877      DEALLOCATE(load_tmp2)
878      DEALLOCATE(load_tmp3)
879      DEALLOCATE(du_gwd_hines,dv_gwd_hines,d_t_hin)
880      DEALLOCATE(d_q_ch4)
881      DEALLOCATE(dv_gwd_rando,dv_gwd_front)
882      DEALLOCATE(east_gwstress,west_gwstress)
883
884!IM ajout variables CFMIP2/CMIP5
885      DEALLOCATE(topswad_aerop, solswad_aerop)
886      DEALLOCATE(topswai_aerop, solswai_aerop)
887      DEALLOCATE(topswad0_aerop, solswad0_aerop)
888      DEALLOCATE(topsw_aerop, topsw0_aerop)
889      DEALLOCATE(solsw_aerop, solsw0_aerop)
890      DEALLOCATE(topswcf_aerop, solswcf_aerop)
891
892!CK LW diagnostics
893      DEALLOCATE(toplwad_aerop, sollwad_aerop)
894      DEALLOCATE(toplwai_aerop, sollwai_aerop)
895      DEALLOCATE(toplwad0_aerop, sollwad0_aerop)
896
897! FH Ajout de celles n??cessaires au phys_output_write_mod
898      DEALLOCATE(tal1, pal1, pab1, pab2)
899      DEALLOCATE(ptstar, pt0, slp)
900!
901      DEALLOCATE(ale_wake, alp_wake)
902      DEALLOCATE(wake_h,wake_k)
903      DEALLOCATE(wake_omg)
904      DEALLOCATE(d_deltat_wk, d_deltaq_wk)
905      DEALLOCATE(d_s_wk, d_dens_wk)
906      DEALLOCATE(d_deltat_wk_gw, d_deltaq_wk_gw)
907      DEALLOCATE(d_deltat_vdf, d_deltaq_vdf)
908!!      DEALLOCATE( d_s_vdf, d_dens_vdf)
909      DEALLOCATE(d_deltat_the, d_deltaq_the)
910!!      DEALLOCATE( d_s_the, d_dens_the)
911      DEALLOCATE(d_deltat_ajs_cv, d_deltaq_ajs_cv)
912!
913      DEALLOCATE(bils)
914      DEALLOCATE(cdragm, cdragh, cldh, cldl)
915      DEALLOCATE(cldm, cldq, cldt, qsat2m)
916      DEALLOCATE(cldljn, cldmjn, cldhjn, cldtjn, JrNt)
917      DEALLOCATE(dthmin, evap, fder, plcl, plfc)
918      DEALLOCATE(prw, prlw, prsw, zustar, zu10m, zv10m, rh2m, s_lcl)
919      DEALLOCATE(s_pblh, s_pblt, s_therm)
920!
921!nrlmd+jyg<
922      DEALLOCATE(s_pblh_x, s_pblh_w)
923      DEALLOCATE(s_lcl_x, s_lcl_w)
924!>nrlmd+jyg
925!
926      DEALLOCATE(slab_wfbils, tpot, tpote, ue)
927      DEALLOCATE(uq, ve, vq, zxffonte)
928      DEALLOCATE(zxfqcalving, zxfluxlat)
929      DEALLOCATE(zxrunofflic)
930      DEALLOCATE(zxtsol, snow_lsc, zxfqfonte, zxqsurf)
931      DEALLOCATE(rain_lsc)
932      DEALLOCATE(rain_num)
933!
934      DEALLOCATE(sens_x, sens_w)
935      DEALLOCATE(zxfluxlat_x, zxfluxlat_w)
936!jyg<
937!!      DEALLOCATE(t_x, t_w)
938!!      DEALLOCATE(q_x, q_w)
939!>jyg
940      DEALLOCATE(dtvdf_x, dtvdf_w)
941      DEALLOCATE(dqvdf_x, dqvdf_w)
942      DEALLOCATE(pbl_tke_input)
943      DEALLOCATE(t_therm, q_therm, u_therm, v_therm)
944      DEALLOCATE(cdragh_x, cdragh_w)
945      DEALLOCATE(cdragm_x, cdragm_w)
946      DEALLOCATE(kh, kh_x, kh_w)
947!
948      DEALLOCATE(ptconv)
949!
950      DEALLOCATE(wbeff, convoccur, zmax_th)
951      DEALLOCATE(zq2m, zt2m, weak_inversion)
952      DEALLOCATE(zt2m_min_mon, zt2m_max_mon)
953      DEALLOCATE(t2m_min_mon, t2m_max_mon)
954      DEALLOCATE(sens, flwp, fiwp)
955      DEALLOCATE(ale_bl_stat,alp_bl_conv,alp_bl_det)
956      DEALLOCATE(alp_bl_fluct_m,alp_bl_fluct_tke)
957      DEALLOCATE(alp_bl_stat, n2, s2)
958      DEALLOCATE(proba_notrig, random_notrig)
959
960      DEALLOCATE(dnwd, dnwd0)
961!      DEALLOCATE(upwd, omega, coefh)
962      DEALLOCATE(upwd, omega)
963      DEALLOCATE(epmax_diag)
964      DEALLOCATE(ep)
965!      DEALLOCATE(coefm, lambda_th, cldemi)
966      DEALLOCATE(lambda_th, cldemi)
967      DEALLOCATE(cldfra, cldtau, fiwc)
968      DEALLOCATE(fl, re, flwc)
969      DEALLOCATE(ref_liq, ref_ice, theta)
970      DEALLOCATE(ref_liq_pi, ref_ice_pi)
971      DEALLOCATE(zphi, zx_rh)
972      DEALLOCATE(pmfd, pmfu)
973
974      DEALLOCATE(t2m, fluxlat)
975      DEALLOCATE(fsollw, evap_pot)
976      DEALLOCATE(fsolsw, wfbils, wfbilo)
977      DEALLOCATE(wfevap,wfrain,wfsnow)
978
979      DEALLOCATE(pmflxr, pmflxs, prfl)
980      DEALLOCATE(psfl, fraca, Vprecip)
981      DEALLOCATE(zw2)
982
983      DEALLOCATE(fluxu, fluxv)
984      DEALLOCATE(fluxt)
985
986      DEALLOCATE(uwriteSTD, vwriteSTD)
987      DEALLOCATE(wwriteSTD, phiwriteSTD)
988      DEALLOCATE(qwriteSTD, twriteSTD, rhwriteSTD)
989
990! ug et d'autres encore:
991      DEALLOCATE(wdtrainA, wdtrainM)
992      DEALLOCATE(beta_prec)
993      DEALLOCATE(rneb)
994      DEALLOCATE (zxsnow,snowhgt,qsnow,to_ice,sissnow,runoff,albsol3_lic)
995
996#ifdef CPP_StratAer
997! variables for strat. aerosol CK
998      DEALLOCATE (R2SO4)
999      DEALLOCATE (DENSO4)
1000      DEALLOCATE (f_r_wet)
1001      DEALLOCATE (decfluxaer)
1002      DEALLOCATE (mdw)
1003      DEALLOCATE (SO2_lifetime)
1004      DEALLOCATE (OCS_lifetime)
1005      DEALLOCATE (alpha_bin)
1006      DEALLOCATE (piz_bin)
1007      DEALLOCATE (cg_bin)
1008      DEALLOCATE (tau_strat_550)
1009      DEALLOCATE (tau_strat_1020)
1010      DEALLOCATE (tausum_strat)
1011      DEALLOCATE (surf_PM25_sulf)
1012      DEALLOCATE (p_tropopause)
1013      DEALLOCATE (vsed_aer)
1014      DEALLOCATE (budg_3D_ocs_to_so2)
1015      DEALLOCATE (budg_3D_so2_to_h2so4)
1016      DEALLOCATE (budg_3D_backgr_ocs)
1017      DEALLOCATE (budg_3D_backgr_so2)
1018      DEALLOCATE (budg_3D_nucl)
1019      DEALLOCATE (budg_3D_cond_evap)
1020      DEALLOCATE (budg_dep_dry_h2so4)
1021      DEALLOCATE (budg_dep_wet_h2so4)
1022      DEALLOCATE (budg_dep_dry_part)
1023      DEALLOCATE (budg_dep_wet_part)
1024      DEALLOCATE (budg_emi_ocs)
1025      DEALLOCATE (budg_emi_so2)
1026      DEALLOCATE (budg_emi_h2so4)
1027      DEALLOCATE (budg_emi_part)
1028      DEALLOCATE (budg_ocs_to_so2)
1029      DEALLOCATE (budg_so2_to_h2so4)
1030      DEALLOCATE (budg_h2so4_to_part)
1031      DEALLOCATE (budg_sed_part)
1032#endif
1033      DEALLOCATE (pr_tropopause)
1034
1035END SUBROUTINE phys_local_var_end
1036
1037END MODULE phys_local_var_mod
Note: See TracBrowser for help on using the repository browser.