source: LMDZ4/branches/LMDZ4V5.0-dev/libf/phylmd/phys_state_var_mod.F90 @ 1373

Last change on this file since 1373 was 1361, checked in by Ehouarn Millour, 15 years ago

Bug fix: missing threadprivate OMP instructions

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