source: LMDZ5/branches/IPSLCM6.0.11/libf/phylmd/phys_state_var_mod.F90 @ 5451

Last change on this file since 5451 was 2825, checked in by musat, 8 years ago

Delete paire_ter LMDZ variable and aireTER output

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