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

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

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