source: LMDZ5/branches/testing/libf/phylmd/phys_local_var_mod.F90 @ 2720

Last change on this file since 2720 was 2720, checked in by Laurent Fairhead, 8 years ago

Merged trunk changes r2664:2719 into testing branch

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