source: LMDZ5/trunk/libf/phylmd/phys_state_var_mod.F90 @ 2153

Last change on this file since 2153 was 2146, checked in by idelkadi, 10 years ago

Les modifications introduites ont pour but :
1/ d'autoriser le couplage entre INCA-aerosol et les parametrisations de
la nouvelle physique (NP) de LMDZ, en particulier les thermiques et le
transport convectif,
2/ generaliser les routines de calcul de proprietes optiques des
aerosols pour RRTM au cas ou les aerosols sont interactifs
3/ d'inclure les effets LW des aerosols stratospheriques pour RRTM

  • 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: 24.5 KB
Line 
1!
2! $Id: phys_state_var_mod.F90 2146 2014-11-14 20:22:21Z lguez $
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 :: tau_aero_sw_rrtm(:,:,:,:), piz_aero_sw_rrtm(:,:,:,:), cg_aero_sw_rrtm(:,:,:,:)
352!$OMP THREADPRIVATE(tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm)
353      REAL,SAVE,ALLOCATABLE :: tau_aero_lw_rrtm(:,:,:,:), piz_aero_lw_rrtm(:,:,:,:), cg_aero_lw_rrtm(:,:,:,:)
354!$OMP THREADPRIVATE(tau_aero_lw_rrtm, piz_aero_lw_rrtm, cg_aero_lw_rrtm)
355      REAL,SAVE,ALLOCATABLE :: ccm(:,:,:)
356!$OMP THREADPRIVATE(ccm)
357
358!!! nrlmd le 10/04/2012
359      REAL,SAVE,ALLOCATABLE :: ale_bl_trig(:)
360!$OMP THREADPRIVATE(ale_bl_trig)
361!!! fin nrlmd le 10/04/2012
362
363      REAL, ALLOCATABLE, SAVE:: du_gwd_rando(:, :), dv_gwd_rando(:, :)
364      !$OMP THREADPRIVATE(du_gwd_rando, dv_gwd_rando)
365      ! tendencies on wind due to gravity waves
366
367CONTAINS
368
369!======================================================================
370SUBROUTINE phys_state_var_init(read_climoz)
371USE dimphy
372USE control_mod
373USE aero_mod
374USE infotrac, ONLY : nbtr
375USE indice_sol_mod
376IMPLICIT NONE
377
378integer, intent(in)::  read_climoz
379! read ozone climatology
380! Allowed values are 0, 1 and 2
381! 0: do not read an ozone climatology
382! 1: read a single ozone climatology that will be used day and night
383! 2: read two ozone climatologies, the average day and night
384! climatology and the daylight climatology
385
386include "clesphys.h"
387      ALLOCATE(rlat(klon), rlon(klon))
388      ALLOCATE(pctsrf(klon,nbsrf))
389      ALLOCATE(ftsol(klon,nbsrf))
390      ALLOCATE(falb1(klon,nbsrf))
391      ALLOCATE(falb2(klon,nbsrf))
392      ALLOCATE(rain_fall(klon))
393      ALLOCATE(snow_fall(klon))
394      ALLOCATE(solsw(klon), sollw(klon))
395      ALLOCATE(radsol(klon))
396      ALLOCATE(zmea(klon), zstd(klon), zsig(klon), zgam(klon))
397      ALLOCATE(zthe(klon), zpic(klon), zval(klon))
398
399      ALLOCATE(rugoro(klon))
400      ALLOCATE(t_ancien(klon,klev), q_ancien(klon,klev))
401      ALLOCATE(u_ancien(klon,klev), v_ancien(klon,klev))
402!!! Rom P >>>
403      ALLOCATE(tr_ancien(klon,klev,nbtr))
404!!! Rom P <<<
405      ALLOCATE(clwcon(klon,klev),rnebcon(klon,klev))
406      ALLOCATE(ratqs(klon,klev))
407      ALLOCATE(pbl_tke(klon,klev+1,nbsrf+1))
408      ALLOCATE(coefh(klon,klev+1,nbsrf+1))
409      ALLOCATE(coefm(klon,klev+1,nbsrf+1))
410      ALLOCATE(zmax0(klon), f0(klon))
411      ALLOCATE(sig1(klon,klev), w01(klon,klev))
412      ALLOCATE(entr_therm(klon,klev), fm_therm(klon,klev+1))
413      ALLOCATE(detr_therm(klon,klev))
414!     pour phsystoke avec thermiques
415      ALLOCATE(clwcon0th(klon,klev),rnebcon0th(klon,klev))
416! radiation outputs
417      ALLOCATE(swdn0(klon,klevp1), swdn(klon,klevp1))
418      ALLOCATE(swup0(klon,klevp1), swup(klon,klevp1))
419      ALLOCATE(lwdn0(klon,klevp1), lwdn(klon,klevp1))
420      ALLOCATE(lwup0(klon,klevp1), lwup(klon,klevp1))
421      ALLOCATE(SWdn200clr(klon), SWdn200(klon))
422      ALLOCATE(SWup200clr(klon), SWup200(klon))
423      ALLOCATE(LWdn200clr(klon), LWdn200(klon))
424      ALLOCATE(LWup200clr(klon), LWup200(klon))
425      ALLOCATE(LWdnTOA(klon), LWdnTOAclr(klon))
426! pressure level
427      ALLOCATE(tsumSTD(klon,nlevSTD,nout))
428      ALLOCATE(usumSTD(klon,nlevSTD,nout), vsumSTD(klon,nlevSTD,nout))
429      ALLOCATE(wsumSTD(klon,nlevSTD,nout), phisumSTD(klon,nlevSTD,nout))
430      ALLOCATE(qsumSTD(klon,nlevSTD,nout), rhsumSTD(klon,nlevSTD,nout))
431      ALLOCATE(tnondef(klon,nlevSTD,nout))
432      ALLOCATE(uvsumSTD(klon,nlevSTD,nout))
433      ALLOCATE(vqsumSTD(klon,nlevSTD,nout))
434      ALLOCATE(vTsumSTD(klon,nlevSTD,nout))
435      ALLOCATE(wqsumSTD(klon,nlevSTD,nout))
436      ALLOCATE(vphisumSTD(klon,nlevSTD,nout))
437      ALLOCATE(wTsumSTD(klon,nlevSTD,nout))
438      ALLOCATE(u2sumSTD(klon,nlevSTD,nout))
439      ALLOCATE(v2sumSTD(klon,nlevSTD,nout))
440      ALLOCATE(T2sumSTD(klon,nlevSTD,nout))
441      ALLOCATE(O3sumSTD(klon,nlevSTD,nout))
442      ALLOCATE(O3daysumSTD(klon,nlevSTD,nout))
443!IM beg
444      ALLOCATE(wlevSTD(klon,nlevSTD), ulevSTD(klon,nlevSTD), vlevSTD(klon,nlevSTD))
445      ALLOCATE(tlevSTD(klon,nlevSTD), qlevSTD(klon,nlevSTD), rhlevSTD(klon,nlevSTD))
446      ALLOCATE(philevSTD(klon,nlevSTD))
447      ALLOCATE(uvSTD(klon,nlevSTD),vqSTD(klon,nlevSTD))
448      ALLOCATE(vTSTD(klon,nlevSTD),wqSTD(klon,nlevSTD))
449      ALLOCATE(vphiSTD(klon,nlevSTD),wTSTD(klon,nlevSTD))
450      ALLOCATE(u2STD(klon,nlevSTD),v2STD(klon,nlevSTD))
451      ALLOCATE(T2STD(klon,nlevSTD))
452      ALLOCATE(O3STD(klon,nlevSTD))
453      ALLOCATE(O3daySTD(klon,nlevSTD))
454!IM end
455      ALLOCATE(seed_old(klon,napisccp))
456      ALLOCATE(zuthe(klon),zvthe(klon))
457      ALLOCATE(alb_neig(klon))
458!cloud base mass flux
459      ALLOCATE(ema_cbmf(klon))
460!cloud base pressure & cloud top pressure
461      ALLOCATE(ema_pcb(klon), ema_pct(klon))
462!
463      ALLOCATE(Ma(klon,klev))
464      ALLOCATE(qcondc(klon,klev))
465      ALLOCATE(wd(klon))
466      ALLOCATE(sigd(klon))
467      ALLOCATE(cin(klon), ALE(klon), ALP(klon))
468      ALLOCATE(ftd(klon,klev), fqd(klon,klev))
469      ALLOCATE(Ale_bl(klon))
470      ALLOCATE(Alp_bl(klon))
471      ALLOCATE(lalim_conv(klon))
472      ALLOCATE(wght_th(klon,klev))
473      ALLOCATE(wake_deltat(klon,klev), wake_deltaq(klon,klev))
474      ALLOCATE(wake_Cstar(klon), wake_s(klon))
475      ALLOCATE(wake_pe(klon), wake_fip(klon))
476      ALLOCATE(dt_wake(klon,klev), dq_wake(klon,klev))
477      ALLOCATE(pfrac_impa(klon,klev), pfrac_nucl(klon,klev))
478      ALLOCATE(pfrac_1nucl(klon,klev))
479      ALLOCATE(total_rain(klon), nday_rain(klon))
480      ALLOCATE(paire_ter(klon))
481      ALLOCATE(albsol1(klon), albsol2(klon))
482
483      if (read_climoz <= 1) then
484         ALLOCATE(wo(klon,klev, 1))
485      else
486         ! read_climoz == 2
487         ALLOCATE(wo(klon,klev, 2))
488      end if
489     
490      ALLOCATE(clwcon0(klon,klev),rnebcon0(klon,klev))
491      ALLOCATE(heat(klon,klev), heat0(klon,klev))
492      ALLOCATE(cool(klon,klev), cool0(klon,klev))
493      ALLOCATE(topsw(klon), toplw(klon))
494      ALLOCATE(sollwdown(klon), sollwdownclr(klon))
495      ALLOCATE(toplwdown(klon), toplwdownclr(klon))
496      ALLOCATE(topsw0(klon),toplw0(klon),solsw0(klon),sollw0(klon))
497      ALLOCATE(albpla(klon))
498!IM ajout variables CFMIP2/CMIP5
499      ALLOCATE(heatp(klon,klev), coolp(klon,klev))
500      ALLOCATE(heat0p(klon,klev), cool0p(klon,klev))
501      ALLOCATE(radsolp(klon), topswp(klon), toplwp(klon))
502      ALLOCATE(albplap(klon))
503      ALLOCATE(solswp(klon), sollwp(klon))
504      ALLOCATE(sollwdownp(klon))
505      ALLOCATE(topsw0p(klon),toplw0p(klon))
506      ALLOCATE(solsw0p(klon),sollw0p(klon))
507      ALLOCATE(lwdn0p(klon,klevp1), lwdnp(klon,klevp1))
508      ALLOCATE(lwup0p(klon,klevp1), lwupp(klon,klevp1))
509      ALLOCATE(swdn0p(klon,klevp1), swdnp(klon,klevp1))
510      ALLOCATE(swup0p(klon,klevp1), swupp(klon,klevp1))
511
512      ALLOCATE(cape(klon))
513      ALLOCATE(pbase(klon),bbase(klon))
514      ALLOCATE(zqasc(klon,klev))
515      ALLOCATE(ibas_con(klon), itop_con(klon))
516      ALLOCATE(rain_con(klon), snow_con(klon))
517      ALLOCATE(rlonPOS(klon))
518      ALLOCATE(newsst(klon))
519      ALLOCATE(ustar(klon,nbsrf),u10m(klon,nbsrf), v10m(klon,nbsrf),wstar(klon,nbsrf+1))
520      ALLOCATE(topswad(klon), solswad(klon))
521      ALLOCATE(topswai(klon), solswai(klon))
522      ALLOCATE(tau_aero(klon,klev,naero_grp,nbands),piz_aero(klon,klev,naero_grp,nbands),cg_aero(klon,klev,naero_grp,nbands))
523      ALLOCATE(tau_aero_sw_rrtm(klon,klev,2,nbands_sw_rrtm),piz_aero_sw_rrtm(klon,klev,2,nbands_sw_rrtm))
524      ALLOCATE(cg_aero_sw_rrtm(klon,klev,2,nbands_sw_rrtm))
525      ALLOCATE(tau_aero_lw_rrtm(klon,klev,2,nbands_lw_rrtm),piz_aero_lw_rrtm(klon,klev,2,nbands_lw_rrtm))
526      ALLOCATE(cg_aero_lw_rrtm(klon,klev,2,nbands_lw_rrtm))
527      ALLOCATE(ccm(klon,klev,nbands))
528
529!!! nrlmd le 10/04/2012
530      ALLOCATE(ale_bl_trig(klon))
531!!! fin nrlmd le 10/04/2012
532      if (ok_gwd_rando) allocate(du_gwd_rando(klon, klev), &
533           dv_gwd_rando(klon, klev))
534
535END SUBROUTINE phys_state_var_init
536
537!======================================================================
538SUBROUTINE phys_state_var_end
539USE dimphy
540USE control_mod
541USE indice_sol_mod
542IMPLICIT NONE
543include "clesphys.h"
544
545      deallocate(rlat, rlon, pctsrf, ftsol, falb1, falb2)
546      deallocate(rain_fall, snow_fall, solsw, sollw, radsol)
547      deallocate(zmea, zstd, zsig, zgam)
548      deallocate(zthe, zpic, zval)
549      deallocate(rugoro, t_ancien, q_ancien, clwcon, rnebcon)
550      deallocate(        u_ancien, v_ancien                 )
551      deallocate(        tr_ancien)                           !RomP
552      deallocate(ratqs, pbl_tke,coefh,coefm)
553      deallocate(zmax0, f0)
554      deallocate(sig1, w01)
555      deallocate(entr_therm, fm_therm)
556      deallocate(detr_therm)
557      deallocate(clwcon0th, rnebcon0th)
558! radiation outputs
559      deallocate(swdn0, swdn)
560      deallocate(swup0, swup)
561      deallocate(lwdn0, lwdn)
562      deallocate(lwup0, lwup)
563      deallocate(SWdn200clr, SWdn200)
564      deallocate(SWup200clr, SWup200)
565      deallocate(LWdn200clr, LWdn200)
566      deallocate(LWup200clr, LWup200)
567      deallocate(LWdnTOA, LWdnTOAclr)
568! pressure level
569      deallocate(tsumSTD)
570      deallocate(usumSTD, vsumSTD)
571      deallocate(wsumSTD, phisumSTD)
572      deallocate(tnondef)
573      deallocate(qsumSTD, rhsumSTD)
574      deallocate(uvsumSTD)
575      deallocate(vqsumSTD)
576      deallocate(vTsumSTD)
577      deallocate(wqsumSTD)
578      deallocate(vphisumSTD)
579      deallocate(wTsumSTD)
580      deallocate(u2sumSTD)
581      deallocate(v2sumSTD)
582      deallocate(T2sumSTD)
583      deallocate(O3sumSTD)
584      deallocate(O3daysumSTD)
585!IM beg
586      deallocate(wlevSTD,ulevSTD,vlevSTD,tlevSTD,qlevSTD,rhlevSTD,philevSTD)
587      deallocate(uvSTD,vqSTD,vTSTD,wqSTD,vphiSTD,wTSTD,u2STD,v2STD,T2STD,O3STD,O3daySTD)
588!IM end
589      deallocate(seed_old)
590      deallocate(zuthe, zvthe)
591      deallocate(alb_neig)
592      deallocate(ema_cbmf)
593      deallocate(ema_pcb, ema_pct)
594      deallocate(Ma, qcondc)
595      deallocate(wd, sigd)
596      deallocate(cin, ALE, ALP)
597      deallocate(ftd, fqd)
598      deallocate(Ale_bl, Alp_bl)
599      deallocate(lalim_conv, wght_th)
600      deallocate(wake_deltat, wake_deltaq)
601      deallocate(wake_Cstar, wake_s, wake_pe, wake_fip)
602      deallocate(dt_wake, dq_wake)
603      deallocate(pfrac_impa, pfrac_nucl)
604      deallocate(pfrac_1nucl)
605      deallocate(total_rain, nday_rain)
606      deallocate(paire_ter)
607      deallocate(albsol1, albsol2)
608      deallocate(wo)
609      deallocate(clwcon0,rnebcon0)
610      deallocate(heat, heat0)
611      deallocate(cool, cool0)
612      deallocate(topsw, toplw)
613      deallocate(sollwdown, sollwdownclr)
614      deallocate(toplwdown, toplwdownclr)
615      deallocate(topsw0,toplw0,solsw0,sollw0)
616      deallocate(albpla)
617!IM ajout variables CFMIP2/CMIP5
618      deallocate(heatp, coolp)
619      deallocate(heat0p, cool0p)
620      deallocate(radsolp, topswp, toplwp)
621      deallocate(albplap)
622      deallocate(solswp, sollwp)
623      deallocate(sollwdownp)
624      deallocate(topsw0p,toplw0p)
625      deallocate(solsw0p,sollw0p)
626      deallocate(lwdn0p, lwdnp)
627      deallocate(lwup0p, lwupp)
628      deallocate(swdn0p, swdnp)
629      deallocate(swup0p, swupp)
630      deallocate(cape)
631      deallocate(pbase,bbase)
632      deallocate(zqasc)
633      deallocate(ibas_con, itop_con)
634      deallocate(rain_con, snow_con)
635      deallocate(rlonPOS)
636      deallocate(newsst)
637      deallocate(ustar,u10m, v10m,wstar)
638      deallocate(topswad, solswad)
639      deallocate(topswai, solswai)
640      deallocate(tau_aero,piz_aero,cg_aero)
641      deallocate(tau_aero_sw_rrtm,piz_aero_sw_rrtm,cg_aero_sw_rrtm)
642      deallocate(tau_aero_lw_rrtm,piz_aero_lw_rrtm,cg_aero_lw_rrtm)
643      deallocate(ccm)
644      if (ok_gwd_rando) deallocate(du_gwd_rando, dv_gwd_rando)
645       
646!!! nrlmd le 10/04/2012
647      deallocate(ale_bl_trig)
648!!! fin nrlmd le 10/04/2012
649
650END SUBROUTINE phys_state_var_end
651
652      END MODULE phys_state_var_mod
Note: See TracBrowser for help on using the repository browser.