source: LMDZ5/branches/LMDZ6_rc0/libf/phylmd/phys_state_var_mod.F90 @ 3069

Last change on this file since 3069 was 2283, checked in by Laurent Fairhead, 9 years ago

Backport of trunk revisions 2271, 2279, 2280, 2282 into LMDZ6_rc0 branch:

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