source: LMDZ6/branches/IPSLCM6.0.14/libf/phylmd/phys_state_var_mod.F90 @ 3557

Last change on this file since 3557 was 3106, checked in by oboucher, 7 years ago

Adding clear-sky clean (no aerosol) LW radiative fluxes at TOA and SFC as diagnostic

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