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

Last change on this file since 3900 was 2952, checked in by Laurent Fairhead, 7 years ago

Parametrization of drag by copses
Need version 4465 of ORCHIDEE at least

  1. Cheruy
  • 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.1 KB
Line 
1!
2! $Id: phys_state_var_mod.F90 2952 2017-07-14 20:23:40Z evignon $
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 :: swdn0(:,:), swdn(:,:)
114!$OMP THREADPRIVATE(swdn0,swdn)
115      REAL,ALLOCATABLE,SAVE :: swup0(:,:), swup(:,:)
116!$OMP THREADPRIVATE(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 :: lwdn0(:,:), lwdn(:,:)
122!$OMP THREADPRIVATE(lwdn0,lwdn)
123      REAL,ALLOCATABLE,SAVE :: lwup0(:,:), lwup(:,:)
124!$OMP THREADPRIVATE(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!
239! variables de la wake
240! wake_deltat : ecart de temperature avec la zone non perturbee
241! wake_deltaq : ecart d'humidite avec la zone non perturbee
242! wake_s      : fraction surfacique occupee par la poche froide
243! wake_dens   : number of wakes per unit area
244! wake_occ    : occurence of wakes (= 1 if wakes occur, =0 otherwise)
245! wake_Cstar  : vitesse d'etalement de la poche
246! wake_pe     : wake potential energy - WAPE
247! wake_fip    : Gust Front Impinging power - ALP
248      REAL,ALLOCATABLE,SAVE :: wake_deltat(:,:)
249!$OMP THREADPRIVATE(wake_deltat)
250      REAL,ALLOCATABLE,SAVE :: wake_deltaq(:,:)
251!$OMP THREADPRIVATE(wake_deltaq)
252      REAL,ALLOCATABLE,SAVE :: wake_s(:)
253!$OMP THREADPRIVATE(wake_s)
254      REAL,ALLOCATABLE,SAVE :: wake_dens(:)
255!$OMP THREADPRIVATE(wake_dens)
256      REAL,ALLOCATABLE,SAVE :: wake_Cstar(:)
257!$OMP THREADPRIVATE(wake_Cstar)
258      REAL,ALLOCATABLE,SAVE :: wake_pe(:)
259!$OMP THREADPRIVATE(wake_pe)
260      REAL,ALLOCATABLE,SAVE :: wake_fip(:)
261!$OMP THREADPRIVATE(wake_fip)
262!
263!jyg<
264! variables related to the spitting of the PBL between wake and
265! off-wake regions.
266! wake_delta_pbl_TKE : difference TKE_w - TKE_x
267      REAL,ALLOCATABLE,SAVE :: wake_delta_pbl_TKE(:,:,:)
268!$OMP THREADPRIVATE(wake_delta_pbl_TKE)
269!>jyg
270!
271! pfrac_impa : Produits des coefs lessivage impaction
272! pfrac_nucl : Produits des coefs lessivage nucleation
273! pfrac_1nucl: Produits des coefs lessi nucl (alpha = 1)
274      REAL,ALLOCATABLE,SAVE :: pfrac_impa(:,:), pfrac_nucl(:,:)
275!$OMP THREADPRIVATE(pfrac_impa,pfrac_nucl)
276      REAL,ALLOCATABLE,SAVE :: pfrac_1nucl(:,:)
277!$OMP THREADPRIVATE(pfrac_1nucl)
278!
279      REAL,ALLOCATABLE,SAVE :: total_rain(:), nday_rain(:) 
280!$OMP THREADPRIVATE(total_rain,nday_rain)
281! albsol1: albedo du sol total pour SW visible
282! albsol2: albedo du sol total pour SW proche IR
283      REAL,ALLOCATABLE,SAVE :: albsol1(:), albsol2(:)
284!$OMP THREADPRIVATE(albsol1,albsol2)
285
286!albedo SB >>>
287      REAL,ALLOCATABLE,SAVE :: albsol_dif(:,:),albsol_dir(:,:)
288!$OMP THREADPRIVATE(albsol_dif,albsol_dir)
289!albedo SB <<<
290
291
292      REAL, ALLOCATABLE, SAVE:: wo(:, :, :)
293      ! column-density of ozone in a layer, in kilo-Dobsons
294      ! Third dimension has size 1 or 2.
295      ! "wo(:, :, 1)" is for the average day-night field,
296      ! "wo(:, :, 2)" is for daylight time.
297      !$OMP THREADPRIVATE(wo)
298
299! heat : chauffage solaire
300! heat0: chauffage solaire ciel clair
301! cool : refroidissement infrarouge
302! cool0 : refroidissement infrarouge ciel clair
303! sollwdown : downward LW flux at surface
304! sollwdownclr : downward CS LW flux at surface
305! toplwdown : downward CS LW flux at TOA
306! toplwdownclr : downward CS LW flux at TOA
307      REAL,ALLOCATABLE,SAVE :: clwcon0(:,:),rnebcon0(:,:)
308!$OMP THREADPRIVATE(clwcon0,rnebcon0)
309      REAL,ALLOCATABLE,SAVE :: heat(:,:)   
310!$OMP THREADPRIVATE(heat)
311      REAL,ALLOCATABLE,SAVE :: heat0(:,:)
312!$OMP THREADPRIVATE(heat0)
313      REAL,ALLOCATABLE,SAVE :: cool(:,:)
314!$OMP THREADPRIVATE(cool)
315      REAL,ALLOCATABLE,SAVE :: cool0(:,:)
316!$OMP THREADPRIVATE(cool0)
317      REAL,ALLOCATABLE,SAVE :: topsw(:), toplw(:)
318!$OMP THREADPRIVATE(topsw,toplw)
319      REAL,ALLOCATABLE,SAVE :: sollwdown(:)
320!$OMP THREADPRIVATE(sollwdown)
321      REAL,ALLOCATABLE,SAVE :: gustiness(:)
322!$OMP THREADPRIVATE(gustiness)
323      REAL,ALLOCATABLE,SAVE :: sollwdownclr(:)
324!$OMP THREADPRIVATE(sollwdownclr)
325      REAL,ALLOCATABLE,SAVE :: toplwdown(:)
326!$OMP THREADPRIVATE(toplwdown)
327      REAL,ALLOCATABLE,SAVE :: toplwdownclr(:)
328!$OMP THREADPRIVATE(toplwdownclr)
329      REAL,ALLOCATABLE,SAVE :: topsw0(:),toplw0(:),solsw0(:),sollw0(:)
330!$OMP THREADPRIVATE(topsw0,toplw0,solsw0,sollw0)
331      REAL,ALLOCATABLE,SAVE :: albpla(:)
332!$OMP THREADPRIVATE(albpla)
333
334!IM ajout variables CFMIP2/CMIP5
335      REAL,ALLOCATABLE,SAVE :: heatp(:,:), coolp(:,:)
336!$OMP THREADPRIVATE(heatp, coolp)
337      REAL,ALLOCATABLE,SAVE :: heat0p(:,:), cool0p(:,:)
338!$OMP THREADPRIVATE(heat0p, cool0p)
339      REAL,ALLOCATABLE,SAVE :: radsolp(:), topswp(:), toplwp(:)
340!$OMP THREADPRIVATE(radsolp, topswp, toplwp)
341      REAL,ALLOCATABLE,SAVE :: albplap(:)
342!$OMP THREADPRIVATE(albplap)
343      REAL,ALLOCATABLE,SAVE :: solswp(:), sollwp(:)
344!$OMP THREADPRIVATE(solswp, sollwp)
345      REAL,ALLOCATABLE,SAVE :: sollwdownp(:)
346!$OMP THREADPRIVATE(sollwdownp)
347      REAL,ALLOCATABLE,SAVE :: topsw0p(:),toplw0p(:)
348      REAL,ALLOCATABLE,SAVE :: solsw0p(:),sollw0p(:)
349!$OMP THREADPRIVATE(topsw0p,toplw0p,solsw0p,sollw0p)
350      REAL,ALLOCATABLE,SAVE :: lwdn0p(:,:), lwdnp(:,:)
351      REAL,ALLOCATABLE,SAVE :: lwup0p(:,:), lwupp(:,:)
352!$OMP THREADPRIVATE(lwdn0p, lwdnp, lwup0p, lwupp)
353      REAL,ALLOCATABLE,SAVE :: swdn0p(:,:), swdnp(:,:)
354      REAL,ALLOCATABLE,SAVE :: swup0p(:,:), swupp(:,:)
355!$OMP THREADPRIVATE(swdn0p, swdnp, swup0p, swupp)
356
357! pbase : cloud base pressure
358! bbase : cloud base buoyancy
359      REAL,ALLOCATABLE,SAVE :: cape(:)
360!$OMP THREADPRIVATE(cape)
361      REAL,ALLOCATABLE,SAVE :: pbase(:)
362!$OMP THREADPRIVATE(pbase)
363      REAL,ALLOCATABLE,SAVE :: bbase(:)
364!$OMP THREADPRIVATE(bbase)
365!
366      REAL,SAVE,ALLOCATABLE :: zqasc(:,:)
367!$OMP THREADPRIVATE( zqasc)
368      INTEGER,ALLOCATABLE,SAVE :: ibas_con(:), itop_con(:)
369!$OMP THREADPRIVATE(ibas_con,itop_con)
370      REAL,SAVE,ALLOCATABLE :: rain_con(:)
371!$OMP THREADPRIVATE(rain_con)
372      REAL,SAVE,ALLOCATABLE :: snow_con(:)
373!$OMP THREADPRIVATE(snow_con)
374!
375      REAL,SAVE,ALLOCATABLE :: rlonPOS(:)
376!$OMP THREADPRIVATE(rlonPOS)
377      REAL,SAVE,ALLOCATABLE :: newsst(:)
378!$OMP THREADPRIVATE(newsst)
379      REAL,SAVE,ALLOCATABLE :: ustar(:,:),u10m(:,:), v10m(:,:),wstar(:,:)
380!$OMP THREADPRIVATE(ustar,u10m,v10m,wstar)
381!
382! ok_ade=T -ADE=topswad-topsw
383! ok_aie=T ->
384!       ok_ade=T -AIE=topswai-topswad
385!       ok_ade=F -AIE=topswai-topsw
386!
387!topswad, solswad : Aerosol direct effect
388      REAL,SAVE,ALLOCATABLE :: topswad(:), solswad(:)
389!$OMP THREADPRIVATE(topswad,solswad)
390!topswai, solswai : Aerosol indirect effect
391      REAL,SAVE,ALLOCATABLE :: topswai(:), solswai(:)
392!$OMP THREADPRIVATE(topswai,solswai)
393
394      REAL,SAVE,ALLOCATABLE :: tau_aero(:,:,:,:), piz_aero(:,:,:,:), cg_aero(:,:,:,:)
395!$OMP THREADPRIVATE(tau_aero, piz_aero, cg_aero)
396      REAL,SAVE,ALLOCATABLE :: tau_aero_sw_rrtm(:,:,:,:), piz_aero_sw_rrtm(:,:,:,:), cg_aero_sw_rrtm(:,:,:,:)
397!$OMP THREADPRIVATE(tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm)
398      REAL,SAVE,ALLOCATABLE :: tau_aero_lw_rrtm(:,:,:,:), piz_aero_lw_rrtm(:,:,:,:), cg_aero_lw_rrtm(:,:,:,:)
399!$OMP THREADPRIVATE(tau_aero_lw_rrtm, piz_aero_lw_rrtm, cg_aero_lw_rrtm)
400      REAL,SAVE,ALLOCATABLE :: ccm(:,:,:)
401!$OMP THREADPRIVATE(ccm)
402
403!!! nrlmd le 10/04/2012
404      REAL,SAVE,ALLOCATABLE :: ale_bl_trig(:)
405!$OMP THREADPRIVATE(ale_bl_trig)
406!!! fin nrlmd le 10/04/2012
407
408      REAL, ALLOCATABLE, SAVE:: du_gwd_rando(:, :), du_gwd_front(:, :)
409      !$OMP THREADPRIVATE(du_gwd_rando, du_gwd_front)
410      ! tendencies on wind due to gravity waves
411
412CONTAINS
413
414!======================================================================
415SUBROUTINE phys_state_var_init(read_climoz)
416USE dimphy
417USE aero_mod
418USE infotrac_phy, ONLY : nbtr
419USE indice_sol_mod
420IMPLICIT NONE
421
422integer, intent(in)::  read_climoz
423! read ozone climatology
424! Allowed values are 0, 1 and 2
425! 0: do not read an ozone climatology
426! 1: read a single ozone climatology that will be used day and night
427! 2: read two ozone climatologies, the average day and night
428! climatology and the daylight climatology
429
430include "clesphys.h"
431
432      ALLOCATE(pctsrf(klon,nbsrf))
433      ALLOCATE(ftsol(klon,nbsrf))
434      ALLOCATE(qsol(klon),fevap(klon,nbsrf))
435      ALLOCATE(z0m(klon,nbsrf+1),z0h(klon,nbsrf+1),agesno(klon,nbsrf))
436!FC
437      ALLOCATE(treedrg(klon,klev,nbsrf))
438      ALLOCATE(falb1(klon,nbsrf))
439      ALLOCATE(falb2(klon,nbsrf))
440!albedo SB >>>
441      ALLOCATE(falb_dir(klon,nsw,nbsrf),falb_dif(klon,nsw,nbsrf))
442      ALLOCATE(chl_con(klon))
443!albedo SB <<<
444      ALLOCATE(rain_fall(klon))
445      ALLOCATE(snow_fall(klon))
446      ALLOCATE(solsw(klon), sollw(klon))
447      ALLOCATE(radsol(klon))
448      ALLOCATE(swradcorr(klon))
449      ALLOCATE(zmea(klon), zstd(klon), zsig(klon), zgam(klon))
450      ALLOCATE(zthe(klon), zpic(klon), zval(klon))
451
452      ALLOCATE(rugoro(klon))
453      ALLOCATE(t_ancien(klon,klev), q_ancien(klon,klev))
454      ALLOCATE(ql_ancien(klon,klev), qs_ancien(klon,klev))
455      ALLOCATE(prw_ancien(klon), prlw_ancien(klon), prsw_ancien(klon))
456      ALLOCATE(u_ancien(klon,klev), v_ancien(klon,klev))
457!!! Rom P >>>
458      ALLOCATE(tr_ancien(klon,klev,nbtr))
459!!! Rom P <<<
460      ALLOCATE(clwcon(klon,klev),rnebcon(klon,klev))
461      ALLOCATE(qtc_cv(klon,klev),sigt_cv(klon,klev))
462      ALLOCATE(ratqs(klon,klev))
463      ALLOCATE(pbl_tke(klon,klev+1,nbsrf+1))
464!nrlmd<
465      ALLOCATE(delta_tsurf(klon,nbsrf))
466!>nrlmd
467      ALLOCATE(coefh(klon,klev+1,nbsrf+1))
468      ALLOCATE(coefm(klon,klev+1,nbsrf+1))
469      ALLOCATE(zmax0(klon), f0(klon))
470      ALLOCATE(sig1(klon,klev), w01(klon,klev))
471      ALLOCATE(entr_therm(klon,klev), fm_therm(klon,klev+1))
472      ALLOCATE(detr_therm(klon,klev))
473!     pour phsystoke avec thermiques
474      ALLOCATE(clwcon0th(klon,klev),rnebcon0th(klon,klev))
475! radiation outputs
476      ALLOCATE(swdn0(klon,klevp1), swdn(klon,klevp1))
477      ALLOCATE(swup0(klon,klevp1), swup(klon,klevp1))
478      ALLOCATE(lwdn0(klon,klevp1), lwdn(klon,klevp1))
479      ALLOCATE(lwup0(klon,klevp1), lwup(klon,klevp1))
480      ALLOCATE(SWdn200clr(klon), SWdn200(klon))
481      ALLOCATE(SWup200clr(klon), SWup200(klon))
482      ALLOCATE(LWdn200clr(klon), LWdn200(klon))
483      ALLOCATE(LWup200clr(klon), LWup200(klon))
484      ALLOCATE(LWdnTOA(klon), LWdnTOAclr(klon))
485! pressure level
486      ALLOCATE(tsumSTD(klon,nlevSTD,nout))
487      ALLOCATE(usumSTD(klon,nlevSTD,nout), vsumSTD(klon,nlevSTD,nout))
488      ALLOCATE(wsumSTD(klon,nlevSTD,nout), phisumSTD(klon,nlevSTD,nout))
489      ALLOCATE(qsumSTD(klon,nlevSTD,nout), rhsumSTD(klon,nlevSTD,nout))
490      ALLOCATE(tnondef(klon,nlevSTD,nout))
491      ALLOCATE(uvsumSTD(klon,nlevSTD,nout))
492      ALLOCATE(vqsumSTD(klon,nlevSTD,nout))
493      ALLOCATE(vTsumSTD(klon,nlevSTD,nout))
494      ALLOCATE(wqsumSTD(klon,nlevSTD,nout))
495      ALLOCATE(vphisumSTD(klon,nlevSTD,nout))
496      ALLOCATE(wTsumSTD(klon,nlevSTD,nout))
497      ALLOCATE(u2sumSTD(klon,nlevSTD,nout))
498      ALLOCATE(v2sumSTD(klon,nlevSTD,nout))
499      ALLOCATE(T2sumSTD(klon,nlevSTD,nout))
500      ALLOCATE(O3sumSTD(klon,nlevSTD,nout))
501      ALLOCATE(O3daysumSTD(klon,nlevSTD,nout))
502!IM beg
503      ALLOCATE(wlevSTD(klon,nlevSTD), ulevSTD(klon,nlevSTD), vlevSTD(klon,nlevSTD))
504      ALLOCATE(tlevSTD(klon,nlevSTD), qlevSTD(klon,nlevSTD), rhlevSTD(klon,nlevSTD))
505      ALLOCATE(philevSTD(klon,nlevSTD))
506      ALLOCATE(uvSTD(klon,nlevSTD),vqSTD(klon,nlevSTD))
507      ALLOCATE(vTSTD(klon,nlevSTD),wqSTD(klon,nlevSTD))
508      ALLOCATE(vphiSTD(klon,nlevSTD),wTSTD(klon,nlevSTD))
509      ALLOCATE(u2STD(klon,nlevSTD),v2STD(klon,nlevSTD))
510      ALLOCATE(T2STD(klon,nlevSTD))
511      ALLOCATE(O3STD(klon,nlevSTD))
512      ALLOCATE(O3daySTD(klon,nlevSTD))
513!IM end
514      ALLOCATE(seed_old(klon,napisccp))
515      ALLOCATE(zuthe(klon),zvthe(klon))
516      ALLOCATE(alb_neig(klon))
517!cloud base mass flux
518      ALLOCATE(ema_cbmf(klon))
519!cloud base pressure & cloud top pressure
520      ALLOCATE(ema_pcb(klon), ema_pct(klon))
521!
522      ALLOCATE(Ma(klon,klev))
523      ALLOCATE(qcondc(klon,klev))
524      ALLOCATE(wd(klon))
525      ALLOCATE(sigd(klon))
526      ALLOCATE(cin(klon), ALE(klon), ALP(klon))
527      ALLOCATE(ftd(klon,klev), fqd(klon,klev))
528      ALLOCATE(Ale_bl(klon))
529      ALLOCATE(Alp_bl(klon))
530      ALLOCATE(lalim_conv(klon))
531      ALLOCATE(wght_th(klon,klev))
532      ALLOCATE(wake_deltat(klon,klev), wake_deltaq(klon,klev))
533      ALLOCATE(wake_s(klon), wake_dens(klon))
534      ALLOCATE(wake_Cstar(klon))
535      ALLOCATE(wake_pe(klon), wake_fip(klon))
536!jyg<
537      ALLOCATE(wake_delta_pbl_TKE(klon,klev+1,nbsrf+1))
538!>jyg
539      ALLOCATE(pfrac_impa(klon,klev), pfrac_nucl(klon,klev))
540      ALLOCATE(pfrac_1nucl(klon,klev))
541      ALLOCATE(total_rain(klon), nday_rain(klon))
542      ALLOCATE(albsol1(klon), albsol2(klon))
543!albedo SB >>>
544      ALLOCATE(albsol_dir(klon,nsw),albsol_dif(klon,nsw))
545!albedo SB <<<
546
547      if (read_climoz <= 1) then
548         ALLOCATE(wo(klon,klev, 1))
549      else
550         ! read_climoz == 2
551         ALLOCATE(wo(klon,klev, 2))
552      end if
553     
554      ALLOCATE(clwcon0(klon,klev),rnebcon0(klon,klev))
555      ALLOCATE(heat(klon,klev), heat0(klon,klev))
556      ALLOCATE(cool(klon,klev), cool0(klon,klev))
557      ALLOCATE(topsw(klon), toplw(klon))
558      ALLOCATE(sollwdown(klon), sollwdownclr(klon))
559      ALLOCATE(toplwdown(klon), toplwdownclr(klon))
560      ALLOCATE(topsw0(klon),toplw0(klon),solsw0(klon),sollw0(klon))
561      ALLOCATE(albpla(klon))
562!IM ajout variables CFMIP2/CMIP5
563      ALLOCATE(heatp(klon,klev), coolp(klon,klev))
564      ALLOCATE(heat0p(klon,klev), cool0p(klon,klev))
565      ALLOCATE(radsolp(klon), topswp(klon), toplwp(klon))
566      ALLOCATE(albplap(klon))
567      ALLOCATE(solswp(klon), sollwp(klon))
568      ALLOCATE(gustiness(klon))
569      ALLOCATE(sollwdownp(klon))
570      ALLOCATE(topsw0p(klon),toplw0p(klon))
571      ALLOCATE(solsw0p(klon),sollw0p(klon))
572      ALLOCATE(lwdn0p(klon,klevp1), lwdnp(klon,klevp1))
573      ALLOCATE(lwup0p(klon,klevp1), lwupp(klon,klevp1))
574      ALLOCATE(swdn0p(klon,klevp1), swdnp(klon,klevp1))
575      ALLOCATE(swup0p(klon,klevp1), swupp(klon,klevp1))
576
577      ALLOCATE(cape(klon))
578      ALLOCATE(pbase(klon),bbase(klon))
579      ALLOCATE(zqasc(klon,klev))
580      ALLOCATE(ibas_con(klon), itop_con(klon))
581      ALLOCATE(rain_con(klon), snow_con(klon))
582      ALLOCATE(rlonPOS(klon))
583      ALLOCATE(newsst(klon))
584      ALLOCATE(ustar(klon,nbsrf),u10m(klon,nbsrf), v10m(klon,nbsrf),wstar(klon,nbsrf+1))
585      ALLOCATE(topswad(klon), solswad(klon))
586      ALLOCATE(topswai(klon), solswai(klon))
587      ALLOCATE(tau_aero(klon,klev,naero_grp,nbands),piz_aero(klon,klev,naero_grp,nbands),cg_aero(klon,klev,naero_grp,nbands))
588      ALLOCATE(tau_aero_sw_rrtm(klon,klev,2,nbands_sw_rrtm),piz_aero_sw_rrtm(klon,klev,2,nbands_sw_rrtm))
589      ALLOCATE(cg_aero_sw_rrtm(klon,klev,2,nbands_sw_rrtm))
590      ALLOCATE(tau_aero_lw_rrtm(klon,klev,2,nbands_lw_rrtm),piz_aero_lw_rrtm(klon,klev,2,nbands_lw_rrtm))
591      ALLOCATE(cg_aero_lw_rrtm(klon,klev,2,nbands_lw_rrtm))
592      ALLOCATE(ccm(klon,klev,nbands))
593
594!!! nrlmd le 10/04/2012
595      ALLOCATE(ale_bl_trig(klon))
596!!! fin nrlmd le 10/04/2012
597      if (ok_gwd_rando) allocate(du_gwd_rando(klon, klev))
598      if (.not. ok_hines .and. ok_gwd_rando) allocate(du_gwd_front(klon, klev))
599
600END SUBROUTINE phys_state_var_init
601
602!======================================================================
603SUBROUTINE phys_state_var_end
604!USE dimphy
605USE indice_sol_mod
606IMPLICIT NONE
607include "clesphys.h"
608
609      deallocate(pctsrf, ftsol, falb1, falb2)
610      deallocate(qsol,fevap,z0m,z0h,agesno)
611!FC
612      deallocate(treedrg)
613      deallocate(rain_fall, snow_fall, solsw, sollw, radsol, swradcorr)
614      deallocate(zmea, zstd, zsig, zgam)
615      deallocate(zthe, zpic, zval)
616      deallocate(rugoro, t_ancien, q_ancien, clwcon, rnebcon)
617      deallocate(qs_ancien, ql_ancien)
618      deallocate(prw_ancien, prlw_ancien, prsw_ancien)
619      deallocate(qtc_cv,sigt_cv)
620      deallocate(u_ancien, v_ancien)
621      deallocate(tr_ancien)                           !RomP
622      deallocate(ratqs, pbl_tke,coefh,coefm)
623!nrlmd<
624      deallocate(delta_tsurf)
625!>nrlmd
626      deallocate(zmax0, f0)
627      deallocate(sig1, w01)
628      deallocate(entr_therm, fm_therm)
629      deallocate(detr_therm)
630      deallocate(clwcon0th, rnebcon0th)
631! radiation outputs
632      deallocate(swdn0, swdn)
633      deallocate(swup0, swup)
634      deallocate(lwdn0, lwdn)
635      deallocate(lwup0, lwup)
636      deallocate(SWdn200clr, SWdn200)
637      deallocate(SWup200clr, SWup200)
638      deallocate(LWdn200clr, LWdn200)
639      deallocate(LWup200clr, LWup200)
640      deallocate(LWdnTOA, LWdnTOAclr)
641! pressure level
642      deallocate(tsumSTD)
643      deallocate(usumSTD, vsumSTD)
644      deallocate(wsumSTD, phisumSTD)
645      deallocate(tnondef)
646      deallocate(qsumSTD, rhsumSTD)
647      deallocate(uvsumSTD)
648      deallocate(vqsumSTD)
649      deallocate(vTsumSTD)
650      deallocate(wqsumSTD)
651      deallocate(vphisumSTD)
652      deallocate(wTsumSTD)
653      deallocate(u2sumSTD)
654      deallocate(v2sumSTD)
655      deallocate(T2sumSTD)
656      deallocate(O3sumSTD)
657      deallocate(O3daysumSTD)
658!IM beg
659      deallocate(wlevSTD,ulevSTD,vlevSTD,tlevSTD,qlevSTD,rhlevSTD,philevSTD)
660      deallocate(uvSTD,vqSTD,vTSTD,wqSTD,vphiSTD,wTSTD,u2STD,v2STD,T2STD,O3STD,O3daySTD)
661!IM end
662      deallocate(seed_old)
663      deallocate(zuthe, zvthe)
664      deallocate(alb_neig)
665      deallocate(ema_cbmf)
666      deallocate(ema_pcb, ema_pct)
667      deallocate(Ma, qcondc)
668      deallocate(wd, sigd)
669      deallocate(cin, ALE, ALP)
670      deallocate(ftd, fqd)
671      deallocate(Ale_bl, Alp_bl)
672      deallocate(lalim_conv, wght_th)
673      deallocate(wake_deltat, wake_deltaq)
674      deallocate(wake_s, wake_dens)
675      deallocate(wake_Cstar, wake_pe, wake_fip)
676!jyg<
677      deallocate(wake_delta_pbl_TKE)
678!>jyg
679      deallocate(pfrac_impa, pfrac_nucl)
680      deallocate(pfrac_1nucl)
681      deallocate(total_rain, nday_rain)
682      deallocate(albsol1, albsol2)
683!albedo SB >>>
684      deallocate(albsol_dir,albsol_dif,falb_dir,falb_dif,chl_con)
685!albedo SB <<<
686      deallocate(wo)
687      deallocate(clwcon0,rnebcon0)
688      deallocate(heat, heat0)
689      deallocate(cool, cool0)
690      deallocate(topsw, toplw)
691      deallocate(sollwdown, sollwdownclr)
692      deallocate(gustiness)
693      deallocate(toplwdown, toplwdownclr)
694      deallocate(topsw0,toplw0,solsw0,sollw0)
695      deallocate(albpla)
696!IM ajout variables CFMIP2/CMIP5
697      deallocate(heatp, coolp)
698      deallocate(heat0p, cool0p)
699      deallocate(radsolp, topswp, toplwp)
700      deallocate(albplap)
701      deallocate(solswp, sollwp)
702      deallocate(sollwdownp)
703      deallocate(topsw0p,toplw0p)
704      deallocate(solsw0p,sollw0p)
705      deallocate(lwdn0p, lwdnp)
706      deallocate(lwup0p, lwupp)
707      deallocate(swdn0p, swdnp)
708      deallocate(swup0p, swupp)
709      deallocate(cape)
710      deallocate(pbase,bbase)
711      deallocate(zqasc)
712      deallocate(ibas_con, itop_con)
713      deallocate(rain_con, snow_con)
714      deallocate(rlonPOS)
715      deallocate(newsst)
716      deallocate(ustar,u10m, v10m,wstar)
717      deallocate(topswad, solswad)
718      deallocate(topswai, solswai)
719      deallocate(tau_aero,piz_aero,cg_aero)
720      deallocate(tau_aero_sw_rrtm,piz_aero_sw_rrtm,cg_aero_sw_rrtm)
721      deallocate(tau_aero_lw_rrtm,piz_aero_lw_rrtm,cg_aero_lw_rrtm)
722      deallocate(ccm)
723      if (ok_gwd_rando) deallocate(du_gwd_rando)
724      if (.not. ok_hines .and. ok_gwd_rando) deallocate(du_gwd_front)
725       
726!!! nrlmd le 10/04/2012
727      deallocate(ale_bl_trig)
728!!! fin nrlmd le 10/04/2012
729
730END SUBROUTINE phys_state_var_end
731
732      END MODULE phys_state_var_mod
Note: See TracBrowser for help on using the repository browser.