source: LMDZ4/trunk/libf/phylmd/phys_state_var_mod.F90 @ 1357

Last change on this file since 1357 was 1352, checked in by musat, 15 years ago

Add 3 output files for standard pressure levels AR5 exercice and flags
to manage their computation and output frequencies
histhfNMC.nc with 3 standard pressure levels
histdayNMC.nc with 8 (or may have 17) standard pressure levels
histmthNMC.nc with 17 standard pressure levels
Add 3 flags in the physiq.def file: freq_calNMC(3), freq_outNMC(3) and lev_histdayNMC
freq_calNMC(3) : computation frequency of variables on standard pressure levels

and by default has fallowing values (in fact physics' time step dtime)

freq_calNMC(1)=900.
freq_calNMC(2)=900.
freq_calNMC(3)=900.
freq_outNMC(3) : output frequency of variables on standard pressure levels

with following default values

freq_out(1) = 2592000. (30 days)
freq_out(2) = 86400. (1 day)
freq_out(3) = 21600. (6 hours)
lev_histdayNMC is 8 by default but may be switched to 17 (if we need more levels for a particular run)
IM

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