source: LMDZ6/branches/LMDZ-QUEST/libf/phylmd/phys_state_var_mod.F90 @ 5407

Last change on this file since 5407 was 3408, checked in by Laurent Fairhead, 6 years ago

Modifications needed for VolMIP diagnostics for IPSLCM6.1.8
NL/LF

  • 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: 28.4 KB
Line 
1!
2! $Id: phys_state_var_mod.F90 3408 2018-10-25 15:23:18Z abarral $
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  ! radiation is called every "radpas" step
19      INTEGER, SAVE :: cvpas   ! convection is called every "cvpas" step
20      INTEGER, SAVE :: cvpas_0 ! reference value for cvpas
21      INTEGER, SAVE :: wkpas   ! wake scheme is called every "wkpas" step
22      REAL, PARAMETER :: missing_val_nf90=nf90_fill_real
23!$OMP THREADPRIVATE(radpas)
24!$OMP THREADPRIVATE(cvpas)
25!$OMP THREADPRIVATE(cvpas_0)
26!$OMP THREADPRIVATE(wkpas)
27      REAL, SAVE :: dtime, solaire_etat0
28!$OMP THREADPRIVATE(dtime, solaire_etat0)
29
30      REAL, ALLOCATABLE, SAVE :: pctsrf(:,:)
31!$OMP THREADPRIVATE(pctsrf)
32      REAL, ALLOCATABLE, SAVE :: ftsol(:,:)
33!$OMP THREADPRIVATE(ftsol)
34      REAL,ALLOCATABLE,SAVE :: qsol(:),fevap(:,:),z0m(:,:),z0h(:,:),agesno(:,:)
35!$OMP THREADPRIVATE(qsol,fevap,z0m,z0h,agesno)
36!FC drag des arbres
37      REAL, ALLOCATABLE, SAVE :: treedrg(:,:,:)
38!$OMP THREADPRIVATE(treedrg)
39
40!      character(len=6), SAVE :: ocean
41!!!!!!$OMP THREADPRIVATE(ocean)
42!      logical, SAVE :: ok_veget
43!!!!!!$OMP THREADPRIVATE(ok_veget)
44      REAL, ALLOCATABLE, SAVE :: falb1(:,:), falb2(:,:)
45!$OMP THREADPRIVATE(falb1, falb2)
46
47!albedo SB >>>
48      REAL, ALLOCATABLE, SAVE :: falb_dif(:,:,:), falb_dir(:,:,:)
49      real, allocatable, save :: chl_con(:)
50!$OMP THREADPRIVATE(falb_dir,falb_dif,chl_con)
51!albedo SB <<<
52
53
54      REAL, ALLOCATABLE, SAVE :: rain_fall(:), snow_fall(:)
55!$OMP THREADPRIVATE( rain_fall, snow_fall)
56      REAL, ALLOCATABLE, SAVE :: solsw(:), sollw(:)
57!$OMP THREADPRIVATE(solsw, sollw)
58      REAL, ALLOCATABLE, SAVE :: radsol(:)
59!$OMP THREADPRIVATE(radsol)
60      REAL, ALLOCATABLE, SAVE :: swradcorr(:)
61!$OMP THREADPRIVATE(swradcorr)
62
63!clesphy0 param physiq
64!
65! Parametres de l'Orographie a l'Echelle Sous-Maille (OESM):
66!
67      REAL, ALLOCATABLE, SAVE :: zmea(:), zstd(:), zsig(:), zgam(:)
68!$OMP THREADPRIVATE(zmea, zstd, zsig, zgam)
69      REAL, ALLOCATABLE, SAVE :: zthe(:), zpic(:), zval(:)
70!$OMP THREADPRIVATE(zthe, zpic, zval)
71!     REAL tabcntr0(100)
72      REAL, ALLOCATABLE, SAVE :: rugoro(:)
73!$OMP THREADPRIVATE(rugoro)
74      REAL, ALLOCATABLE, SAVE :: t_ancien(:,:), q_ancien(:,:)
75!$OMP THREADPRIVATE(t_ancien, q_ancien)
76      REAL, ALLOCATABLE, SAVE :: ql_ancien(:,:), qs_ancien(:,:)
77!$OMP THREADPRIVATE(ql_ancien, qs_ancien)
78      REAL, ALLOCATABLE, SAVE :: prw_ancien(:), prlw_ancien(:), prsw_ancien(:)
79!$OMP THREADPRIVATE(prw_ancien, prlw_ancien, prsw_ancien)
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 :: swdnc0(:,:), swdn0(:,:), swdn(:,:)
116!$OMP THREADPRIVATE(swdnc0,swdn0,swdn)
117      REAL,ALLOCATABLE,SAVE :: swupc0(:,:), swup0(:,:), swup(:,:)
118!$OMP THREADPRIVATE(swupc0, 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 :: lwdnc0(:,:), lwdn0(:,:), lwdn(:,:)
124!$OMP THREADPRIVATE(lwdnc0,lwdn0,lwdn)
125      REAL,ALLOCATABLE,SAVE :: lwupc0(:,:), lwup0(:,:), lwup(:,:)
126!$OMP THREADPRIVATE(lwupc0,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 : convective heating due to unsaturated downdraughts
216      REAL,ALLOCATABLE,SAVE :: ftd(:,:)
217!$OMP THREADPRIVATE(ftd)
218! fqd : convective moistening due to unsaturated downdraughts
219      REAL,ALLOCATABLE,SAVE :: fqd(:,:)     
220!$OMP THREADPRIVATE(fqd)
221!34EK
222! -- Variables de controle de ALE et ALP
223!ALE : Energie disponible pour soulevement : utilisee par la
224!      convection d'Emanuel pour le declenchement et la regulation
225      REAL,ALLOCATABLE,SAVE :: ALE(:)
226!$OMP THREADPRIVATE(ALE)
227!ALP : Puissance  disponible pour soulevement
228      REAL,ALLOCATABLE,SAVE :: ALP(:)
229!$OMP THREADPRIVATE(ALP)
230!
231! nouvelles variables pour le couplage convection-couche limite
232      REAL,ALLOCATABLE,SAVE :: Ale_bl(:)
233!$OMP THREADPRIVATE(Ale_bl)
234      REAL,ALLOCATABLE,SAVE :: Alp_bl(:)
235!$OMP THREADPRIVATE(Alp_bl)
236      INTEGER,ALLOCATABLE,SAVE :: lalim_conv(:)
237!$OMP THREADPRIVATE(lalim_conv)
238      REAL,ALLOCATABLE,SAVE :: wght_th(:,:)
239!$OMP THREADPRIVATE(wght_th)
240      REAL,ALLOCATABLE,SAVE    :: ale_wake(:)
241!$OMP THREADPRIVATE(ale_wake)
242      REAL,ALLOCATABLE,SAVE    :: ale_bl_stat(:)
243!$OMP THREADPRIVATE(ale_bl_stat)
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_s      : fraction surfacique occupee par la poche froide
249! wake_dens   : number of wakes per unit area
250! wake_occ    : occurence of wakes (= 1 if wakes occur, =0 otherwise)
251! wake_Cstar  : vitesse d'etalement de la poche
252! wake_pe     : wake potential energy - WAPE
253! wake_fip    : Gust Front Impinging power - ALP
254      REAL,ALLOCATABLE,SAVE :: wake_deltat(:,:)
255!$OMP THREADPRIVATE(wake_deltat)
256      REAL,ALLOCATABLE,SAVE :: wake_deltaq(:,:)
257!$OMP THREADPRIVATE(wake_deltaq)
258      REAL,ALLOCATABLE,SAVE :: wake_s(:)
259!$OMP THREADPRIVATE(wake_s)
260      REAL,ALLOCATABLE,SAVE :: wake_dens(:)
261!$OMP THREADPRIVATE(wake_dens)
262      REAL,ALLOCATABLE,SAVE :: wake_Cstar(:)
263!$OMP THREADPRIVATE(wake_Cstar)
264      REAL,ALLOCATABLE,SAVE :: wake_pe(:)
265!$OMP THREADPRIVATE(wake_pe)
266      REAL,ALLOCATABLE,SAVE :: wake_fip(:)
267!$OMP THREADPRIVATE(wake_fip)
268!
269!jyg<
270! variables related to the spitting of the PBL between wake and
271! off-wake regions.
272! wake_delta_pbl_TKE : difference TKE_w - TKE_x
273      REAL,ALLOCATABLE,SAVE :: wake_delta_pbl_TKE(:,:,:)
274!$OMP THREADPRIVATE(wake_delta_pbl_TKE)
275!>jyg
276!
277! pfrac_impa : Produits des coefs lessivage impaction
278! pfrac_nucl : Produits des coefs lessivage nucleation
279! pfrac_1nucl: Produits des coefs lessi nucl (alpha = 1)
280      REAL,ALLOCATABLE,SAVE :: pfrac_impa(:,:), pfrac_nucl(:,:)
281!$OMP THREADPRIVATE(pfrac_impa,pfrac_nucl)
282      REAL,ALLOCATABLE,SAVE :: pfrac_1nucl(:,:)
283!$OMP THREADPRIVATE(pfrac_1nucl)
284!
285      REAL,ALLOCATABLE,SAVE :: total_rain(:), nday_rain(:) 
286!$OMP THREADPRIVATE(total_rain,nday_rain)
287! albsol1: albedo du sol total pour SW visible
288! albsol2: albedo du sol total pour SW proche IR
289      REAL,ALLOCATABLE,SAVE :: albsol1(:), albsol2(:)
290!$OMP THREADPRIVATE(albsol1,albsol2)
291
292!albedo SB >>>
293      REAL,ALLOCATABLE,SAVE :: albsol_dif(:,:),albsol_dir(:,:)
294!$OMP THREADPRIVATE(albsol_dif,albsol_dir)
295!albedo SB <<<
296
297
298      REAL, ALLOCATABLE, SAVE:: wo(:, :, :)
299      ! column-density of ozone in a layer, in kilo-Dobsons
300      ! Third dimension has size 1 or 2.
301      ! "wo(:, :, 1)" is for the average day-night field,
302      ! "wo(:, :, 2)" is for daylight time.
303      !$OMP THREADPRIVATE(wo)
304
305! heat : chauffage solaire
306! heat0: chauffage solaire ciel clair
307! cool : refroidissement infrarouge
308! cool0 : refroidissement infrarouge ciel clair
309! sollwdown : downward LW flux at surface
310! sollwdownclr : downward CS LW flux at surface
311! toplwdown : downward CS LW flux at TOA
312! toplwdownclr : downward CS LW flux at TOA
313! heat_volc : chauffage solaire du au volcanisme
314! cool_volc : refroidissement infrarouge du au volcanisme
315      REAL,ALLOCATABLE,SAVE :: clwcon0(:,:),rnebcon0(:,:)
316!$OMP THREADPRIVATE(clwcon0,rnebcon0)
317      REAL,ALLOCATABLE,SAVE :: heat(:,:)   
318!$OMP THREADPRIVATE(heat)
319      REAL,ALLOCATABLE,SAVE :: heat0(:,:)
320!$OMP THREADPRIVATE(heat0)
321      REAL,ALLOCATABLE,SAVE :: cool(:,:)
322!$OMP THREADPRIVATE(cool)
323      REAL,ALLOCATABLE,SAVE :: cool0(:,:)
324!$OMP THREADPRIVATE(cool0)
325      REAL,ALLOCATABLE,SAVE :: heat_volc(:,:)   
326!$OMP THREADPRIVATE(heat_volc)
327      REAL,ALLOCATABLE,SAVE :: cool_volc(:,:)
328!$OMP THREADPRIVATE(cool_volc)
329      REAL,ALLOCATABLE,SAVE :: topsw(:), toplw(:)
330!$OMP THREADPRIVATE(topsw,toplw)
331      REAL,ALLOCATABLE,SAVE :: sollwdown(:)
332!$OMP THREADPRIVATE(sollwdown)
333      REAL,ALLOCATABLE,SAVE :: gustiness(:)
334!$OMP THREADPRIVATE(gustiness)
335      REAL,ALLOCATABLE,SAVE :: sollwdownclr(:)
336!$OMP THREADPRIVATE(sollwdownclr)
337      REAL,ALLOCATABLE,SAVE :: toplwdown(:)
338!$OMP THREADPRIVATE(toplwdown)
339      REAL,ALLOCATABLE,SAVE :: toplwdownclr(:)
340!$OMP THREADPRIVATE(toplwdownclr)
341      REAL,ALLOCATABLE,SAVE :: topsw0(:),toplw0(:),solsw0(:),sollw0(:)
342!$OMP THREADPRIVATE(topsw0,toplw0,solsw0,sollw0)
343      REAL,ALLOCATABLE,SAVE :: albpla(:)
344!$OMP THREADPRIVATE(albpla)
345
346!IM ajout variables CFMIP2/CMIP5
347      REAL,ALLOCATABLE,SAVE :: heatp(:,:), coolp(:,:)
348!$OMP THREADPRIVATE(heatp, coolp)
349      REAL,ALLOCATABLE,SAVE :: heat0p(:,:), cool0p(:,:)
350!$OMP THREADPRIVATE(heat0p, cool0p)
351      REAL,ALLOCATABLE,SAVE :: radsolp(:), topswp(:), toplwp(:)
352!$OMP THREADPRIVATE(radsolp, topswp, toplwp)
353      REAL,ALLOCATABLE,SAVE :: albplap(:)
354!$OMP THREADPRIVATE(albplap)
355      REAL,ALLOCATABLE,SAVE :: solswp(:), sollwp(:)
356!$OMP THREADPRIVATE(solswp, sollwp)
357      REAL,ALLOCATABLE,SAVE :: sollwdownp(:)
358!$OMP THREADPRIVATE(sollwdownp)
359      REAL,ALLOCATABLE,SAVE :: topsw0p(:),toplw0p(:)
360      REAL,ALLOCATABLE,SAVE :: solsw0p(:),sollw0p(:)
361!$OMP THREADPRIVATE(topsw0p,toplw0p,solsw0p,sollw0p)
362      REAL,ALLOCATABLE,SAVE :: lwdnc0p(:,:), lwdn0p(:,:), lwdnp(:,:)
363      REAL,ALLOCATABLE,SAVE :: lwupc0p(:,:), lwup0p(:,:), lwupp(:,:)
364!$OMP THREADPRIVATE(lwdnc0p, lwdn0p, lwdnp, lwupc0p, lwup0p, lwupp)
365      REAL,ALLOCATABLE,SAVE :: swdnc0p(:,:), swdn0p(:,:), swdnp(:,:)
366      REAL,ALLOCATABLE,SAVE :: swupc0p(:,:), swup0p(:,:), swupp(:,:)
367!$OMP THREADPRIVATE(swdnc0p, swdn0p, swdnp, swupc0p, swup0p, swupp)
368
369! pbase : cloud base pressure
370! bbase : cloud base buoyancy
371      REAL,ALLOCATABLE,SAVE :: cape(:)
372!$OMP THREADPRIVATE(cape)
373      REAL,ALLOCATABLE,SAVE :: pbase(:)
374!$OMP THREADPRIVATE(pbase)
375      REAL,ALLOCATABLE,SAVE :: bbase(:)
376!$OMP THREADPRIVATE(bbase)
377!
378      REAL,SAVE,ALLOCATABLE :: zqasc(:,:)
379!$OMP THREADPRIVATE( zqasc)
380      INTEGER,ALLOCATABLE,SAVE :: ibas_con(:), itop_con(:)
381!$OMP THREADPRIVATE(ibas_con,itop_con)
382      REAL,SAVE,ALLOCATABLE :: rain_con(:)
383!$OMP THREADPRIVATE(rain_con)
384      REAL,SAVE,ALLOCATABLE :: snow_con(:)
385!$OMP THREADPRIVATE(snow_con)
386!
387      REAL,SAVE,ALLOCATABLE :: rlonPOS(:)
388!$OMP THREADPRIVATE(rlonPOS)
389      REAL,SAVE,ALLOCATABLE :: newsst(:)
390!$OMP THREADPRIVATE(newsst)
391      REAL,SAVE,ALLOCATABLE :: ustar(:,:),u10m(:,:), v10m(:,:),wstar(:,:)
392!$OMP THREADPRIVATE(ustar,u10m,v10m,wstar)
393!
394! ok_ade=T -ADE=topswad-topsw
395! ok_aie=T ->
396!       ok_ade=T -AIE=topswai-topswad
397!       ok_ade=F -AIE=topswai-topsw
398!
399!topswad, solswad : Aerosol direct effect
400      REAL,SAVE,ALLOCATABLE :: topswad(:), solswad(:)
401!$OMP THREADPRIVATE(topswad,solswad)
402!topswai, solswai : Aerosol indirect effect
403      REAL,SAVE,ALLOCATABLE :: topswai(:), solswai(:)
404!$OMP THREADPRIVATE(topswai,solswai)
405
406      REAL,SAVE,ALLOCATABLE :: tau_aero(:,:,:,:), piz_aero(:,:,:,:), cg_aero(:,:,:,:)
407!$OMP THREADPRIVATE(tau_aero, piz_aero, cg_aero)
408      REAL,SAVE,ALLOCATABLE :: tau_aero_sw_rrtm(:,:,:,:), piz_aero_sw_rrtm(:,:,:,:), cg_aero_sw_rrtm(:,:,:,:)
409!$OMP THREADPRIVATE(tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm)
410      REAL,SAVE,ALLOCATABLE :: tau_aero_lw_rrtm(:,:,:,:), piz_aero_lw_rrtm(:,:,:,:), cg_aero_lw_rrtm(:,:,:,:)
411!$OMP THREADPRIVATE(tau_aero_lw_rrtm, piz_aero_lw_rrtm, cg_aero_lw_rrtm)
412      REAL,SAVE,ALLOCATABLE :: ccm(:,:,:)
413!$OMP THREADPRIVATE(ccm)
414
415!!! nrlmd le 10/04/2012
416      REAL,SAVE,ALLOCATABLE :: ale_bl_trig(:)
417!$OMP THREADPRIVATE(ale_bl_trig)
418!!! fin nrlmd le 10/04/2012
419
420      REAL, ALLOCATABLE, SAVE:: du_gwd_rando(:, :), du_gwd_front(:, :)
421      !$OMP THREADPRIVATE(du_gwd_rando, du_gwd_front)
422      ! tendencies on wind due to gravity waves
423
424CONTAINS
425
426!======================================================================
427SUBROUTINE phys_state_var_init(read_climoz)
428USE dimphy
429USE aero_mod
430USE infotrac_phy, ONLY : nbtr
431USE indice_sol_mod
432IMPLICIT NONE
433
434integer, intent(in)::  read_climoz
435! read ozone climatology
436! Allowed values are 0, 1 and 2
437! 0: do not read an ozone climatology
438! 1: read a single ozone climatology that will be used day and night
439! 2: read two ozone climatologies, the average day and night
440! climatology and the daylight climatology
441
442include "clesphys.h"
443
444      ALLOCATE(pctsrf(klon,nbsrf))
445      ALLOCATE(ftsol(klon,nbsrf))
446      ALLOCATE(qsol(klon),fevap(klon,nbsrf))
447      ALLOCATE(z0m(klon,nbsrf+1),z0h(klon,nbsrf+1),agesno(klon,nbsrf))
448!FC
449      ALLOCATE(treedrg(klon,klev,nbsrf))
450      ALLOCATE(falb1(klon,nbsrf))
451      ALLOCATE(falb2(klon,nbsrf))
452!albedo SB >>>
453      ALLOCATE(falb_dir(klon,nsw,nbsrf),falb_dif(klon,nsw,nbsrf))
454      ALLOCATE(chl_con(klon))
455!albedo SB <<<
456      ALLOCATE(rain_fall(klon))
457      ALLOCATE(snow_fall(klon))
458      ALLOCATE(solsw(klon), sollw(klon))
459      ALLOCATE(radsol(klon))
460      ALLOCATE(swradcorr(klon))
461      ALLOCATE(zmea(klon), zstd(klon), zsig(klon), zgam(klon))
462      ALLOCATE(zthe(klon), zpic(klon), zval(klon))
463
464      ALLOCATE(rugoro(klon))
465      ALLOCATE(t_ancien(klon,klev), q_ancien(klon,klev))
466      ALLOCATE(ql_ancien(klon,klev), qs_ancien(klon,klev))
467      ALLOCATE(prw_ancien(klon), prlw_ancien(klon), prsw_ancien(klon))
468      ALLOCATE(u_ancien(klon,klev), v_ancien(klon,klev))
469!!! Rom P >>>
470      ALLOCATE(tr_ancien(klon,klev,nbtr))
471!!! Rom P <<<
472      ALLOCATE(clwcon(klon,klev),rnebcon(klon,klev))
473      ALLOCATE(qtc_cv(klon,klev),sigt_cv(klon,klev))
474      ALLOCATE(ratqs(klon,klev))
475      ALLOCATE(pbl_tke(klon,klev+1,nbsrf+1))
476!nrlmd<
477      ALLOCATE(delta_tsurf(klon,nbsrf))
478!>nrlmd
479      ALLOCATE(coefh(klon,klev+1,nbsrf+1))
480      ALLOCATE(coefm(klon,klev+1,nbsrf+1))
481      ALLOCATE(zmax0(klon), f0(klon))
482      ALLOCATE(sig1(klon,klev), w01(klon,klev))
483      ALLOCATE(entr_therm(klon,klev), fm_therm(klon,klev+1))
484      ALLOCATE(detr_therm(klon,klev))
485!     pour phsystoke avec thermiques
486      ALLOCATE(clwcon0th(klon,klev),rnebcon0th(klon,klev))
487! radiation outputs
488      ALLOCATE(swdnc0(klon,klevp1), swdn0(klon,klevp1), swdn(klon,klevp1))
489      ALLOCATE(swupc0(klon,klevp1), swup0(klon,klevp1), swup(klon,klevp1))
490      ALLOCATE(lwdnc0(klon,klevp1), lwdn0(klon,klevp1), lwdn(klon,klevp1))
491      ALLOCATE(lwupc0(klon,klevp1), lwup0(klon,klevp1), lwup(klon,klevp1))
492      ALLOCATE(SWdn200clr(klon), SWdn200(klon))
493      ALLOCATE(SWup200clr(klon), SWup200(klon))
494      ALLOCATE(LWdn200clr(klon), LWdn200(klon))
495      ALLOCATE(LWup200clr(klon), LWup200(klon))
496      ALLOCATE(LWdnTOA(klon), LWdnTOAclr(klon))
497! pressure level
498      ALLOCATE(tsumSTD(klon,nlevSTD,nout))
499      ALLOCATE(usumSTD(klon,nlevSTD,nout), vsumSTD(klon,nlevSTD,nout))
500      ALLOCATE(wsumSTD(klon,nlevSTD,nout), phisumSTD(klon,nlevSTD,nout))
501      ALLOCATE(qsumSTD(klon,nlevSTD,nout), rhsumSTD(klon,nlevSTD,nout))
502      ALLOCATE(tnondef(klon,nlevSTD,nout))
503      ALLOCATE(uvsumSTD(klon,nlevSTD,nout))
504      ALLOCATE(vqsumSTD(klon,nlevSTD,nout))
505      ALLOCATE(vTsumSTD(klon,nlevSTD,nout))
506      ALLOCATE(wqsumSTD(klon,nlevSTD,nout))
507      ALLOCATE(vphisumSTD(klon,nlevSTD,nout))
508      ALLOCATE(wTsumSTD(klon,nlevSTD,nout))
509      ALLOCATE(u2sumSTD(klon,nlevSTD,nout))
510      ALLOCATE(v2sumSTD(klon,nlevSTD,nout))
511      ALLOCATE(T2sumSTD(klon,nlevSTD,nout))
512      ALLOCATE(O3sumSTD(klon,nlevSTD,nout))
513      ALLOCATE(O3daysumSTD(klon,nlevSTD,nout))
514!IM beg
515      ALLOCATE(wlevSTD(klon,nlevSTD), ulevSTD(klon,nlevSTD), vlevSTD(klon,nlevSTD))
516      ALLOCATE(tlevSTD(klon,nlevSTD), qlevSTD(klon,nlevSTD), rhlevSTD(klon,nlevSTD))
517      ALLOCATE(philevSTD(klon,nlevSTD))
518      ALLOCATE(uvSTD(klon,nlevSTD),vqSTD(klon,nlevSTD))
519      ALLOCATE(vTSTD(klon,nlevSTD),wqSTD(klon,nlevSTD))
520      ALLOCATE(vphiSTD(klon,nlevSTD),wTSTD(klon,nlevSTD))
521      ALLOCATE(u2STD(klon,nlevSTD),v2STD(klon,nlevSTD))
522      ALLOCATE(T2STD(klon,nlevSTD))
523      ALLOCATE(O3STD(klon,nlevSTD))
524      ALLOCATE(O3daySTD(klon,nlevSTD))
525!IM end
526      ALLOCATE(seed_old(klon,napisccp))
527      ALLOCATE(zuthe(klon),zvthe(klon))
528      ALLOCATE(alb_neig(klon))
529!cloud base mass flux
530      ALLOCATE(ema_cbmf(klon))
531!cloud base pressure & cloud top pressure
532      ALLOCATE(ema_pcb(klon), ema_pct(klon))
533!
534      ALLOCATE(Ma(klon,klev))
535      ALLOCATE(qcondc(klon,klev))
536      ALLOCATE(wd(klon))
537      ALLOCATE(sigd(klon))
538      ALLOCATE(cin(klon), ALE(klon), ALP(klon))
539      ALLOCATE(ftd(klon,klev), fqd(klon,klev))
540      ALLOCATE(Ale_bl(klon))
541      ALLOCATE(ale_wake(klon))
542      ALLOCATE(ale_bl_stat(klon))
543      ALLOCATE(Alp_bl(klon))
544      ALLOCATE(lalim_conv(klon))
545      ALLOCATE(wght_th(klon,klev))
546      ALLOCATE(wake_deltat(klon,klev), wake_deltaq(klon,klev))
547      ALLOCATE(wake_s(klon), wake_dens(klon))
548      ALLOCATE(wake_Cstar(klon))
549      ALLOCATE(wake_pe(klon), wake_fip(klon))
550!jyg<
551      ALLOCATE(wake_delta_pbl_TKE(klon,klev+1,nbsrf+1))
552!>jyg
553      ALLOCATE(pfrac_impa(klon,klev), pfrac_nucl(klon,klev))
554      ALLOCATE(pfrac_1nucl(klon,klev))
555      ALLOCATE(total_rain(klon), nday_rain(klon))
556      ALLOCATE(albsol1(klon), albsol2(klon))
557!albedo SB >>>
558      ALLOCATE(albsol_dir(klon,nsw),albsol_dif(klon,nsw))
559!albedo SB <<<
560
561      if (read_climoz <= 1) then
562         ALLOCATE(wo(klon,klev, 1))
563      else
564         ! read_climoz == 2
565         ALLOCATE(wo(klon,klev, 2))
566      end if
567     
568      ALLOCATE(clwcon0(klon,klev),rnebcon0(klon,klev))
569      ALLOCATE(heat(klon,klev), heat0(klon,klev))
570      ALLOCATE(cool(klon,klev), cool0(klon,klev))
571      ALLOCATE(heat_volc(klon,klev), cool_volc(klon,klev))
572      ALLOCATE(topsw(klon), toplw(klon))
573      ALLOCATE(sollwdown(klon), sollwdownclr(klon))
574      ALLOCATE(toplwdown(klon), toplwdownclr(klon))
575      ALLOCATE(topsw0(klon),toplw0(klon),solsw0(klon),sollw0(klon))
576      ALLOCATE(albpla(klon))
577!IM ajout variables CFMIP2/CMIP5
578      ALLOCATE(heatp(klon,klev), coolp(klon,klev))
579      ALLOCATE(heat0p(klon,klev), cool0p(klon,klev))
580      ALLOCATE(radsolp(klon), topswp(klon), toplwp(klon))
581      ALLOCATE(albplap(klon))
582      ALLOCATE(solswp(klon), sollwp(klon))
583      ALLOCATE(gustiness(klon))
584      ALLOCATE(sollwdownp(klon))
585      ALLOCATE(topsw0p(klon),toplw0p(klon))
586      ALLOCATE(solsw0p(klon),sollw0p(klon))
587      ALLOCATE(lwdnc0p(klon,klevp1), lwdn0p(klon,klevp1), lwdnp(klon,klevp1))
588      ALLOCATE(lwupc0p(klon,klevp1), lwup0p(klon,klevp1), lwupp(klon,klevp1))
589      ALLOCATE(swdnc0p(klon,klevp1), swdn0p(klon,klevp1), swdnp(klon,klevp1))
590      ALLOCATE(swupc0p(klon,klevp1), swup0p(klon,klevp1), swupp(klon,klevp1))
591
592      ALLOCATE(cape(klon))
593      ALLOCATE(pbase(klon),bbase(klon))
594      ALLOCATE(zqasc(klon,klev))
595      ALLOCATE(ibas_con(klon), itop_con(klon))
596      ALLOCATE(rain_con(klon), snow_con(klon))
597      ALLOCATE(rlonPOS(klon))
598      ALLOCATE(newsst(klon))
599      ALLOCATE(ustar(klon,nbsrf),u10m(klon,nbsrf), v10m(klon,nbsrf),wstar(klon,nbsrf+1))
600      ALLOCATE(topswad(klon), solswad(klon))
601      ALLOCATE(topswai(klon), solswai(klon))
602      ALLOCATE(tau_aero(klon,klev,naero_grp,nbands),piz_aero(klon,klev,naero_grp,nbands),cg_aero(klon,klev,naero_grp,nbands))
603      ALLOCATE(tau_aero_sw_rrtm(klon,klev,2,nbands_sw_rrtm),piz_aero_sw_rrtm(klon,klev,2,nbands_sw_rrtm))
604      ALLOCATE(cg_aero_sw_rrtm(klon,klev,2,nbands_sw_rrtm))
605      ALLOCATE(tau_aero_lw_rrtm(klon,klev,2,nbands_lw_rrtm),piz_aero_lw_rrtm(klon,klev,2,nbands_lw_rrtm))
606      ALLOCATE(cg_aero_lw_rrtm(klon,klev,2,nbands_lw_rrtm))
607      ALLOCATE(ccm(klon,klev,nbands))
608
609!!! nrlmd le 10/04/2012
610      ALLOCATE(ale_bl_trig(klon))
611!!! fin nrlmd le 10/04/2012
612      if (ok_gwd_rando) allocate(du_gwd_rando(klon, klev))
613      if (.not. ok_hines .and. ok_gwd_rando) allocate(du_gwd_front(klon, klev))
614
615END SUBROUTINE phys_state_var_init
616
617!======================================================================
618SUBROUTINE phys_state_var_end
619!USE dimphy
620USE indice_sol_mod
621IMPLICIT NONE
622include "clesphys.h"
623
624      deallocate(pctsrf, ftsol, falb1, falb2)
625      deallocate(qsol,fevap,z0m,z0h,agesno)
626!FC
627      deallocate(treedrg)
628      deallocate(rain_fall, snow_fall, solsw, sollw, radsol, swradcorr)
629      deallocate(zmea, zstd, zsig, zgam)
630      deallocate(zthe, zpic, zval)
631      deallocate(rugoro, t_ancien, q_ancien, clwcon, rnebcon)
632      deallocate(qs_ancien, ql_ancien)
633      deallocate(prw_ancien, prlw_ancien, prsw_ancien)
634      deallocate(qtc_cv,sigt_cv)
635      deallocate(u_ancien, v_ancien)
636      deallocate(tr_ancien)                           !RomP
637      deallocate(ratqs, pbl_tke,coefh,coefm)
638!nrlmd<
639      deallocate(delta_tsurf)
640!>nrlmd
641      deallocate(zmax0, f0)
642      deallocate(sig1, w01)
643      deallocate(entr_therm, fm_therm)
644      deallocate(detr_therm)
645      deallocate(clwcon0th, rnebcon0th)
646! radiation outputs
647      deallocate(swdnc0, swdn0, swdn)
648      deallocate(swupc0, swup0, swup)
649      deallocate(lwdnc0, lwdn0, lwdn)
650      deallocate(lwupc0, lwup0, lwup)
651      deallocate(SWdn200clr, SWdn200)
652      deallocate(SWup200clr, SWup200)
653      deallocate(LWdn200clr, LWdn200)
654      deallocate(LWup200clr, LWup200)
655      deallocate(LWdnTOA, LWdnTOAclr)
656! pressure level
657      deallocate(tsumSTD)
658      deallocate(usumSTD, vsumSTD)
659      deallocate(wsumSTD, phisumSTD)
660      deallocate(tnondef)
661      deallocate(qsumSTD, rhsumSTD)
662      deallocate(uvsumSTD)
663      deallocate(vqsumSTD)
664      deallocate(vTsumSTD)
665      deallocate(wqsumSTD)
666      deallocate(vphisumSTD)
667      deallocate(wTsumSTD)
668      deallocate(u2sumSTD)
669      deallocate(v2sumSTD)
670      deallocate(T2sumSTD)
671      deallocate(O3sumSTD)
672      deallocate(O3daysumSTD)
673!IM beg
674      deallocate(wlevSTD,ulevSTD,vlevSTD,tlevSTD,qlevSTD,rhlevSTD,philevSTD)
675      deallocate(uvSTD,vqSTD,vTSTD,wqSTD,vphiSTD,wTSTD,u2STD,v2STD,T2STD,O3STD,O3daySTD)
676!IM end
677      deallocate(seed_old)
678      deallocate(zuthe, zvthe)
679      deallocate(alb_neig)
680      deallocate(ema_cbmf)
681      deallocate(ema_pcb, ema_pct)
682      deallocate(Ma, qcondc)
683      deallocate(wd, sigd)
684      deallocate(cin, ALE, ALP)
685      deallocate(ftd, fqd)
686      deallocate(Ale_bl, Alp_bl)
687      deallocate(ale_wake)
688      deallocate(ale_bl_stat)
689      deallocate(lalim_conv, wght_th)
690      deallocate(wake_deltat, wake_deltaq)
691      deallocate(wake_s, wake_dens)
692      deallocate(wake_Cstar, wake_pe, wake_fip)
693!jyg<
694      deallocate(wake_delta_pbl_TKE)
695!>jyg
696      deallocate(pfrac_impa, pfrac_nucl)
697      deallocate(pfrac_1nucl)
698      deallocate(total_rain, nday_rain)
699      deallocate(albsol1, albsol2)
700!albedo SB >>>
701      deallocate(albsol_dir,albsol_dif,falb_dir,falb_dif,chl_con)
702!albedo SB <<<
703      deallocate(wo)
704      deallocate(clwcon0,rnebcon0)
705      deallocate(heat, heat0)
706      deallocate(cool, cool0)
707      deallocate(heat_volc, cool_volc)
708      deallocate(topsw, toplw)
709      deallocate(sollwdown, sollwdownclr)
710      deallocate(gustiness)
711      deallocate(toplwdown, toplwdownclr)
712      deallocate(topsw0,toplw0,solsw0,sollw0)
713      deallocate(albpla)
714!IM ajout variables CFMIP2/CMIP5
715      deallocate(heatp, coolp)
716      deallocate(heat0p, cool0p)
717      deallocate(radsolp, topswp, toplwp)
718      deallocate(albplap)
719      deallocate(solswp, sollwp)
720      deallocate(sollwdownp)
721      deallocate(topsw0p,toplw0p)
722      deallocate(solsw0p,sollw0p)
723      deallocate(lwdnc0p, lwdn0p, lwdnp)
724      deallocate(lwupc0p, lwup0p, lwupp)
725      deallocate(swdnc0p, swdn0p, swdnp)
726      deallocate(swupc0p, swup0p, swupp)
727      deallocate(cape)
728      deallocate(pbase,bbase)
729      deallocate(zqasc)
730      deallocate(ibas_con, itop_con)
731      deallocate(rain_con, snow_con)
732      deallocate(rlonPOS)
733      deallocate(newsst)
734      deallocate(ustar,u10m, v10m,wstar)
735      deallocate(topswad, solswad)
736      deallocate(topswai, solswai)
737      deallocate(tau_aero,piz_aero,cg_aero)
738      deallocate(tau_aero_sw_rrtm,piz_aero_sw_rrtm,cg_aero_sw_rrtm)
739      deallocate(tau_aero_lw_rrtm,piz_aero_lw_rrtm,cg_aero_lw_rrtm)
740      deallocate(ccm)
741      if (ok_gwd_rando) deallocate(du_gwd_rando)
742      if (.not. ok_hines .and. ok_gwd_rando) deallocate(du_gwd_front)
743       
744!!! nrlmd le 10/04/2012
745      deallocate(ale_bl_trig)
746!!! fin nrlmd le 10/04/2012
747
748END SUBROUTINE phys_state_var_end
749
750      END MODULE phys_state_var_mod
Note: See TracBrowser for help on using the repository browser.