source: LMDZ5/branches/LF-private/libf/phylmd/phys_state_var_mod.F90 @ 5434

Last change on this file since 5434 was 1827, checked in by lguez, 11 years ago

Changed names of variables ema_work1 and ema_work2 to more meaningful
sig1 and w01. Same change in (re)startphy.nc. phyetat0 tries to find
old names ema_work1 and ema_work2 if new names sig1 and w01 are not
found, so the program can run with an old restartphy.nc. restartphy.nc
is modified compared to the previous SVN revision because of the change of
names but the data content is not modified (this can be checked with
max_diff_nc.sh -i).

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 23.4 KB
Line 
1!
2! $Id: phys_state_var_mod.F90 1827 2013-08-06 13:33:18Z fhourdin $
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      INTEGER, PARAMETER :: nlevSTD=17
13      INTEGER, PARAMETER :: nlevSTD8=8
14      INTEGER, PARAMETER :: nlevSTD3=3
15      INTEGER, PARAMETER :: nout=3
16      INTEGER, PARAMETER :: napisccp=1
17      INTEGER, SAVE :: radpas
18!$OMP THREADPRIVATE(radpas)
19      REAL, SAVE :: dtime, solaire_etat0
20!$OMP THREADPRIVATE(dtime, solaire_etat0)
21
22      REAL, ALLOCATABLE, SAVE :: rlat(:), rlon(:), pctsrf(:,:)
23!$OMP THREADPRIVATE(rlat, rlon, pctsrf)
24      REAL, ALLOCATABLE, SAVE :: ftsol(:,:)
25!$OMP THREADPRIVATE(ftsol)
26!      character(len=6), SAVE :: ocean
27!!!!!!$OMP THREADPRIVATE(ocean)
28!      logical, SAVE :: ok_veget
29!!!!!!$OMP THREADPRIVATE(ok_veget)
30      REAL, ALLOCATABLE, SAVE :: falb1(:,:), falb2(:,:)
31!$OMP THREADPRIVATE(falb1, falb2)
32      REAL, ALLOCATABLE, SAVE :: rain_fall(:), snow_fall(:)
33!$OMP THREADPRIVATE( rain_fall, snow_fall)
34      REAL, ALLOCATABLE, SAVE :: solsw(:), sollw(:)
35!$OMP THREADPRIVATE(solsw, sollw)
36      REAL, ALLOCATABLE, SAVE :: radsol(:)
37!$OMP THREADPRIVATE(radsol)
38
39!clesphy0 param physiq
40!
41! Parametres de l'Orographie a l'Echelle Sous-Maille (OESM):
42!
43      REAL, ALLOCATABLE, SAVE :: zmea(:), zstd(:), zsig(:), zgam(:)
44!$OMP THREADPRIVATE(zmea, zstd, zsig, zgam)
45      REAL, ALLOCATABLE, SAVE :: zthe(:), zpic(:), zval(:)
46!$OMP THREADPRIVATE(zthe, zpic, zval)
47!     REAL tabcntr0(100)
48      REAL, ALLOCATABLE, SAVE :: rugoro(:)
49!$OMP THREADPRIVATE(rugoro)
50      REAL, ALLOCATABLE, SAVE :: t_ancien(:,:), q_ancien(:,:)
51!$OMP THREADPRIVATE(t_ancien, q_ancien)
52      REAL, ALLOCATABLE, SAVE :: u_ancien(:,:), v_ancien(:,:)
53!$OMP THREADPRIVATE(u_ancien, v_ancien)
54!!! RomP >>>
55      REAL, ALLOCATABLE, SAVE :: tr_ancien(:,:,:)
56!$OMP THREADPRIVATE(tr_ancien)
57!!! RomP <<<
58      LOGICAL, SAVE :: ancien_ok
59!$OMP THREADPRIVATE(ancien_ok)
60      REAL, ALLOCATABLE, SAVE :: clwcon(:,:),rnebcon(:,:)
61!$OMP THREADPRIVATE(clwcon,rnebcon)
62      REAL, ALLOCATABLE, SAVE :: ratqs(:,:)
63!$OMP THREADPRIVATE(ratqs)
64      REAL, ALLOCATABLE, SAVE :: pbl_tke(:,:,:) ! turb kinetic energy
65      REAL, ALLOCATABLE, SAVE :: coefh(:,:,:) ! Kz enthalpie
66      REAL, ALLOCATABLE, SAVE :: coefm(:,:,:) ! Kz momentum
67!$OMP THREADPRIVATE(pbl_tke, coefh,coefm)
68      REAL, ALLOCATABLE, SAVE :: zmax0(:), f0(:) !
69!$OMP THREADPRIVATE(zmax0,f0)
70      REAL, ALLOCATABLE, SAVE :: sig1(:,:), w01(:,:)
71!$OMP THREADPRIVATE(sig1,w01)
72      REAL, ALLOCATABLE, SAVE :: entr_therm(:,:), fm_therm(:,:)
73!$OMP THREADPRIVATE(entr_therm,fm_therm)
74      REAL, ALLOCATABLE, SAVE :: detr_therm(:,:)
75!$OMP THREADPRIVATE(detr_therm)
76!IM 150408
77!     pour phsystoke avec thermiques
78      REAL,ALLOCATABLE,SAVE :: clwcon0th(:,:),rnebcon0th(:,:)
79!$OMP THREADPRIVATE(clwcon0th,rnebcon0th)
80! radiation outputs
81      REAL,ALLOCATABLE,SAVE :: swdn0(:,:), swdn(:,:)
82!$OMP THREADPRIVATE(swdn0,swdn)
83      REAL,ALLOCATABLE,SAVE :: swup0(:,:), swup(:,:)
84!$OMP THREADPRIVATE(swup0,swup)
85      REAL,ALLOCATABLE,SAVE :: SWdn200clr(:), SWdn200(:)
86!$OMP THREADPRIVATE(SWdn200clr,SWdn200)
87      REAL,ALLOCATABLE,SAVE :: SWup200clr(:), SWup200(:)
88!$OMP THREADPRIVATE(SWup200clr,SWup200)
89      REAL,ALLOCATABLE,SAVE :: lwdn0(:,:), lwdn(:,:)
90!$OMP THREADPRIVATE(lwdn0,lwdn)
91      REAL,ALLOCATABLE,SAVE :: lwup0(:,:), lwup(:,:)
92!$OMP THREADPRIVATE(lwup0,lwup)
93      REAL,ALLOCATABLE,SAVE :: LWdn200clr(:), LWdn200(:)
94!$OMP THREADPRIVATE(LWdn200clr,LWdn200)
95      REAL,ALLOCATABLE,SAVE :: LWup200clr(:), LWup200(:)
96!$OMP THREADPRIVATE(LWup200clr,LWup200)
97      REAL,ALLOCATABLE,SAVE :: LWdnTOA(:), LWdnTOAclr(:)
98!$OMP THREADPRIVATE(LWdnTOA,LWdnTOAclr)
99! pressure level
100      REAL,ALLOCATABLE,SAVE :: tsumSTD(:,:,:)
101!$OMP THREADPRIVATE(tsumSTD)
102      REAL,ALLOCATABLE,SAVE :: usumSTD(:,:,:), vsumSTD(:,:,:)
103!$OMP THREADPRIVATE(usumSTD,vsumSTD)
104      REAL,ALLOCATABLE,SAVE :: wsumSTD(:,:,:), phisumSTD(:,:,:)
105!$OMP THREADPRIVATE(wsumSTD,phisumSTD)
106      REAL,ALLOCATABLE,SAVE :: qsumSTD(:,:,:), rhsumSTD(:,:,:)
107!$OMP THREADPRIVATE(qsumSTD,rhsumSTD)
108      REAL,ALLOCATABLE,SAVE :: tnondef(:,:,:)
109!$OMP THREADPRIVATE(tnondef)
110      REAL,ALLOCATABLE,SAVE :: uvsumSTD(:,:,:)
111!$OMP THREADPRIVATE(uvsumSTD)
112      REAL,ALLOCATABLE,SAVE :: vqsumSTD(:,:,:)
113!$OMP THREADPRIVATE(vqsumSTD)
114      REAL,ALLOCATABLE,SAVE :: vTsumSTD(:,:,:)
115!$OMP THREADPRIVATE(vTsumSTD)
116      REAL,ALLOCATABLE,SAVE :: wqsumSTD(:,:,:)
117!$OMP THREADPRIVATE(wqsumSTD)
118      REAL,ALLOCATABLE,SAVE :: vphisumSTD(:,:,:)
119!$OMP THREADPRIVATE(vphisumSTD)
120      REAL,ALLOCATABLE,SAVE :: wTsumSTD(:,:,:)
121!$OMP THREADPRIVATE(wTsumSTD)
122      REAL,ALLOCATABLE,SAVE :: u2sumSTD(:,:,:)
123!$OMP THREADPRIVATE(u2sumSTD)
124      REAL,ALLOCATABLE,SAVE :: v2sumSTD(:,:,:)
125!$OMP THREADPRIVATE(v2sumSTD)
126      REAL,ALLOCATABLE,SAVE :: T2sumSTD(:,:,:)
127!$OMP THREADPRIVATE(T2sumSTD)
128      REAL,ALLOCATABLE,SAVE :: O3sumSTD(:,:,:), O3daysumSTD(:,:,:)
129!$OMP THREADPRIVATE(O3sumSTD,O3daysumSTD)
130!IM begin
131      REAL,ALLOCATABLE,SAVE :: wlevSTD(:,:), ulevSTD(:,:), vlevSTD(:,:)
132!$OMP THREADPRIVATE(wlevSTD,ulevSTD,vlevSTD)
133      REAL,ALLOCATABLE,SAVE :: tlevSTD(:,:), qlevSTD(:,:), rhlevSTD(:,:)
134!$OMP THREADPRIVATE(tlevSTD,qlevSTD,rhlevSTD)
135      REAL,ALLOCATABLE,SAVE :: philevSTD(:,:)
136!$OMP THREADPRIVATE(philevSTD)
137      REAL,ALLOCATABLE,SAVE :: uvSTD(:,:)
138!$OMP THREADPRIVATE(uvSTD)
139      REAL,ALLOCATABLE,SAVE :: vqSTD(:,:)
140!$OMP THREADPRIVATE(vqSTD)
141      REAL,ALLOCATABLE,SAVE :: vTSTD(:,:)
142!$OMP THREADPRIVATE(vTSTD)
143      REAL,ALLOCATABLE,SAVE :: wqSTD(:,:)
144!$OMP THREADPRIVATE(wqSTD)
145      REAL,ALLOCATABLE,SAVE :: vphiSTD(:,:)
146!$OMP THREADPRIVATE(vphiSTD)
147      REAL,ALLOCATABLE,SAVE :: wTSTD(:,:)
148!$OMP THREADPRIVATE(wTSTD)
149      REAL,ALLOCATABLE,SAVE :: u2STD(:,:)
150!$OMP THREADPRIVATE(u2STD)
151      REAL,ALLOCATABLE,SAVE :: v2STD(:,:)
152!$OMP THREADPRIVATE(v2STD)
153      REAL,ALLOCATABLE,SAVE :: T2STD(:,:)
154!$OMP THREADPRIVATE(T2STD)
155      REAL,ALLOCATABLE,SAVE :: O3STD(:,:), O3daySTD(:,:)
156!$OMP THREADPRIVATE(O3STD,O3daySTD)
157!IM end
158      INTEGER,ALLOCATABLE,SAVE :: seed_old(:,:)
159!$OMP THREADPRIVATE(seed_old)
160      REAL,ALLOCATABLE,SAVE :: zuthe(:),zvthe(:)
161!$OMP THREADPRIVATE(zuthe,zvthe)
162      REAL,ALLOCATABLE,SAVE :: alb_neig(:)
163!$OMP THREADPRIVATE(alb_neig)
164!cloud base mass flux
165      REAL,ALLOCATABLE,SAVE :: ema_cbmf(:)
166!$OMP THREADPRIVATE(ema_cbmf)
167!cloud base pressure & cloud top pressure
168      REAL,ALLOCATABLE,SAVE :: ema_pcb(:), ema_pct(:)
169!$OMP THREADPRIVATE(ema_pcb,ema_pct)
170      REAL,ALLOCATABLE,SAVE :: Ma(:,:)        ! undilute upward mass flux
171!$OMP THREADPRIVATE(Ma)
172      REAL,ALLOCATABLE,SAVE :: qcondc(:,:)    ! in-cld water content from convect
173!$OMP THREADPRIVATE(qcondc)
174      REAL,ALLOCATABLE,SAVE :: wd(:) ! sb
175!$OMP THREADPRIVATE(wd)
176      REAL,ALLOCATABLE,SAVE :: sigd(:)
177!$OMP THREADPRIVATE(sigd)
178!
179      REAL,ALLOCATABLE,SAVE :: cin(:)
180!$OMP THREADPRIVATE(cin)
181! ftd : differential heating between wake and environment
182      REAL,ALLOCATABLE,SAVE :: ftd(:,:)
183!$OMP THREADPRIVATE(ftd)
184! fqd : differential moistening between wake and environment
185      REAL,ALLOCATABLE,SAVE :: fqd(:,:)     
186!$OMP THREADPRIVATE(fqd)
187!34EK
188! -- Variables de controle de ALE et ALP
189!ALE : Energie disponible pour soulevement : utilisee par la
190!      convection d'Emanuel pour le declenchement et la regulation
191      REAL,ALLOCATABLE,SAVE :: ALE(:)
192!$OMP THREADPRIVATE(ALE)
193!ALP : Puissance  disponible pour soulevement
194      REAL,ALLOCATABLE,SAVE :: ALP(:)
195!$OMP THREADPRIVATE(ALP)
196!
197! nouvelles variables pour le couplage convection-couche limite
198      REAL,ALLOCATABLE,SAVE :: Ale_bl(:)
199!$OMP THREADPRIVATE(Ale_bl)
200      REAL,ALLOCATABLE,SAVE :: Alp_bl(:)
201!$OMP THREADPRIVATE(Alp_bl)
202      INTEGER,ALLOCATABLE,SAVE :: lalim_conv(:)
203!$OMP THREADPRIVATE(lalim_conv)
204      REAL,ALLOCATABLE,SAVE :: wght_th(:,:)
205!$OMP THREADPRIVATE(wght_th)
206!
207! variables de la wake
208! wake_deltat : ecart de temperature avec la zone non perturbee
209! wake_deltaq : ecart d'humidite avec la zone non perturbee
210! wake_Cstar  : vitesse d'etalement de la poche
211! wake_s      : fraction surfacique occupee par la poche froide
212! wake_pe     : wake potential energy - WAPE
213! wake_fip    : Gust Front Impinging power - ALP
214! dt_wake, dq_wake: LS tendencies due to wake
215      REAL,ALLOCATABLE,SAVE :: wake_deltat(:,:)
216!$OMP THREADPRIVATE(wake_deltat)
217      REAL,ALLOCATABLE,SAVE :: wake_deltaq(:,:)
218!$OMP THREADPRIVATE(wake_deltaq)
219      REAL,ALLOCATABLE,SAVE :: wake_Cstar(:)
220!$OMP THREADPRIVATE(wake_Cstar)
221      REAL,ALLOCATABLE,SAVE :: wake_s(:)
222!$OMP THREADPRIVATE(wake_s)
223      REAL,ALLOCATABLE,SAVE :: wake_pe(:)
224!$OMP THREADPRIVATE(wake_pe)
225      REAL,ALLOCATABLE,SAVE :: wake_fip(:)
226!$OMP THREADPRIVATE(wake_fip)
227      REAL,ALLOCATABLE,SAVE :: dt_wake(:,:)
228!$OMP THREADPRIVATE(dt_wake)
229      REAL,ALLOCATABLE,SAVE :: dq_wake(:,:)
230!$OMP THREADPRIVATE(dq_wake)
231!
232! pfrac_impa : Produits des coefs lessivage impaction
233! pfrac_nucl : Produits des coefs lessivage nucleation
234! pfrac_1nucl: Produits des coefs lessi nucl (alpha = 1)
235      REAL,ALLOCATABLE,SAVE :: pfrac_impa(:,:), pfrac_nucl(:,:)
236!$OMP THREADPRIVATE(pfrac_impa,pfrac_nucl)
237      REAL,ALLOCATABLE,SAVE :: pfrac_1nucl(:,:)
238!$OMP THREADPRIVATE(pfrac_1nucl)
239!
240      REAL,ALLOCATABLE,SAVE :: total_rain(:), nday_rain(:) 
241!$OMP THREADPRIVATE(total_rain,nday_rain)
242      REAL,ALLOCATABLE,SAVE :: paire_ter(:)
243!$OMP THREADPRIVATE(paire_ter)
244! albsol1: albedo du sol total pour SW visible
245! albsol2: albedo du sol total pour SW proche IR
246      REAL,ALLOCATABLE,SAVE :: albsol1(:), albsol2(:)
247!$OMP THREADPRIVATE(albsol1,albsol2)
248
249      REAL, ALLOCATABLE, SAVE:: wo(:, :, :)
250      ! column-density of ozone in a layer, in kilo-Dobsons
251      ! Third dimension has size 1 or 2.
252      ! "wo(:, :, 1)" is for the average day-night field,
253      ! "wo(:, :, 2)" is for daylight time.
254      !$OMP THREADPRIVATE(wo)
255
256! heat : chauffage solaire
257! heat0: chauffage solaire ciel clair
258! cool : refroidissement infrarouge
259! cool0 : refroidissement infrarouge ciel clair
260! sollwdown : downward LW flux at surface
261! sollwdownclr : downward CS LW flux at surface
262! toplwdown : downward CS LW flux at TOA
263! toplwdownclr : downward CS LW flux at TOA
264      REAL,ALLOCATABLE,SAVE :: clwcon0(:,:),rnebcon0(:,:)
265!$OMP THREADPRIVATE(clwcon0,rnebcon0)
266      REAL,ALLOCATABLE,SAVE :: heat(:,:)   
267!$OMP THREADPRIVATE(heat)
268      REAL,ALLOCATABLE,SAVE :: heat0(:,:)
269!$OMP THREADPRIVATE(heat0)
270      REAL,ALLOCATABLE,SAVE :: cool(:,:)
271!$OMP THREADPRIVATE(cool)
272      REAL,ALLOCATABLE,SAVE :: cool0(:,:)
273!$OMP THREADPRIVATE(cool0)
274      REAL,ALLOCATABLE,SAVE :: topsw(:), toplw(:)
275!$OMP THREADPRIVATE(topsw,toplw)
276      REAL,ALLOCATABLE,SAVE :: sollwdown(:)
277!$OMP THREADPRIVATE(sollwdown)
278      REAL,ALLOCATABLE,SAVE :: sollwdownclr(:)
279!$OMP THREADPRIVATE(sollwdownclr)
280      REAL,ALLOCATABLE,SAVE :: toplwdown(:)
281!$OMP THREADPRIVATE(toplwdown)
282      REAL,ALLOCATABLE,SAVE :: toplwdownclr(:)
283!$OMP THREADPRIVATE(toplwdownclr)
284      REAL,ALLOCATABLE,SAVE :: topsw0(:),toplw0(:),solsw0(:),sollw0(:)
285!$OMP THREADPRIVATE(topsw0,toplw0,solsw0,sollw0)
286      REAL,ALLOCATABLE,SAVE :: albpla(:)
287!$OMP THREADPRIVATE(albpla)
288
289!IM ajout variables CFMIP2/CMIP5
290      REAL,ALLOCATABLE,SAVE :: heatp(:,:), coolp(:,:)
291!$OMP THREADPRIVATE(heatp, coolp)
292      REAL,ALLOCATABLE,SAVE :: heat0p(:,:), cool0p(:,:)
293!$OMP THREADPRIVATE(heat0p, cool0p)
294      REAL,ALLOCATABLE,SAVE :: radsolp(:), topswp(:), toplwp(:)
295!$OMP THREADPRIVATE(radsolp, topswp, toplwp)
296      REAL,ALLOCATABLE,SAVE :: albplap(:)
297!$OMP THREADPRIVATE(albplap)
298      REAL,ALLOCATABLE,SAVE :: solswp(:), sollwp(:)
299!$OMP THREADPRIVATE(solswp, sollwp)
300      REAL,ALLOCATABLE,SAVE :: sollwdownp(:)
301!$OMP THREADPRIVATE(sollwdownp)
302      REAL,ALLOCATABLE,SAVE :: topsw0p(:),toplw0p(:)
303      REAL,ALLOCATABLE,SAVE :: solsw0p(:),sollw0p(:)
304!$OMP THREADPRIVATE(topsw0p,toplw0p,solsw0p,sollw0p)
305      REAL,ALLOCATABLE,SAVE :: lwdn0p(:,:), lwdnp(:,:)
306      REAL,ALLOCATABLE,SAVE :: lwup0p(:,:), lwupp(:,:)
307!$OMP THREADPRIVATE(lwdn0p, lwdnp, lwup0p, lwupp)
308      REAL,ALLOCATABLE,SAVE :: swdn0p(:,:), swdnp(:,:)
309      REAL,ALLOCATABLE,SAVE :: swup0p(:,:), swupp(:,:)
310!$OMP THREADPRIVATE(swdn0p, swdnp, swup0p, swupp)
311
312! pbase : cloud base pressure
313! bbase : cloud base buoyancy
314      REAL,ALLOCATABLE,SAVE :: cape(:)
315!$OMP THREADPRIVATE(cape)
316      REAL,ALLOCATABLE,SAVE :: pbase(:)
317!$OMP THREADPRIVATE(pbase)
318      REAL,ALLOCATABLE,SAVE :: bbase(:)
319!$OMP THREADPRIVATE(bbase)
320!
321      REAL,SAVE,ALLOCATABLE :: zqasc(:,:)
322!$OMP THREADPRIVATE( zqasc)
323      INTEGER,ALLOCATABLE,SAVE :: ibas_con(:), itop_con(:)
324!$OMP THREADPRIVATE(ibas_con,itop_con)
325      REAL,SAVE,ALLOCATABLE :: rain_con(:)
326!$OMP THREADPRIVATE(rain_con)
327      REAL,SAVE,ALLOCATABLE :: snow_con(:)
328!$OMP THREADPRIVATE(snow_con)
329!
330      REAL,SAVE,ALLOCATABLE :: rlonPOS(:)
331!$OMP THREADPRIVATE(rlonPOS)
332      REAL,SAVE,ALLOCATABLE :: newsst(:)
333!$OMP THREADPRIVATE(newsst)
334      REAL,SAVE,ALLOCATABLE :: ustar(:,:),u10m(:,:), v10m(:,:),wstar(:,:)
335!$OMP THREADPRIVATE(ustar,u10m,v10m,wstar)
336!
337! ok_ade=T -ADE=topswad-topsw
338! ok_aie=T ->
339!       ok_ade=T -AIE=topswai-topswad
340!       ok_ade=F -AIE=topswai-topsw
341!
342!topswad, solswad : Aerosol direct effect
343      REAL,SAVE,ALLOCATABLE :: topswad(:), solswad(:)
344!$OMP THREADPRIVATE(topswad,solswad)
345!topswai, solswai : Aerosol indirect effect
346      REAL,SAVE,ALLOCATABLE :: topswai(:), solswai(:)
347!$OMP THREADPRIVATE(topswai,solswai)
348
349      REAL,SAVE,ALLOCATABLE :: tau_aero(:,:,:,:), piz_aero(:,:,:,:), cg_aero(:,:,:,:)
350!$OMP THREADPRIVATE(tau_aero, piz_aero, cg_aero)
351      REAL,SAVE,ALLOCATABLE :: ccm(:,:,:)
352!$OMP THREADPRIVATE(ccm)
353
354!!! nrlmd le 10/04/2012
355      REAL,SAVE,ALLOCATABLE :: ale_bl_trig(:)
356!$OMP THREADPRIVATE(ale_bl_trig)
357!!! fin nrlmd le 10/04/2012
358
359CONTAINS
360
361!======================================================================
362SUBROUTINE phys_state_var_init(read_climoz)
363USE dimphy
364USE control_mod
365USE aero_mod
366USE infotrac, ONLY : nbtr
367USE indice_sol_mod
368IMPLICIT NONE
369
370integer, intent(in)::  read_climoz
371! read ozone climatology
372! Allowed values are 0, 1 and 2
373! 0: do not read an ozone climatology
374! 1: read a single ozone climatology that will be used day and night
375! 2: read two ozone climatologies, the average day and night
376! climatology and the daylight climatology
377
378      ALLOCATE(rlat(klon), rlon(klon))
379      ALLOCATE(pctsrf(klon,nbsrf))
380      ALLOCATE(ftsol(klon,nbsrf))
381      ALLOCATE(falb1(klon,nbsrf))
382      ALLOCATE(falb2(klon,nbsrf))
383      ALLOCATE(rain_fall(klon))
384      ALLOCATE(snow_fall(klon))
385      ALLOCATE(solsw(klon), sollw(klon))
386      ALLOCATE(radsol(klon))
387      ALLOCATE(zmea(klon), zstd(klon), zsig(klon), zgam(klon))
388      ALLOCATE(zthe(klon), zpic(klon), zval(klon))
389
390      ALLOCATE(rugoro(klon))
391      ALLOCATE(t_ancien(klon,klev), q_ancien(klon,klev))
392      ALLOCATE(u_ancien(klon,klev), v_ancien(klon,klev))
393!!! Rom P >>>
394      ALLOCATE(tr_ancien(klon,klev,nbtr))
395!!! Rom P <<<
396      ALLOCATE(clwcon(klon,klev),rnebcon(klon,klev))
397      ALLOCATE(ratqs(klon,klev))
398      ALLOCATE(pbl_tke(klon,klev+1,nbsrf+1))
399      ALLOCATE(coefh(klon,klev+1,nbsrf+1))
400      ALLOCATE(coefm(klon,klev+1,nbsrf+1))
401      ALLOCATE(zmax0(klon), f0(klon))
402      ALLOCATE(sig1(klon,klev), w01(klon,klev))
403      ALLOCATE(entr_therm(klon,klev), fm_therm(klon,klev+1))
404      ALLOCATE(detr_therm(klon,klev))
405!     pour phsystoke avec thermiques
406      ALLOCATE(clwcon0th(klon,klev),rnebcon0th(klon,klev))
407! radiation outputs
408      ALLOCATE(swdn0(klon,klevp1), swdn(klon,klevp1))
409      ALLOCATE(swup0(klon,klevp1), swup(klon,klevp1))
410      ALLOCATE(lwdn0(klon,klevp1), lwdn(klon,klevp1))
411      ALLOCATE(lwup0(klon,klevp1), lwup(klon,klevp1))
412      ALLOCATE(SWdn200clr(klon), SWdn200(klon))
413      ALLOCATE(SWup200clr(klon), SWup200(klon))
414      ALLOCATE(LWdn200clr(klon), LWdn200(klon))
415      ALLOCATE(LWup200clr(klon), LWup200(klon))
416      ALLOCATE(LWdnTOA(klon), LWdnTOAclr(klon))
417! pressure level
418      ALLOCATE(tsumSTD(klon,nlevSTD,nout))
419      ALLOCATE(usumSTD(klon,nlevSTD,nout), vsumSTD(klon,nlevSTD,nout))
420      ALLOCATE(wsumSTD(klon,nlevSTD,nout), phisumSTD(klon,nlevSTD,nout))
421      ALLOCATE(qsumSTD(klon,nlevSTD,nout), rhsumSTD(klon,nlevSTD,nout))
422      ALLOCATE(tnondef(klon,nlevSTD,nout))
423      ALLOCATE(uvsumSTD(klon,nlevSTD,nout))
424      ALLOCATE(vqsumSTD(klon,nlevSTD,nout))
425      ALLOCATE(vTsumSTD(klon,nlevSTD,nout))
426      ALLOCATE(wqsumSTD(klon,nlevSTD,nout))
427      ALLOCATE(vphisumSTD(klon,nlevSTD,nout))
428      ALLOCATE(wTsumSTD(klon,nlevSTD,nout))
429      ALLOCATE(u2sumSTD(klon,nlevSTD,nout))
430      ALLOCATE(v2sumSTD(klon,nlevSTD,nout))
431      ALLOCATE(T2sumSTD(klon,nlevSTD,nout))
432      ALLOCATE(O3sumSTD(klon,nlevSTD,nout))
433      ALLOCATE(O3daysumSTD(klon,nlevSTD,nout))
434!IM beg
435      ALLOCATE(wlevSTD(klon,nlevSTD), ulevSTD(klon,nlevSTD), vlevSTD(klon,nlevSTD))
436      ALLOCATE(tlevSTD(klon,nlevSTD), qlevSTD(klon,nlevSTD), rhlevSTD(klon,nlevSTD))
437      ALLOCATE(philevSTD(klon,nlevSTD))
438      ALLOCATE(uvSTD(klon,nlevSTD),vqSTD(klon,nlevSTD))
439      ALLOCATE(vTSTD(klon,nlevSTD),wqSTD(klon,nlevSTD))
440      ALLOCATE(vphiSTD(klon,nlevSTD),wTSTD(klon,nlevSTD))
441      ALLOCATE(u2STD(klon,nlevSTD),v2STD(klon,nlevSTD))
442      ALLOCATE(T2STD(klon,nlevSTD))
443      ALLOCATE(O3STD(klon,nlevSTD))
444      ALLOCATE(O3daySTD(klon,nlevSTD))
445!IM end
446      ALLOCATE(seed_old(klon,napisccp))
447      ALLOCATE(zuthe(klon),zvthe(klon))
448      ALLOCATE(alb_neig(klon))
449!cloud base mass flux
450      ALLOCATE(ema_cbmf(klon))
451!cloud base pressure & cloud top pressure
452      ALLOCATE(ema_pcb(klon), ema_pct(klon))
453!
454      ALLOCATE(Ma(klon,klev))
455      ALLOCATE(qcondc(klon,klev))
456      ALLOCATE(wd(klon))
457      ALLOCATE(sigd(klon))
458      ALLOCATE(cin(klon), ALE(klon), ALP(klon))
459      ALLOCATE(ftd(klon,klev), fqd(klon,klev))
460      ALLOCATE(Ale_bl(klon))
461      ALLOCATE(Alp_bl(klon))
462      ALLOCATE(lalim_conv(klon))
463      ALLOCATE(wght_th(klon,klev))
464      ALLOCATE(wake_deltat(klon,klev), wake_deltaq(klon,klev))
465      ALLOCATE(wake_Cstar(klon), wake_s(klon))
466      ALLOCATE(wake_pe(klon), wake_fip(klon))
467      ALLOCATE(dt_wake(klon,klev), dq_wake(klon,klev))
468      ALLOCATE(pfrac_impa(klon,klev), pfrac_nucl(klon,klev))
469      ALLOCATE(pfrac_1nucl(klon,klev))
470      ALLOCATE(total_rain(klon), nday_rain(klon))
471      ALLOCATE(paire_ter(klon))
472      ALLOCATE(albsol1(klon), albsol2(klon))
473
474      if (read_climoz <= 1) then
475         ALLOCATE(wo(klon,klev, 1))
476      else
477         ! read_climoz == 2
478         ALLOCATE(wo(klon,klev, 2))
479      end if
480     
481      ALLOCATE(clwcon0(klon,klev),rnebcon0(klon,klev))
482      ALLOCATE(heat(klon,klev), heat0(klon,klev))
483      ALLOCATE(cool(klon,klev), cool0(klon,klev))
484      ALLOCATE(topsw(klon), toplw(klon))
485      ALLOCATE(sollwdown(klon), sollwdownclr(klon))
486      ALLOCATE(toplwdown(klon), toplwdownclr(klon))
487      ALLOCATE(topsw0(klon),toplw0(klon),solsw0(klon),sollw0(klon))
488      ALLOCATE(albpla(klon))
489!IM ajout variables CFMIP2/CMIP5
490      ALLOCATE(heatp(klon,klev), coolp(klon,klev))
491      ALLOCATE(heat0p(klon,klev), cool0p(klon,klev))
492      ALLOCATE(radsolp(klon), topswp(klon), toplwp(klon))
493      ALLOCATE(albplap(klon))
494      ALLOCATE(solswp(klon), sollwp(klon))
495      ALLOCATE(sollwdownp(klon))
496      ALLOCATE(topsw0p(klon),toplw0p(klon))
497      ALLOCATE(solsw0p(klon),sollw0p(klon))
498      ALLOCATE(lwdn0p(klon,klevp1), lwdnp(klon,klevp1))
499      ALLOCATE(lwup0p(klon,klevp1), lwupp(klon,klevp1))
500      ALLOCATE(swdn0p(klon,klevp1), swdnp(klon,klevp1))
501      ALLOCATE(swup0p(klon,klevp1), swupp(klon,klevp1))
502
503      ALLOCATE(cape(klon))
504      ALLOCATE(pbase(klon),bbase(klon))
505      ALLOCATE(zqasc(klon,klev))
506      ALLOCATE(ibas_con(klon), itop_con(klon))
507      ALLOCATE(rain_con(klon), snow_con(klon))
508      ALLOCATE(rlonPOS(klon))
509      ALLOCATE(newsst(klon))
510      ALLOCATE(ustar(klon,nbsrf),u10m(klon,nbsrf), v10m(klon,nbsrf),wstar(klon,nbsrf+1))
511      ALLOCATE(topswad(klon), solswad(klon))
512      ALLOCATE(topswai(klon), solswai(klon))
513      ALLOCATE(tau_aero(klon,klev,naero_grp,nbands),piz_aero(klon,klev,naero_grp,nbands),cg_aero(klon,klev,naero_grp,nbands))
514      ALLOCATE(ccm(klon,klev,nbands))
515
516!!! nrlmd le 10/04/2012
517      ALLOCATE(ale_bl_trig(klon))
518!!! fin nrlmd le 10/04/2012
519
520END SUBROUTINE phys_state_var_init
521
522!======================================================================
523SUBROUTINE phys_state_var_end
524USE dimphy
525USE control_mod
526USE indice_sol_mod
527IMPLICIT NONE
528
529      deallocate(rlat, rlon, pctsrf, ftsol, falb1, falb2)
530      deallocate(rain_fall, snow_fall, solsw, sollw, radsol)
531      deallocate(zmea, zstd, zsig, zgam)
532      deallocate(zthe, zpic, zval)
533      deallocate(rugoro, t_ancien, q_ancien, clwcon, rnebcon)
534      deallocate(        u_ancien, v_ancien                 )
535      deallocate(        tr_ancien)                           !RomP
536      deallocate(ratqs, pbl_tke,coefh,coefm)
537      deallocate(zmax0, f0)
538      deallocate(sig1, w01)
539      deallocate(entr_therm, fm_therm)
540      deallocate(detr_therm)
541      deallocate(clwcon0th, rnebcon0th)
542! radiation outputs
543      deallocate(swdn0, swdn)
544      deallocate(swup0, swup)
545      deallocate(lwdn0, lwdn)
546      deallocate(lwup0, lwup)
547      deallocate(SWdn200clr, SWdn200)
548      deallocate(SWup200clr, SWup200)
549      deallocate(LWdn200clr, LWdn200)
550      deallocate(LWup200clr, LWup200)
551      deallocate(LWdnTOA, LWdnTOAclr)
552! pressure level
553      deallocate(tsumSTD)
554      deallocate(usumSTD, vsumSTD)
555      deallocate(wsumSTD, phisumSTD)
556      deallocate(tnondef)
557      deallocate(qsumSTD, rhsumSTD)
558      deallocate(uvsumSTD)
559      deallocate(vqsumSTD)
560      deallocate(vTsumSTD)
561      deallocate(wqsumSTD)
562      deallocate(vphisumSTD)
563      deallocate(wTsumSTD)
564      deallocate(u2sumSTD)
565      deallocate(v2sumSTD)
566      deallocate(T2sumSTD)
567      deallocate(O3sumSTD)
568      deallocate(O3daysumSTD)
569!IM beg
570      deallocate(wlevSTD,ulevSTD,vlevSTD,tlevSTD,qlevSTD,rhlevSTD,philevSTD)
571      deallocate(uvSTD,vqSTD,vTSTD,wqSTD,vphiSTD,wTSTD,u2STD,v2STD,T2STD,O3STD,O3daySTD)
572!IM end
573      deallocate(seed_old)
574      deallocate(zuthe, zvthe)
575      deallocate(alb_neig)
576      deallocate(ema_cbmf)
577      deallocate(ema_pcb, ema_pct)
578      deallocate(Ma, qcondc)
579      deallocate(wd, sigd)
580      deallocate(cin, ALE, ALP)
581      deallocate(ftd, fqd)
582      deallocate(Ale_bl, Alp_bl)
583      deallocate(lalim_conv, wght_th)
584      deallocate(wake_deltat, wake_deltaq)
585      deallocate(wake_Cstar, wake_s, wake_pe, wake_fip)
586      deallocate(dt_wake, dq_wake)
587      deallocate(pfrac_impa, pfrac_nucl)
588      deallocate(pfrac_1nucl)
589      deallocate(total_rain, nday_rain)
590      deallocate(paire_ter)
591      deallocate(albsol1, albsol2)
592      deallocate(wo)
593      deallocate(clwcon0,rnebcon0)
594      deallocate(heat, heat0)
595      deallocate(cool, cool0)
596      deallocate(topsw, toplw)
597      deallocate(sollwdown, sollwdownclr)
598      deallocate(toplwdown, toplwdownclr)
599      deallocate(topsw0,toplw0,solsw0,sollw0)
600      deallocate(albpla)
601!IM ajout variables CFMIP2/CMIP5
602      deallocate(heatp, coolp)
603      deallocate(heat0p, cool0p)
604      deallocate(radsolp, topswp, toplwp)
605      deallocate(albplap)
606      deallocate(solswp, sollwp)
607      deallocate(sollwdownp)
608      deallocate(topsw0p,toplw0p)
609      deallocate(solsw0p,sollw0p)
610      deallocate(lwdn0p, lwdnp)
611      deallocate(lwup0p, lwupp)
612      deallocate(swdn0p, swdnp)
613      deallocate(swup0p, swupp)
614      deallocate(cape)
615      deallocate(pbase,bbase)
616      deallocate(zqasc)
617      deallocate(ibas_con, itop_con)
618      deallocate(rain_con, snow_con)
619      deallocate(rlonPOS)
620      deallocate(newsst)
621      deallocate(ustar,u10m, v10m,wstar)
622      deallocate(topswad, solswad)
623      deallocate(topswai, solswai)
624      deallocate(tau_aero,piz_aero,cg_aero)
625      deallocate(ccm)
626       
627!!! nrlmd le 10/04/2012
628      deallocate(ale_bl_trig)
629!!! fin nrlmd le 10/04/2012
630
631END SUBROUTINE phys_state_var_end
632
633      END MODULE phys_state_var_mod
Note: See TracBrowser for help on using the repository browser.