source: dynamico_lmdz/aquaplanet/LMDZ5/libf/phylmd/phys_state_var_mod.F90 @ 3817

Last change on this file since 3817 was 3817, checked in by millour, 10 years ago

Further cleanup and removal of references to iniprint.h.
Also added bench testcase 48x36x19.
EM

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