source: LMDZ5/branches/IPSLCM5A2.1_ISO/libf/phyiso/phys_local_var_mod.F90 @ 5452

Last change on this file since 5452 was 3331, checked in by acozic, 7 years ago

Add modification for isotopes

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