source: LMDZ5/branches/IPSLCM5A2.1_ISO/libf/phyiso/phys_state_var_mod.F90 @ 5308

Last change on this file since 5308 was 3331, checked in by acozic, 6 years ago

Add modification for isotopes

  • Property svn:executable set to *
File size: 29.0 KB
Line 
1!
2! $Id: phys_state_var_mod.F90 2499 2016-04-24 10:38:19Z oboucher $
3!
4      MODULE phys_state_var_mod
5! Variables sauvegardees pour le startphy.nc
6!======================================================================
7!
8!
9!======================================================================
10! Declaration des variables
11      USE dimphy
12      USE netcdf, only: nf90_fill_real
13      INTEGER, PARAMETER :: nlevSTD=17
14      INTEGER, PARAMETER :: nlevSTD8=8
15      INTEGER, PARAMETER :: nlevSTD3=3
16      INTEGER, PARAMETER :: nout=3
17      INTEGER, PARAMETER :: napisccp=1
18      INTEGER, SAVE :: radpas
19      REAL, PARAMETER :: missing_val_nf90=nf90_fill_real
20!$OMP THREADPRIVATE(radpas)
21      REAL, SAVE :: dtime, solaire_etat0
22!$OMP THREADPRIVATE(dtime, solaire_etat0)
23
24      REAL, ALLOCATABLE, SAVE :: pctsrf(:,:)
25!$OMP THREADPRIVATE(pctsrf)
26      REAL, ALLOCATABLE, SAVE :: ftsol(:,:)
27!$OMP THREADPRIVATE(ftsol)
28      REAL,ALLOCATABLE,SAVE :: qsol(:),fevap(:,:),z0m(:,:),z0h(:,:),agesno(:,:)
29!$OMP THREADPRIVATE(qsol,fevap,z0m,z0h,agesno)
30!      character(len=6), SAVE :: ocean
31!!!!!!$OMP THREADPRIVATE(ocean)
32!      logical, SAVE :: ok_veget
33!!!!!!$OMP THREADPRIVATE(ok_veget)
34      REAL, ALLOCATABLE, SAVE :: falb1(:,:), falb2(:,:)
35!$OMP THREADPRIVATE(falb1, falb2)
36
37!albedo SB >>>
38      REAL, ALLOCATABLE, SAVE :: falb_dif(:,:,:), falb_dir(:,:,:)
39      real, allocatable, save :: chl_con(:)
40!$OMP THREADPRIVATE(falb_dir,falb_dif,chl_con)
41!albedo SB <<<
42
43
44      REAL, ALLOCATABLE, SAVE :: rain_fall(:), snow_fall(:)
45!$OMP THREADPRIVATE( rain_fall, snow_fall)
46      REAL, ALLOCATABLE, SAVE :: solsw(:), sollw(:)
47!$OMP THREADPRIVATE(solsw, sollw)
48      REAL, ALLOCATABLE, SAVE :: radsol(:)
49!$OMP THREADPRIVATE(radsol)
50      REAL, ALLOCATABLE, SAVE :: swradcorr(:)
51!$OMP THREADPRIVATE(swradcorr)
52#ifdef ISO
53      REAL,ALLOCATABLE,SAVE :: xtsol(:,:),fxtevap(:,:,:)
54!$OMP THREADPRIVATE(xtsol,fxtevap)
55      REAL, ALLOCATABLE, SAVE :: xtrain_fall(:,:), xtsnow_fall(:,:)
56!$OMP THREADPRIVATE(xtrain_fall,xtsnow_fall)
57#endif
58
59!clesphy0 param physiq
60!
61! Parametres de l'Orographie a l'Echelle Sous-Maille (OESM):
62!
63      REAL, ALLOCATABLE, SAVE :: zmea(:), zstd(:), zsig(:), zgam(:)
64!$OMP THREADPRIVATE(zmea, zstd, zsig, zgam)
65      REAL, ALLOCATABLE, SAVE :: zthe(:), zpic(:), zval(:)
66!$OMP THREADPRIVATE(zthe, zpic, zval)
67!     REAL tabcntr0(100)
68      REAL, ALLOCATABLE, SAVE :: rugoro(:)
69!$OMP THREADPRIVATE(rugoro)
70      REAL, ALLOCATABLE, SAVE :: t_ancien(:,:), q_ancien(:,:)
71!$OMP THREADPRIVATE(t_ancien, q_ancien)
72      REAL, ALLOCATABLE, SAVE :: ql_ancien(:,:), qs_ancien(:,:)
73!$OMP THREADPRIVATE(ql_ancien, qs_ancien)
74      REAL, ALLOCATABLE, SAVE :: prw_ancien(:), prlw_ancien(:), prsw_ancien(:)
75!$OMP THREADPRIVATE(prw_ancien, prlw_ancien, prsw_ancien)
76#ifdef ISO
77      REAL, ALLOCATABLE, SAVE :: xt_ancien(:,:,:),xtl_ancien(:,:,:),xts_ancien(:,:,:)
78!$OMP THREADPRIVATE(xt_ancien,xtl_ancien,xts_ancien)
79#endif
80      REAL, ALLOCATABLE, SAVE :: u_ancien(:,:), v_ancien(:,:)
81!$OMP THREADPRIVATE(u_ancien, v_ancien)
82!!! RomP >>>
83      REAL, ALLOCATABLE, SAVE :: tr_ancien(:,:,:)
84!$OMP THREADPRIVATE(tr_ancien)
85!!! RomP <<<
86      LOGICAL, SAVE :: ancien_ok
87!$OMP THREADPRIVATE(ancien_ok)
88      REAL, ALLOCATABLE, SAVE :: clwcon(:,:),rnebcon(:,:)
89!$OMP THREADPRIVATE(clwcon,rnebcon)
90      REAL, ALLOCATABLE, SAVE :: qtc_cv(:,:),sigt_cv(:,:)
91!$OMP THREADPRIVATE(qtc_cv,sigt_cv)
92      REAL, ALLOCATABLE, SAVE :: ratqs(:,:)
93!$OMP THREADPRIVATE(ratqs)
94      REAL, ALLOCATABLE, SAVE :: pbl_tke(:,:,:) ! turb kinetic energy
95      REAL, ALLOCATABLE, SAVE :: coefh(:,:,:) ! Kz enthalpie
96      REAL, ALLOCATABLE, SAVE :: coefm(:,:,:) ! Kz momentum
97!$OMP THREADPRIVATE(pbl_tke, coefh,coefm)
98!nrlmd<
99      REAL, ALLOCATABLE, SAVE :: delta_tsurf(:,:) ! Surface temperature difference inside-outside cold pool
100!$OMP THREADPRIVATE(delta_tsurf)
101!>nrlmd
102      REAL, ALLOCATABLE, SAVE :: zmax0(:), f0(:) !
103!$OMP THREADPRIVATE(zmax0,f0)
104      REAL, ALLOCATABLE, SAVE :: sig1(:,:), w01(:,:)
105!$OMP THREADPRIVATE(sig1,w01)
106      REAL, ALLOCATABLE, SAVE :: entr_therm(:,:), fm_therm(:,:)
107!$OMP THREADPRIVATE(entr_therm,fm_therm)
108      REAL, ALLOCATABLE, SAVE :: detr_therm(:,:)
109!$OMP THREADPRIVATE(detr_therm)
110!IM 150408
111!     pour phsystoke avec thermiques
112      REAL,ALLOCATABLE,SAVE :: clwcon0th(:,:),rnebcon0th(:,:)
113!$OMP THREADPRIVATE(clwcon0th,rnebcon0th)
114! radiation outputs
115      REAL,ALLOCATABLE,SAVE :: swdn0(:,:), swdn(:,:)
116!$OMP THREADPRIVATE(swdn0,swdn)
117      REAL,ALLOCATABLE,SAVE :: swup0(:,:), swup(:,:)
118!$OMP THREADPRIVATE(swup0,swup)
119      REAL,ALLOCATABLE,SAVE :: SWdn200clr(:), SWdn200(:)
120!$OMP THREADPRIVATE(SWdn200clr,SWdn200)
121      REAL,ALLOCATABLE,SAVE :: SWup200clr(:), SWup200(:)
122!$OMP THREADPRIVATE(SWup200clr,SWup200)
123      REAL,ALLOCATABLE,SAVE :: lwdn0(:,:), lwdn(:,:)
124!$OMP THREADPRIVATE(lwdn0,lwdn)
125      REAL,ALLOCATABLE,SAVE :: lwup0(:,:), lwup(:,:)
126!$OMP THREADPRIVATE(lwup0,lwup)
127      REAL,ALLOCATABLE,SAVE :: LWdn200clr(:), LWdn200(:)
128!$OMP THREADPRIVATE(LWdn200clr,LWdn200)
129      REAL,ALLOCATABLE,SAVE :: LWup200clr(:), LWup200(:)
130!$OMP THREADPRIVATE(LWup200clr,LWup200)
131      REAL,ALLOCATABLE,SAVE :: LWdnTOA(:), LWdnTOAclr(:)
132!$OMP THREADPRIVATE(LWdnTOA,LWdnTOAclr)
133! pressure level
134      REAL,ALLOCATABLE,SAVE :: tsumSTD(:,:,:)
135!$OMP THREADPRIVATE(tsumSTD)
136      REAL,ALLOCATABLE,SAVE :: usumSTD(:,:,:), vsumSTD(:,:,:)
137!$OMP THREADPRIVATE(usumSTD,vsumSTD)
138      REAL,ALLOCATABLE,SAVE :: wsumSTD(:,:,:), phisumSTD(:,:,:)
139!$OMP THREADPRIVATE(wsumSTD,phisumSTD)
140      REAL,ALLOCATABLE,SAVE :: qsumSTD(:,:,:), rhsumSTD(:,:,:)
141!$OMP THREADPRIVATE(qsumSTD,rhsumSTD)
142      REAL,ALLOCATABLE,SAVE :: tnondef(:,:,:)
143!$OMP THREADPRIVATE(tnondef)
144      REAL,ALLOCATABLE,SAVE :: uvsumSTD(:,:,:)
145!$OMP THREADPRIVATE(uvsumSTD)
146      REAL,ALLOCATABLE,SAVE :: vqsumSTD(:,:,:)
147!$OMP THREADPRIVATE(vqsumSTD)
148      REAL,ALLOCATABLE,SAVE :: vTsumSTD(:,:,:)
149!$OMP THREADPRIVATE(vTsumSTD)
150      REAL,ALLOCATABLE,SAVE :: wqsumSTD(:,:,:)
151!$OMP THREADPRIVATE(wqsumSTD)
152      REAL,ALLOCATABLE,SAVE :: vphisumSTD(:,:,:)
153!$OMP THREADPRIVATE(vphisumSTD)
154      REAL,ALLOCATABLE,SAVE :: wTsumSTD(:,:,:)
155!$OMP THREADPRIVATE(wTsumSTD)
156      REAL,ALLOCATABLE,SAVE :: u2sumSTD(:,:,:)
157!$OMP THREADPRIVATE(u2sumSTD)
158      REAL,ALLOCATABLE,SAVE :: v2sumSTD(:,:,:)
159!$OMP THREADPRIVATE(v2sumSTD)
160      REAL,ALLOCATABLE,SAVE :: T2sumSTD(:,:,:)
161!$OMP THREADPRIVATE(T2sumSTD)
162      REAL,ALLOCATABLE,SAVE :: O3sumSTD(:,:,:), O3daysumSTD(:,:,:)
163!$OMP THREADPRIVATE(O3sumSTD,O3daysumSTD)
164!IM begin
165      REAL,ALLOCATABLE,SAVE :: wlevSTD(:,:), ulevSTD(:,:), vlevSTD(:,:)
166!$OMP THREADPRIVATE(wlevSTD,ulevSTD,vlevSTD)
167      REAL,ALLOCATABLE,SAVE :: tlevSTD(:,:), qlevSTD(:,:), rhlevSTD(:,:)
168!$OMP THREADPRIVATE(tlevSTD,qlevSTD,rhlevSTD)
169      REAL,ALLOCATABLE,SAVE :: philevSTD(:,:)
170!$OMP THREADPRIVATE(philevSTD)
171      REAL,ALLOCATABLE,SAVE :: uvSTD(:,:)
172!$OMP THREADPRIVATE(uvSTD)
173      REAL,ALLOCATABLE,SAVE :: vqSTD(:,:)
174!$OMP THREADPRIVATE(vqSTD)
175      REAL,ALLOCATABLE,SAVE :: vTSTD(:,:)
176!$OMP THREADPRIVATE(vTSTD)
177      REAL,ALLOCATABLE,SAVE :: wqSTD(:,:)
178!$OMP THREADPRIVATE(wqSTD)
179      REAL,ALLOCATABLE,SAVE :: vphiSTD(:,:)
180!$OMP THREADPRIVATE(vphiSTD)
181      REAL,ALLOCATABLE,SAVE :: wTSTD(:,:)
182!$OMP THREADPRIVATE(wTSTD)
183      REAL,ALLOCATABLE,SAVE :: u2STD(:,:)
184!$OMP THREADPRIVATE(u2STD)
185      REAL,ALLOCATABLE,SAVE :: v2STD(:,:)
186!$OMP THREADPRIVATE(v2STD)
187      REAL,ALLOCATABLE,SAVE :: T2STD(:,:)
188!$OMP THREADPRIVATE(T2STD)
189      REAL,ALLOCATABLE,SAVE :: O3STD(:,:), O3daySTD(:,:)
190!$OMP THREADPRIVATE(O3STD,O3daySTD)
191!IM end
192      INTEGER,ALLOCATABLE,SAVE :: seed_old(:,:)
193!$OMP THREADPRIVATE(seed_old)
194      REAL,ALLOCATABLE,SAVE :: zuthe(:),zvthe(:)
195!$OMP THREADPRIVATE(zuthe,zvthe)
196      REAL,ALLOCATABLE,SAVE :: alb_neig(:)
197!$OMP THREADPRIVATE(alb_neig)
198!cloud base mass flux
199      REAL,ALLOCATABLE,SAVE :: ema_cbmf(:)
200!$OMP THREADPRIVATE(ema_cbmf)
201!cloud base pressure & cloud top pressure
202      REAL,ALLOCATABLE,SAVE :: ema_pcb(:), ema_pct(:)
203!$OMP THREADPRIVATE(ema_pcb,ema_pct)
204      REAL,ALLOCATABLE,SAVE :: Ma(:,:)        ! undilute upward mass flux
205!$OMP THREADPRIVATE(Ma)
206      REAL,ALLOCATABLE,SAVE :: qcondc(:,:)    ! in-cld water content from convect
207!$OMP THREADPRIVATE(qcondc)
208      REAL,ALLOCATABLE,SAVE :: wd(:) ! sb
209!$OMP THREADPRIVATE(wd)
210      REAL,ALLOCATABLE,SAVE :: sigd(:)
211!$OMP THREADPRIVATE(sigd)
212!
213      REAL,ALLOCATABLE,SAVE :: cin(:)
214!$OMP THREADPRIVATE(cin)
215! ftd : differential heating between wake and environment
216      REAL,ALLOCATABLE,SAVE :: ftd(:,:)
217!$OMP THREADPRIVATE(ftd)
218! fqd : differential moistening between wake and environment
219      REAL,ALLOCATABLE,SAVE :: fqd(:,:)     
220!$OMP THREADPRIVATE(fqd)
221#ifdef ISO
222      REAL, ALLOCATABLE, SAVE :: fxtd(:,:,:)
223!$OMP THREADPRIVATE(fxtd)
224#endif
225!34EK
226! -- Variables de controle de ALE et ALP
227!ALE : Energie disponible pour soulevement : utilisee par la
228!      convection d'Emanuel pour le declenchement et la regulation
229      REAL,ALLOCATABLE,SAVE :: ALE(:)
230!$OMP THREADPRIVATE(ALE)
231!ALP : Puissance  disponible pour soulevement
232      REAL,ALLOCATABLE,SAVE :: ALP(:)
233!$OMP THREADPRIVATE(ALP)
234!
235! nouvelles variables pour le couplage convection-couche limite
236      REAL,ALLOCATABLE,SAVE :: Ale_bl(:)
237!$OMP THREADPRIVATE(Ale_bl)
238      REAL,ALLOCATABLE,SAVE :: Alp_bl(:)
239!$OMP THREADPRIVATE(Alp_bl)
240      INTEGER,ALLOCATABLE,SAVE :: lalim_conv(:)
241!$OMP THREADPRIVATE(lalim_conv)
242      REAL,ALLOCATABLE,SAVE :: wght_th(:,:)
243!$OMP THREADPRIVATE(wght_th)
244!
245! variables de la wake
246! wake_deltat : ecart de temperature avec la zone non perturbee
247! wake_deltaq : ecart d'humidite avec la zone non perturbee
248! wake_Cstar  : vitesse d'etalement de la poche
249! wake_s      : fraction surfacique occupee par la poche froide
250! wake_pe     : wake potential energy - WAPE
251! wake_fip    : Gust Front Impinging power - ALP
252! dt_wake, dq_wake: LS tendencies due to wake
253      REAL,ALLOCATABLE,SAVE :: wake_deltat(:,:)
254!$OMP THREADPRIVATE(wake_deltat)
255      REAL,ALLOCATABLE,SAVE :: wake_deltaq(:,:)
256!$OMP THREADPRIVATE(wake_deltaq)
257#ifdef ISO
258      REAL, ALLOCATABLE, SAVE :: wake_deltaxt(:,:,:)
259!$OMP THREADPRIVATE(wake_deltaxt)
260#endif
261      REAL,ALLOCATABLE,SAVE :: wake_Cstar(:)
262!$OMP THREADPRIVATE(wake_Cstar)
263      REAL,ALLOCATABLE,SAVE :: wake_s(:)
264!$OMP THREADPRIVATE(wake_s)
265      REAL,ALLOCATABLE,SAVE :: wake_pe(:)
266!$OMP THREADPRIVATE(wake_pe)
267      REAL,ALLOCATABLE,SAVE :: wake_fip(:)
268!$OMP THREADPRIVATE(wake_fip)
269      REAL,ALLOCATABLE,SAVE :: dt_wake(:,:)
270!$OMP THREADPRIVATE(dt_wake)
271      REAL,ALLOCATABLE,SAVE :: dq_wake(:,:)
272!$OMP THREADPRIVATE(dq_wake)
273#ifdef ISO
274      REAL,ALLOCATABLE,SAVE :: dxt_wake(:,:,:)
275!$OMP THREADPRIVATE(dxt_wake)
276#endif
277!
278!jyg<
279! variables related to the spitting of the PBL between wake and
280! off-wake regions.
281! wake_delta_pbl_TKE : difference TKE_w - TKE_x
282      REAL,ALLOCATABLE,SAVE :: wake_delta_pbl_TKE(:,:,:)
283!$OMP THREADPRIVATE(wake_delta_pbl_TKE)
284!>jyg
285!
286! pfrac_impa : Produits des coefs lessivage impaction
287! pfrac_nucl : Produits des coefs lessivage nucleation
288! pfrac_1nucl: Produits des coefs lessi nucl (alpha = 1)
289      REAL,ALLOCATABLE,SAVE :: pfrac_impa(:,:), pfrac_nucl(:,:)
290!$OMP THREADPRIVATE(pfrac_impa,pfrac_nucl)
291      REAL,ALLOCATABLE,SAVE :: pfrac_1nucl(:,:)
292!$OMP THREADPRIVATE(pfrac_1nucl)
293!
294      REAL,ALLOCATABLE,SAVE :: total_rain(:), nday_rain(:) 
295!$OMP THREADPRIVATE(total_rain,nday_rain)
296      REAL,ALLOCATABLE,SAVE :: paire_ter(:)
297!$OMP THREADPRIVATE(paire_ter)
298! albsol1: albedo du sol total pour SW visible
299! albsol2: albedo du sol total pour SW proche IR
300      REAL,ALLOCATABLE,SAVE :: albsol1(:), albsol2(:)
301!$OMP THREADPRIVATE(albsol1,albsol2)
302
303!albedo SB >>>
304      REAL,ALLOCATABLE,SAVE :: albsol_dif(:,:),albsol_dir(:,:)
305!$OMP THREADPRIVATE(albsol_dif,albsol_dir)
306!albedo SB <<<
307
308
309      REAL, ALLOCATABLE, SAVE:: wo(:, :, :)
310      ! column-density of ozone in a layer, in kilo-Dobsons
311      ! Third dimension has size 1 or 2.
312      ! "wo(:, :, 1)" is for the average day-night field,
313      ! "wo(:, :, 2)" is for daylight time.
314      !$OMP THREADPRIVATE(wo)
315
316! heat : chauffage solaire
317! heat0: chauffage solaire ciel clair
318! cool : refroidissement infrarouge
319! cool0 : refroidissement infrarouge ciel clair
320! sollwdown : downward LW flux at surface
321! sollwdownclr : downward CS LW flux at surface
322! toplwdown : downward CS LW flux at TOA
323! toplwdownclr : downward CS LW flux at TOA
324      REAL,ALLOCATABLE,SAVE :: clwcon0(:,:),rnebcon0(:,:)
325!$OMP THREADPRIVATE(clwcon0,rnebcon0)
326      REAL,ALLOCATABLE,SAVE :: heat(:,:)   
327!$OMP THREADPRIVATE(heat)
328      REAL,ALLOCATABLE,SAVE :: heat0(:,:)
329!$OMP THREADPRIVATE(heat0)
330      REAL,ALLOCATABLE,SAVE :: cool(:,:)
331!$OMP THREADPRIVATE(cool)
332      REAL,ALLOCATABLE,SAVE :: cool0(:,:)
333!$OMP THREADPRIVATE(cool0)
334      REAL,ALLOCATABLE,SAVE :: topsw(:), toplw(:)
335!$OMP THREADPRIVATE(topsw,toplw)
336      REAL,ALLOCATABLE,SAVE :: sollwdown(:)
337!$OMP THREADPRIVATE(sollwdown)
338      REAL,ALLOCATABLE,SAVE :: gustiness(:)
339!$OMP THREADPRIVATE(gustiness)
340      REAL,ALLOCATABLE,SAVE :: sollwdownclr(:)
341!$OMP THREADPRIVATE(sollwdownclr)
342      REAL,ALLOCATABLE,SAVE :: toplwdown(:)
343!$OMP THREADPRIVATE(toplwdown)
344      REAL,ALLOCATABLE,SAVE :: toplwdownclr(:)
345!$OMP THREADPRIVATE(toplwdownclr)
346      REAL,ALLOCATABLE,SAVE :: topsw0(:),toplw0(:),solsw0(:),sollw0(:)
347!$OMP THREADPRIVATE(topsw0,toplw0,solsw0,sollw0)
348      REAL,ALLOCATABLE,SAVE :: albpla(:)
349!$OMP THREADPRIVATE(albpla)
350
351!IM ajout variables CFMIP2/CMIP5
352      REAL,ALLOCATABLE,SAVE :: heatp(:,:), coolp(:,:)
353!$OMP THREADPRIVATE(heatp, coolp)
354      REAL,ALLOCATABLE,SAVE :: heat0p(:,:), cool0p(:,:)
355!$OMP THREADPRIVATE(heat0p, cool0p)
356      REAL,ALLOCATABLE,SAVE :: radsolp(:), topswp(:), toplwp(:)
357!$OMP THREADPRIVATE(radsolp, topswp, toplwp)
358      REAL,ALLOCATABLE,SAVE :: albplap(:)
359!$OMP THREADPRIVATE(albplap)
360      REAL,ALLOCATABLE,SAVE :: solswp(:), sollwp(:)
361!$OMP THREADPRIVATE(solswp, sollwp)
362      REAL,ALLOCATABLE,SAVE :: sollwdownp(:)
363!$OMP THREADPRIVATE(sollwdownp)
364      REAL,ALLOCATABLE,SAVE :: topsw0p(:),toplw0p(:)
365      REAL,ALLOCATABLE,SAVE :: solsw0p(:),sollw0p(:)
366!$OMP THREADPRIVATE(topsw0p,toplw0p,solsw0p,sollw0p)
367      REAL,ALLOCATABLE,SAVE :: lwdn0p(:,:), lwdnp(:,:)
368      REAL,ALLOCATABLE,SAVE :: lwup0p(:,:), lwupp(:,:)
369!$OMP THREADPRIVATE(lwdn0p, lwdnp, lwup0p, lwupp)
370      REAL,ALLOCATABLE,SAVE :: swdn0p(:,:), swdnp(:,:)
371      REAL,ALLOCATABLE,SAVE :: swup0p(:,:), swupp(:,:)
372!$OMP THREADPRIVATE(swdn0p, swdnp, swup0p, swupp)
373
374! pbase : cloud base pressure
375! bbase : cloud base buoyancy
376      REAL,ALLOCATABLE,SAVE :: cape(:)
377!$OMP THREADPRIVATE(cape)
378      REAL,ALLOCATABLE,SAVE :: pbase(:)
379!$OMP THREADPRIVATE(pbase)
380      REAL,ALLOCATABLE,SAVE :: bbase(:)
381!$OMP THREADPRIVATE(bbase)
382!
383      REAL,SAVE,ALLOCATABLE :: zqasc(:,:)
384!$OMP THREADPRIVATE( zqasc)
385      INTEGER,ALLOCATABLE,SAVE :: ibas_con(:), itop_con(:)
386!$OMP THREADPRIVATE(ibas_con,itop_con)
387      REAL,SAVE,ALLOCATABLE :: rain_con(:)
388!$OMP THREADPRIVATE(rain_con)
389      REAL,SAVE,ALLOCATABLE :: snow_con(:)
390!$OMP THREADPRIVATE(snow_con)
391!
392#ifdef ISO
393      REAL,SAVE,ALLOCATABLE :: xtrain_con(:,:)
394!$OMP THREADPRIVATE(xtrain_con)
395      REAL,SAVE,ALLOCATABLE :: xtsnow_con(:,:)
396!$OMP THREADPRIVATE(xtsnow_con)
397#endif
398!
399      REAL,SAVE,ALLOCATABLE :: rlonPOS(:)
400!$OMP THREADPRIVATE(rlonPOS)
401      REAL,SAVE,ALLOCATABLE :: newsst(:)
402!$OMP THREADPRIVATE(newsst)
403      REAL,SAVE,ALLOCATABLE :: ustar(:,:),u10m(:,:), v10m(:,:),wstar(:,:)
404!$OMP THREADPRIVATE(ustar,u10m,v10m,wstar)
405!
406! ok_ade=T -ADE=topswad-topsw
407! ok_aie=T ->
408!       ok_ade=T -AIE=topswai-topswad
409!       ok_ade=F -AIE=topswai-topsw
410!
411!topswad, solswad : Aerosol direct effect
412      REAL,SAVE,ALLOCATABLE :: topswad(:), solswad(:)
413!$OMP THREADPRIVATE(topswad,solswad)
414!topswai, solswai : Aerosol indirect effect
415      REAL,SAVE,ALLOCATABLE :: topswai(:), solswai(:)
416!$OMP THREADPRIVATE(topswai,solswai)
417
418      REAL,SAVE,ALLOCATABLE :: tau_aero(:,:,:,:), piz_aero(:,:,:,:), cg_aero(:,:,:,:)
419!$OMP THREADPRIVATE(tau_aero, piz_aero, cg_aero)
420      REAL,SAVE,ALLOCATABLE :: tau_aero_sw_rrtm(:,:,:,:), piz_aero_sw_rrtm(:,:,:,:), cg_aero_sw_rrtm(:,:,:,:)
421!$OMP THREADPRIVATE(tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm)
422      REAL,SAVE,ALLOCATABLE :: tau_aero_lw_rrtm(:,:,:,:), piz_aero_lw_rrtm(:,:,:,:), cg_aero_lw_rrtm(:,:,:,:)
423!$OMP THREADPRIVATE(tau_aero_lw_rrtm, piz_aero_lw_rrtm, cg_aero_lw_rrtm)
424      REAL,SAVE,ALLOCATABLE :: ccm(:,:,:)
425!$OMP THREADPRIVATE(ccm)
426
427!!! nrlmd le 10/04/2012
428      REAL,SAVE,ALLOCATABLE :: ale_bl_trig(:)
429!$OMP THREADPRIVATE(ale_bl_trig)
430!!! fin nrlmd le 10/04/2012
431
432#ifdef ISO
433#ifdef ISOTRAC
434      INTEGER,SAVE,ALLOCATABLE :: bassin_map(:)
435!$OMP THREADPRIVATE(bassin_map)
436      INTEGER,SAVE,ALLOCATABLE :: boite_map(:,:)
437!$OMP THREADPRIVATE(boite_map)
438#endif   
439#endif
440
441      REAL, ALLOCATABLE, SAVE:: du_gwd_rando(:, :), du_gwd_front(:, :)
442      !$OMP THREADPRIVATE(du_gwd_rando, du_gwd_front)
443      ! tendencies on wind due to gravity waves
444
445CONTAINS
446
447!======================================================================
448SUBROUTINE phys_state_var_init(read_climoz)
449USE dimphy
450USE aero_mod
451#ifdef ISO
452USE infotrac_phy, ONLY : nbtr,ntraciso,niso
453#else
454USE infotrac_phy, ONLY : nbtr
455#endif
456USE indice_sol_mod
457IMPLICIT NONE
458
459integer, intent(in)::  read_climoz
460! read ozone climatology
461! Allowed values are 0, 1 and 2
462! 0: do not read an ozone climatology
463! 1: read a single ozone climatology that will be used day and night
464! 2: read two ozone climatologies, the average day and night
465! climatology and the daylight climatology
466
467include "clesphys.h"
468
469      ALLOCATE(pctsrf(klon,nbsrf))
470      ALLOCATE(ftsol(klon,nbsrf))
471      ALLOCATE(qsol(klon),fevap(klon,nbsrf))
472      ALLOCATE(z0m(klon,nbsrf+1),z0h(klon,nbsrf+1),agesno(klon,nbsrf))
473      ALLOCATE(falb1(klon,nbsrf))
474      ALLOCATE(falb2(klon,nbsrf))
475!albedo SB >>>
476      ALLOCATE(falb_dir(klon,nsw,nbsrf),falb_dif(klon,nsw,nbsrf))
477      ALLOCATE(chl_con(klon))
478!albedo SB <<<
479      ALLOCATE(rain_fall(klon))
480      ALLOCATE(snow_fall(klon))
481      ALLOCATE(solsw(klon), sollw(klon))
482      ALLOCATE(radsol(klon))
483      ALLOCATE(swradcorr(klon))
484      ALLOCATE(zmea(klon), zstd(klon), zsig(klon), zgam(klon))
485      ALLOCATE(zthe(klon), zpic(klon), zval(klon))
486
487      ALLOCATE(rugoro(klon))
488      ALLOCATE(t_ancien(klon,klev), q_ancien(klon,klev))
489      ALLOCATE(ql_ancien(klon,klev), qs_ancien(klon,klev))
490      ALLOCATE(prw_ancien(klon), prlw_ancien(klon), prsw_ancien(klon))
491      ALLOCATE(u_ancien(klon,klev), v_ancien(klon,klev))
492!!! Rom P >>>
493      ALLOCATE(tr_ancien(klon,klev,nbtr))
494!!! Rom P <<<
495      ALLOCATE(clwcon(klon,klev),rnebcon(klon,klev))
496      ALLOCATE(qtc_cv(klon,klev),sigt_cv(klon,klev))
497      ALLOCATE(ratqs(klon,klev))
498      ALLOCATE(pbl_tke(klon,klev+1,nbsrf+1))
499!nrlmd<
500      ALLOCATE(delta_tsurf(klon,nbsrf))
501!>nrlmd
502      ALLOCATE(coefh(klon,klev+1,nbsrf+1))
503      ALLOCATE(coefm(klon,klev+1,nbsrf+1))
504      ALLOCATE(zmax0(klon), f0(klon))
505      ALLOCATE(sig1(klon,klev), w01(klon,klev))
506      ALLOCATE(entr_therm(klon,klev), fm_therm(klon,klev+1))
507      ALLOCATE(detr_therm(klon,klev))
508!     pour phsystoke avec thermiques
509      ALLOCATE(clwcon0th(klon,klev),rnebcon0th(klon,klev))
510! radiation outputs
511      ALLOCATE(swdn0(klon,klevp1), swdn(klon,klevp1))
512      ALLOCATE(swup0(klon,klevp1), swup(klon,klevp1))
513      ALLOCATE(lwdn0(klon,klevp1), lwdn(klon,klevp1))
514      ALLOCATE(lwup0(klon,klevp1), lwup(klon,klevp1))
515      ALLOCATE(SWdn200clr(klon), SWdn200(klon))
516      ALLOCATE(SWup200clr(klon), SWup200(klon))
517      ALLOCATE(LWdn200clr(klon), LWdn200(klon))
518      ALLOCATE(LWup200clr(klon), LWup200(klon))
519      ALLOCATE(LWdnTOA(klon), LWdnTOAclr(klon))
520! pressure level
521      ALLOCATE(tsumSTD(klon,nlevSTD,nout))
522      ALLOCATE(usumSTD(klon,nlevSTD,nout), vsumSTD(klon,nlevSTD,nout))
523      ALLOCATE(wsumSTD(klon,nlevSTD,nout), phisumSTD(klon,nlevSTD,nout))
524      ALLOCATE(qsumSTD(klon,nlevSTD,nout), rhsumSTD(klon,nlevSTD,nout))
525      ALLOCATE(tnondef(klon,nlevSTD,nout))
526      ALLOCATE(uvsumSTD(klon,nlevSTD,nout))
527      ALLOCATE(vqsumSTD(klon,nlevSTD,nout))
528      ALLOCATE(vTsumSTD(klon,nlevSTD,nout))
529      ALLOCATE(wqsumSTD(klon,nlevSTD,nout))
530      ALLOCATE(vphisumSTD(klon,nlevSTD,nout))
531      ALLOCATE(wTsumSTD(klon,nlevSTD,nout))
532      ALLOCATE(u2sumSTD(klon,nlevSTD,nout))
533      ALLOCATE(v2sumSTD(klon,nlevSTD,nout))
534      ALLOCATE(T2sumSTD(klon,nlevSTD,nout))
535      ALLOCATE(O3sumSTD(klon,nlevSTD,nout))
536      ALLOCATE(O3daysumSTD(klon,nlevSTD,nout))
537!IM beg
538      ALLOCATE(wlevSTD(klon,nlevSTD), ulevSTD(klon,nlevSTD), vlevSTD(klon,nlevSTD))
539      ALLOCATE(tlevSTD(klon,nlevSTD), qlevSTD(klon,nlevSTD), rhlevSTD(klon,nlevSTD))
540      ALLOCATE(philevSTD(klon,nlevSTD))
541      ALLOCATE(uvSTD(klon,nlevSTD),vqSTD(klon,nlevSTD))
542      ALLOCATE(vTSTD(klon,nlevSTD),wqSTD(klon,nlevSTD))
543      ALLOCATE(vphiSTD(klon,nlevSTD),wTSTD(klon,nlevSTD))
544      ALLOCATE(u2STD(klon,nlevSTD),v2STD(klon,nlevSTD))
545      ALLOCATE(T2STD(klon,nlevSTD))
546      ALLOCATE(O3STD(klon,nlevSTD))
547      ALLOCATE(O3daySTD(klon,nlevSTD))
548!IM end
549      ALLOCATE(seed_old(klon,napisccp))
550      ALLOCATE(zuthe(klon),zvthe(klon))
551      ALLOCATE(alb_neig(klon))
552!cloud base mass flux
553      ALLOCATE(ema_cbmf(klon))
554!cloud base pressure & cloud top pressure
555      ALLOCATE(ema_pcb(klon), ema_pct(klon))
556!
557      ALLOCATE(Ma(klon,klev))
558      ALLOCATE(qcondc(klon,klev))
559      ALLOCATE(wd(klon))
560      ALLOCATE(sigd(klon))
561      ALLOCATE(cin(klon), ALE(klon), ALP(klon))
562      ALLOCATE(ftd(klon,klev), fqd(klon,klev))
563      ALLOCATE(Ale_bl(klon))
564      ALLOCATE(Alp_bl(klon))
565      ALLOCATE(lalim_conv(klon))
566      ALLOCATE(wght_th(klon,klev))
567      ALLOCATE(wake_deltat(klon,klev), wake_deltaq(klon,klev))
568      ALLOCATE(wake_Cstar(klon), wake_s(klon))
569      ALLOCATE(wake_pe(klon), wake_fip(klon))
570      ALLOCATE(dt_wake(klon,klev), dq_wake(klon,klev))
571!jyg<
572      ALLOCATE(wake_delta_pbl_TKE(klon,klev+1,nbsrf+1))
573!>jyg
574      ALLOCATE(pfrac_impa(klon,klev), pfrac_nucl(klon,klev))
575      ALLOCATE(pfrac_1nucl(klon,klev))
576      ALLOCATE(total_rain(klon), nday_rain(klon))
577      ALLOCATE(paire_ter(klon))
578      ALLOCATE(albsol1(klon), albsol2(klon))
579!albedo SB >>>
580      ALLOCATE(albsol_dir(klon,nsw),albsol_dif(klon,nsw))
581!albedo SB <<<
582
583      if (read_climoz <= 1) then
584         ALLOCATE(wo(klon,klev, 1))
585      else
586         ! read_climoz == 2
587         ALLOCATE(wo(klon,klev, 2))
588      end if
589     
590      ALLOCATE(clwcon0(klon,klev),rnebcon0(klon,klev))
591      ALLOCATE(heat(klon,klev), heat0(klon,klev))
592      ALLOCATE(cool(klon,klev), cool0(klon,klev))
593      ALLOCATE(topsw(klon), toplw(klon))
594      ALLOCATE(sollwdown(klon), sollwdownclr(klon))
595      ALLOCATE(toplwdown(klon), toplwdownclr(klon))
596      ALLOCATE(topsw0(klon),toplw0(klon),solsw0(klon),sollw0(klon))
597      ALLOCATE(albpla(klon))
598!IM ajout variables CFMIP2/CMIP5
599      ALLOCATE(heatp(klon,klev), coolp(klon,klev))
600      ALLOCATE(heat0p(klon,klev), cool0p(klon,klev))
601      ALLOCATE(radsolp(klon), topswp(klon), toplwp(klon))
602      ALLOCATE(albplap(klon))
603      ALLOCATE(solswp(klon), sollwp(klon))
604      ALLOCATE(gustiness(klon))
605      ALLOCATE(sollwdownp(klon))
606      ALLOCATE(topsw0p(klon),toplw0p(klon))
607      ALLOCATE(solsw0p(klon),sollw0p(klon))
608      ALLOCATE(lwdn0p(klon,klevp1), lwdnp(klon,klevp1))
609      ALLOCATE(lwup0p(klon,klevp1), lwupp(klon,klevp1))
610      ALLOCATE(swdn0p(klon,klevp1), swdnp(klon,klevp1))
611      ALLOCATE(swup0p(klon,klevp1), swupp(klon,klevp1))
612
613      ALLOCATE(cape(klon))
614      ALLOCATE(pbase(klon),bbase(klon))
615      ALLOCATE(zqasc(klon,klev))
616      ALLOCATE(ibas_con(klon), itop_con(klon))
617      ALLOCATE(rain_con(klon), snow_con(klon))
618      ALLOCATE(rlonPOS(klon))
619      ALLOCATE(newsst(klon))
620      ALLOCATE(ustar(klon,nbsrf),u10m(klon,nbsrf), v10m(klon,nbsrf),wstar(klon,nbsrf+1))
621      ALLOCATE(topswad(klon), solswad(klon))
622      ALLOCATE(topswai(klon), solswai(klon))
623      ALLOCATE(tau_aero(klon,klev,naero_grp,nbands),piz_aero(klon,klev,naero_grp,nbands),cg_aero(klon,klev,naero_grp,nbands))
624      ALLOCATE(tau_aero_sw_rrtm(klon,klev,2,nbands_sw_rrtm),piz_aero_sw_rrtm(klon,klev,2,nbands_sw_rrtm))
625      ALLOCATE(cg_aero_sw_rrtm(klon,klev,2,nbands_sw_rrtm))
626      ALLOCATE(tau_aero_lw_rrtm(klon,klev,2,nbands_lw_rrtm),piz_aero_lw_rrtm(klon,klev,2,nbands_lw_rrtm))
627      ALLOCATE(cg_aero_lw_rrtm(klon,klev,2,nbands_lw_rrtm))
628      ALLOCATE(ccm(klon,klev,nbands))
629
630#ifdef ISO
631      ALLOCATE(xtsol(niso,klon),fxtevap(ntraciso,klon,nbsrf))
632      ALLOCATE(fxtd(ntraciso,klon,klev))
633      ALLOCATE(wake_deltaxt(ntraciso,klon,klev))
634      ALLOCATE(dxt_wake(ntraciso,klon,klev))
635      ALLOCATE(xt_ancien(ntraciso,klon,klev))
636      ALLOCATE(xtl_ancien(ntraciso,klon,klev))
637      ALLOCATE(xts_ancien(ntraciso,klon,klev))
638      ALLOCATE(xtrain_fall(ntraciso,klon))
639      ALLOCATE(xtsnow_fall(ntraciso,klon))
640      ALLOCATE(xtrain_con(ntraciso,klon))
641      ALLOCATE(xtsnow_con(ntraciso,klon))
642#ifdef ISOTRAC
643      ALLOCATE(bassin_map(klon))
644      ALLOCATE(boite_map(klon,klev)) 
645#endif     
646#endif
647
648!!! nrlmd le 10/04/2012
649      ALLOCATE(ale_bl_trig(klon))
650!!! fin nrlmd le 10/04/2012
651      if (ok_gwd_rando) allocate(du_gwd_rando(klon, klev))
652      if (.not. ok_hines .and. ok_gwd_rando) allocate(du_gwd_front(klon, klev))
653
654END SUBROUTINE phys_state_var_init
655
656!======================================================================
657SUBROUTINE phys_state_var_end
658!USE dimphy
659USE indice_sol_mod
660IMPLICIT NONE
661include "clesphys.h"
662
663      deallocate(pctsrf, ftsol, falb1, falb2)
664      deallocate(qsol,fevap,z0m,z0h,agesno)
665      deallocate(rain_fall, snow_fall, solsw, sollw, radsol, swradcorr)
666      deallocate(zmea, zstd, zsig, zgam)
667      deallocate(zthe, zpic, zval)
668      deallocate(rugoro, t_ancien, q_ancien, clwcon, rnebcon)
669      deallocate(qs_ancien, ql_ancien)
670      deallocate(prw_ancien, prlw_ancien, prsw_ancien)
671      deallocate(qtc_cv,sigt_cv)
672      deallocate(u_ancien, v_ancien)
673      deallocate(tr_ancien)                           !RomP
674      deallocate(ratqs, pbl_tke,coefh,coefm)
675!nrlmd<
676      deallocate(delta_tsurf)
677!>nrlmd
678      deallocate(zmax0, f0)
679      deallocate(sig1, w01)
680      deallocate(entr_therm, fm_therm)
681      deallocate(detr_therm)
682      deallocate(clwcon0th, rnebcon0th)
683! radiation outputs
684      deallocate(swdn0, swdn)
685      deallocate(swup0, swup)
686      deallocate(lwdn0, lwdn)
687      deallocate(lwup0, lwup)
688      deallocate(SWdn200clr, SWdn200)
689      deallocate(SWup200clr, SWup200)
690      deallocate(LWdn200clr, LWdn200)
691      deallocate(LWup200clr, LWup200)
692      deallocate(LWdnTOA, LWdnTOAclr)
693! pressure level
694      deallocate(tsumSTD)
695      deallocate(usumSTD, vsumSTD)
696      deallocate(wsumSTD, phisumSTD)
697      deallocate(tnondef)
698      deallocate(qsumSTD, rhsumSTD)
699      deallocate(uvsumSTD)
700      deallocate(vqsumSTD)
701      deallocate(vTsumSTD)
702      deallocate(wqsumSTD)
703      deallocate(vphisumSTD)
704      deallocate(wTsumSTD)
705      deallocate(u2sumSTD)
706      deallocate(v2sumSTD)
707      deallocate(T2sumSTD)
708      deallocate(O3sumSTD)
709      deallocate(O3daysumSTD)
710!IM beg
711      deallocate(wlevSTD,ulevSTD,vlevSTD,tlevSTD,qlevSTD,rhlevSTD,philevSTD)
712      deallocate(uvSTD,vqSTD,vTSTD,wqSTD,vphiSTD,wTSTD,u2STD,v2STD,T2STD,O3STD,O3daySTD)
713!IM end
714      deallocate(seed_old)
715      deallocate(zuthe, zvthe)
716      deallocate(alb_neig)
717      deallocate(ema_cbmf)
718      deallocate(ema_pcb, ema_pct)
719      deallocate(Ma, qcondc)
720      deallocate(wd, sigd)
721      deallocate(cin, ALE, ALP)
722      deallocate(ftd, fqd)
723      deallocate(Ale_bl, Alp_bl)
724      deallocate(lalim_conv, wght_th)
725      deallocate(wake_deltat, wake_deltaq)
726      deallocate(wake_Cstar, wake_s, wake_pe, wake_fip)
727      deallocate(dt_wake, dq_wake)
728!jyg<
729      deallocate(wake_delta_pbl_TKE)
730!>jyg
731      deallocate(pfrac_impa, pfrac_nucl)
732      deallocate(pfrac_1nucl)
733      deallocate(total_rain, nday_rain)
734      deallocate(paire_ter)
735      deallocate(albsol1, albsol2)
736!albedo SB >>>
737      deallocate(albsol_dir,albsol_dif,falb_dir,falb_dif,chl_con)
738!albedo SB <<<
739      deallocate(wo)
740      deallocate(clwcon0,rnebcon0)
741      deallocate(heat, heat0)
742      deallocate(cool, cool0)
743      deallocate(topsw, toplw)
744      deallocate(sollwdown, sollwdownclr)
745      deallocate(gustiness)
746      deallocate(toplwdown, toplwdownclr)
747      deallocate(topsw0,toplw0,solsw0,sollw0)
748      deallocate(albpla)
749!IM ajout variables CFMIP2/CMIP5
750      deallocate(heatp, coolp)
751      deallocate(heat0p, cool0p)
752      deallocate(radsolp, topswp, toplwp)
753      deallocate(albplap)
754      deallocate(solswp, sollwp)
755      deallocate(sollwdownp)
756      deallocate(topsw0p,toplw0p)
757      deallocate(solsw0p,sollw0p)
758      deallocate(lwdn0p, lwdnp)
759      deallocate(lwup0p, lwupp)
760      deallocate(swdn0p, swdnp)
761      deallocate(swup0p, swupp)
762      deallocate(cape)
763      deallocate(pbase,bbase)
764      deallocate(zqasc)
765      deallocate(ibas_con, itop_con)
766      deallocate(rain_con, snow_con)
767      deallocate(rlonPOS)
768      deallocate(newsst)
769      deallocate(ustar,u10m, v10m,wstar)
770      deallocate(topswad, solswad)
771      deallocate(topswai, solswai)
772      deallocate(tau_aero,piz_aero,cg_aero)
773      deallocate(tau_aero_sw_rrtm,piz_aero_sw_rrtm,cg_aero_sw_rrtm)
774      deallocate(tau_aero_lw_rrtm,piz_aero_lw_rrtm,cg_aero_lw_rrtm)
775      deallocate(ccm)
776      if (ok_gwd_rando) deallocate(du_gwd_rando)
777      if (.not. ok_hines .and. ok_gwd_rando) deallocate(du_gwd_front)
778       
779!!! nrlmd le 10/04/2012
780      deallocate(ale_bl_trig)
781!!! fin nrlmd le 10/04/2012
782
783#ifdef ISO   
784      deallocate(xtsol,fxtevap) 
785      deallocate(xt_ancien,xtl_ancien,xts_ancien, fxtd, dxt_wake, wake_deltaxt)
786      deallocate(xtrain_fall, xtsnow_fall, xtrain_con, xtsnow_con)
787#ifdef ISOTRAC
788      deallocate(bassin_map,boite_map)
789#endif       
790#endif
791
792END SUBROUTINE phys_state_var_end
793
794      END MODULE phys_state_var_mod
Note: See TracBrowser for help on using the repository browser.