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

Last change on this file since 3838 was 3838, checked in by millour, 9 years ago

Fixed call to iniphysiq from gcm and removed unused "pdayref" argument (day_ini is known from temps.h).
Removed "dtime" from phys_state_var_mod.F90; pdtphys (from time_phylmdz_mod) must be used instead.
With this revision seq and parallel MPI/OpenMP bench runs yield identical restart files.
EM

File size: 26.4 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 :: solaire_etat0
20!$OMP THREADPRIVATE(solaire_etat0)
21
22      REAL, ALLOCATABLE, SAVE ::  pctsrf(:,:)
23!$OMP THREADPRIVATE(pctsrf)
24
25      REAL, ALLOCATABLE, SAVE :: ftsol(:,:)
26!$OMP THREADPRIVATE(ftsol)
27      REAL,ALLOCATABLE,SAVE :: qsol(:),fevap(:,:),z0m(:,:),z0h(:,:),agesno(:,:)
28!$OMP THREADPRIVATE(qsol,fevap,z0m,z0h,agesno)
29!      character(len=6), SAVE :: ocean
30!!!!!!$OMP THREADPRIVATE(ocean)
31!      logical, SAVE :: ok_veget
32!!!!!!$OMP THREADPRIVATE(ok_veget)
33      REAL, ALLOCATABLE, SAVE :: falb1(:,:), falb2(:,:)
34!$OMP THREADPRIVATE(falb1, falb2)
35
36!albedo SB >>>
37      REAL, ALLOCATABLE, SAVE :: falb_dif(:,:,:), falb_dir(:,:,:)
38      real, allocatable, save :: chl_con(:)
39!$OMP THREADPRIVATE(falb_dir,falb_dif,chl_con)
40!albedo SB <<<
41
42
43      REAL, ALLOCATABLE, SAVE :: rain_fall(:), snow_fall(:)
44!$OMP THREADPRIVATE( rain_fall, snow_fall)
45      REAL, ALLOCATABLE, SAVE :: solsw(:), sollw(:)
46!$OMP THREADPRIVATE(solsw, sollw)
47      REAL, ALLOCATABLE, SAVE :: radsol(:)
48!$OMP THREADPRIVATE(radsol)
49
50!clesphy0 param physiq
51!
52! Parametres de l'Orographie a l'Echelle Sous-Maille (OESM):
53!
54      REAL, ALLOCATABLE, SAVE :: zmea(:), zstd(:), zsig(:), zgam(:)
55!$OMP THREADPRIVATE(zmea, zstd, zsig, zgam)
56      REAL, ALLOCATABLE, SAVE :: zthe(:), zpic(:), zval(:)
57!$OMP THREADPRIVATE(zthe, zpic, zval)
58!     REAL tabcntr0(100)
59      REAL, ALLOCATABLE, SAVE :: rugoro(:)
60!$OMP THREADPRIVATE(rugoro)
61      REAL, ALLOCATABLE, SAVE :: t_ancien(:,:), q_ancien(:,:)
62!$OMP THREADPRIVATE(t_ancien, q_ancien)
63      REAL, ALLOCATABLE, SAVE :: u_ancien(:,:), v_ancien(:,:)
64!$OMP THREADPRIVATE(u_ancien, v_ancien)
65!!! RomP >>>
66      REAL, ALLOCATABLE, SAVE :: tr_ancien(:,:,:)
67!$OMP THREADPRIVATE(tr_ancien)
68!!! RomP <<<
69      LOGICAL, SAVE :: ancien_ok
70!$OMP THREADPRIVATE(ancien_ok)
71      REAL, ALLOCATABLE, SAVE :: clwcon(:,:),rnebcon(:,:)
72!$OMP THREADPRIVATE(clwcon,rnebcon)
73      REAL, ALLOCATABLE, SAVE :: qtc_cv(:,:),sigt_cv(:,:)
74!$OMP THREADPRIVATE(qtc_cv,sigt_cv)
75      REAL, ALLOCATABLE, SAVE :: ratqs(:,:)
76!$OMP THREADPRIVATE(ratqs)
77      REAL, ALLOCATABLE, SAVE :: pbl_tke(:,:,:) ! turb kinetic energy
78      REAL, ALLOCATABLE, SAVE :: coefh(:,:,:) ! Kz enthalpie
79      REAL, ALLOCATABLE, SAVE :: coefm(:,:,:) ! Kz momentum
80!$OMP THREADPRIVATE(pbl_tke, coefh,coefm)
81!nrlmd<
82      REAL, ALLOCATABLE, SAVE :: delta_tsurf(:,:) ! Surface temperature difference inside-outside cold pool
83!$OMP THREADPRIVATE(delta_tsurf)
84!>nrlmd
85      REAL, ALLOCATABLE, SAVE :: zmax0(:), f0(:) !
86!$OMP THREADPRIVATE(zmax0,f0)
87      REAL, ALLOCATABLE, SAVE :: sig1(:,:), w01(:,:)
88!$OMP THREADPRIVATE(sig1,w01)
89      REAL, ALLOCATABLE, SAVE :: entr_therm(:,:), fm_therm(:,:)
90!$OMP THREADPRIVATE(entr_therm,fm_therm)
91      REAL, ALLOCATABLE, SAVE :: detr_therm(:,:)
92!$OMP THREADPRIVATE(detr_therm)
93!IM 150408
94!     pour phsystoke avec thermiques
95      REAL,ALLOCATABLE,SAVE :: clwcon0th(:,:),rnebcon0th(:,:)
96!$OMP THREADPRIVATE(clwcon0th,rnebcon0th)
97! radiation outputs
98      REAL,ALLOCATABLE,SAVE :: swdn0(:,:), swdn(:,:)
99!$OMP THREADPRIVATE(swdn0,swdn)
100      REAL,ALLOCATABLE,SAVE :: swup0(:,:), swup(:,:)
101!$OMP THREADPRIVATE(swup0,swup)
102      REAL,ALLOCATABLE,SAVE :: SWdn200clr(:), SWdn200(:)
103!$OMP THREADPRIVATE(SWdn200clr,SWdn200)
104      REAL,ALLOCATABLE,SAVE :: SWup200clr(:), SWup200(:)
105!$OMP THREADPRIVATE(SWup200clr,SWup200)
106      REAL,ALLOCATABLE,SAVE :: lwdn0(:,:), lwdn(:,:)
107!$OMP THREADPRIVATE(lwdn0,lwdn)
108      REAL,ALLOCATABLE,SAVE :: lwup0(:,:), lwup(:,:)
109!$OMP THREADPRIVATE(lwup0,lwup)
110      REAL,ALLOCATABLE,SAVE :: LWdn200clr(:), LWdn200(:)
111!$OMP THREADPRIVATE(LWdn200clr,LWdn200)
112      REAL,ALLOCATABLE,SAVE :: LWup200clr(:), LWup200(:)
113!$OMP THREADPRIVATE(LWup200clr,LWup200)
114      REAL,ALLOCATABLE,SAVE :: LWdnTOA(:), LWdnTOAclr(:)
115!$OMP THREADPRIVATE(LWdnTOA,LWdnTOAclr)
116! pressure level
117      REAL,ALLOCATABLE,SAVE :: tsumSTD(:,:,:)
118!$OMP THREADPRIVATE(tsumSTD)
119      REAL,ALLOCATABLE,SAVE :: usumSTD(:,:,:), vsumSTD(:,:,:)
120!$OMP THREADPRIVATE(usumSTD,vsumSTD)
121      REAL,ALLOCATABLE,SAVE :: wsumSTD(:,:,:), phisumSTD(:,:,:)
122!$OMP THREADPRIVATE(wsumSTD,phisumSTD)
123      REAL,ALLOCATABLE,SAVE :: qsumSTD(:,:,:), rhsumSTD(:,:,:)
124!$OMP THREADPRIVATE(qsumSTD,rhsumSTD)
125      REAL,ALLOCATABLE,SAVE :: tnondef(:,:,:)
126!$OMP THREADPRIVATE(tnondef)
127      REAL,ALLOCATABLE,SAVE :: uvsumSTD(:,:,:)
128!$OMP THREADPRIVATE(uvsumSTD)
129      REAL,ALLOCATABLE,SAVE :: vqsumSTD(:,:,:)
130!$OMP THREADPRIVATE(vqsumSTD)
131      REAL,ALLOCATABLE,SAVE :: vTsumSTD(:,:,:)
132!$OMP THREADPRIVATE(vTsumSTD)
133      REAL,ALLOCATABLE,SAVE :: wqsumSTD(:,:,:)
134!$OMP THREADPRIVATE(wqsumSTD)
135      REAL,ALLOCATABLE,SAVE :: vphisumSTD(:,:,:)
136!$OMP THREADPRIVATE(vphisumSTD)
137      REAL,ALLOCATABLE,SAVE :: wTsumSTD(:,:,:)
138!$OMP THREADPRIVATE(wTsumSTD)
139      REAL,ALLOCATABLE,SAVE :: u2sumSTD(:,:,:)
140!$OMP THREADPRIVATE(u2sumSTD)
141      REAL,ALLOCATABLE,SAVE :: v2sumSTD(:,:,:)
142!$OMP THREADPRIVATE(v2sumSTD)
143      REAL,ALLOCATABLE,SAVE :: T2sumSTD(:,:,:)
144!$OMP THREADPRIVATE(T2sumSTD)
145      REAL,ALLOCATABLE,SAVE :: O3sumSTD(:,:,:), O3daysumSTD(:,:,:)
146!$OMP THREADPRIVATE(O3sumSTD,O3daysumSTD)
147!IM begin
148      REAL,ALLOCATABLE,SAVE :: wlevSTD(:,:), ulevSTD(:,:), vlevSTD(:,:)
149!$OMP THREADPRIVATE(wlevSTD,ulevSTD,vlevSTD)
150      REAL,ALLOCATABLE,SAVE :: tlevSTD(:,:), qlevSTD(:,:), rhlevSTD(:,:)
151!$OMP THREADPRIVATE(tlevSTD,qlevSTD,rhlevSTD)
152      REAL,ALLOCATABLE,SAVE :: philevSTD(:,:)
153!$OMP THREADPRIVATE(philevSTD)
154      REAL,ALLOCATABLE,SAVE :: uvSTD(:,:)
155!$OMP THREADPRIVATE(uvSTD)
156      REAL,ALLOCATABLE,SAVE :: vqSTD(:,:)
157!$OMP THREADPRIVATE(vqSTD)
158      REAL,ALLOCATABLE,SAVE :: vTSTD(:,:)
159!$OMP THREADPRIVATE(vTSTD)
160      REAL,ALLOCATABLE,SAVE :: wqSTD(:,:)
161!$OMP THREADPRIVATE(wqSTD)
162      REAL,ALLOCATABLE,SAVE :: vphiSTD(:,:)
163!$OMP THREADPRIVATE(vphiSTD)
164      REAL,ALLOCATABLE,SAVE :: wTSTD(:,:)
165!$OMP THREADPRIVATE(wTSTD)
166      REAL,ALLOCATABLE,SAVE :: u2STD(:,:)
167!$OMP THREADPRIVATE(u2STD)
168      REAL,ALLOCATABLE,SAVE :: v2STD(:,:)
169!$OMP THREADPRIVATE(v2STD)
170      REAL,ALLOCATABLE,SAVE :: T2STD(:,:)
171!$OMP THREADPRIVATE(T2STD)
172      REAL,ALLOCATABLE,SAVE :: O3STD(:,:), O3daySTD(:,:)
173!$OMP THREADPRIVATE(O3STD,O3daySTD)
174!IM end
175      INTEGER,ALLOCATABLE,SAVE :: seed_old(:,:)
176!$OMP THREADPRIVATE(seed_old)
177      REAL,ALLOCATABLE,SAVE :: zuthe(:),zvthe(:)
178!$OMP THREADPRIVATE(zuthe,zvthe)
179      REAL,ALLOCATABLE,SAVE :: alb_neig(:)
180!$OMP THREADPRIVATE(alb_neig)
181!cloud base mass flux
182      REAL,ALLOCATABLE,SAVE :: ema_cbmf(:)
183!$OMP THREADPRIVATE(ema_cbmf)
184!cloud base pressure & cloud top pressure
185      REAL,ALLOCATABLE,SAVE :: ema_pcb(:), ema_pct(:)
186!$OMP THREADPRIVATE(ema_pcb,ema_pct)
187      REAL,ALLOCATABLE,SAVE :: Ma(:,:)        ! undilute upward mass flux
188!$OMP THREADPRIVATE(Ma)
189      REAL,ALLOCATABLE,SAVE :: qcondc(:,:)    ! in-cld water content from convect
190!$OMP THREADPRIVATE(qcondc)
191      REAL,ALLOCATABLE,SAVE :: wd(:) ! sb
192!$OMP THREADPRIVATE(wd)
193      REAL,ALLOCATABLE,SAVE :: sigd(:)
194!$OMP THREADPRIVATE(sigd)
195!
196      REAL,ALLOCATABLE,SAVE :: cin(:)
197!$OMP THREADPRIVATE(cin)
198! ftd : differential heating between wake and environment
199      REAL,ALLOCATABLE,SAVE :: ftd(:,:)
200!$OMP THREADPRIVATE(ftd)
201! fqd : differential moistening between wake and environment
202      REAL,ALLOCATABLE,SAVE :: fqd(:,:)     
203!$OMP THREADPRIVATE(fqd)
204!34EK
205! -- Variables de controle de ALE et ALP
206!ALE : Energie disponible pour soulevement : utilisee par la
207!      convection d'Emanuel pour le declenchement et la regulation
208      REAL,ALLOCATABLE,SAVE :: ALE(:)
209!$OMP THREADPRIVATE(ALE)
210!ALP : Puissance  disponible pour soulevement
211      REAL,ALLOCATABLE,SAVE :: ALP(:)
212!$OMP THREADPRIVATE(ALP)
213!
214! nouvelles variables pour le couplage convection-couche limite
215      REAL,ALLOCATABLE,SAVE :: Ale_bl(:)
216!$OMP THREADPRIVATE(Ale_bl)
217      REAL,ALLOCATABLE,SAVE :: Alp_bl(:)
218!$OMP THREADPRIVATE(Alp_bl)
219      INTEGER,ALLOCATABLE,SAVE :: lalim_conv(:)
220!$OMP THREADPRIVATE(lalim_conv)
221      REAL,ALLOCATABLE,SAVE :: wght_th(:,:)
222!$OMP THREADPRIVATE(wght_th)
223!
224! variables de la wake
225! wake_deltat : ecart de temperature avec la zone non perturbee
226! wake_deltaq : ecart d'humidite avec la zone non perturbee
227! wake_Cstar  : vitesse d'etalement de la poche
228! wake_s      : fraction surfacique occupee par la poche froide
229! wake_pe     : wake potential energy - WAPE
230! wake_fip    : Gust Front Impinging power - ALP
231! dt_wake, dq_wake: LS tendencies due to wake
232      REAL,ALLOCATABLE,SAVE :: wake_deltat(:,:)
233!$OMP THREADPRIVATE(wake_deltat)
234      REAL,ALLOCATABLE,SAVE :: wake_deltaq(:,:)
235!$OMP THREADPRIVATE(wake_deltaq)
236      REAL,ALLOCATABLE,SAVE :: wake_Cstar(:)
237!$OMP THREADPRIVATE(wake_Cstar)
238      REAL,ALLOCATABLE,SAVE :: wake_s(:)
239!$OMP THREADPRIVATE(wake_s)
240      REAL,ALLOCATABLE,SAVE :: wake_pe(:)
241!$OMP THREADPRIVATE(wake_pe)
242      REAL,ALLOCATABLE,SAVE :: wake_fip(:)
243!$OMP THREADPRIVATE(wake_fip)
244      REAL,ALLOCATABLE,SAVE :: dt_wake(:,:)
245!$OMP THREADPRIVATE(dt_wake)
246      REAL,ALLOCATABLE,SAVE :: dq_wake(:,:)
247!$OMP THREADPRIVATE(dq_wake)
248!
249!jyg<
250! variables related to the spitting of the PBL between wake and
251! off-wake regions.
252! wake_delta_pbl_TKE : difference TKE_w - TKE_x
253      REAL,ALLOCATABLE,SAVE :: wake_delta_pbl_TKE(:,:,:)
254!$OMP THREADPRIVATE(wake_delta_pbl_TKE)
255!>jyg
256!
257! pfrac_impa : Produits des coefs lessivage impaction
258! pfrac_nucl : Produits des coefs lessivage nucleation
259! pfrac_1nucl: Produits des coefs lessi nucl (alpha = 1)
260      REAL,ALLOCATABLE,SAVE :: pfrac_impa(:,:), pfrac_nucl(:,:)
261!$OMP THREADPRIVATE(pfrac_impa,pfrac_nucl)
262      REAL,ALLOCATABLE,SAVE :: pfrac_1nucl(:,:)
263!$OMP THREADPRIVATE(pfrac_1nucl)
264!
265      REAL,ALLOCATABLE,SAVE :: total_rain(:), nday_rain(:) 
266!$OMP THREADPRIVATE(total_rain,nday_rain)
267      REAL,ALLOCATABLE,SAVE :: paire_ter(:)
268!$OMP THREADPRIVATE(paire_ter)
269! albsol1: albedo du sol total pour SW visible
270! albsol2: albedo du sol total pour SW proche IR
271      REAL,ALLOCATABLE,SAVE :: albsol1(:), albsol2(:)
272!$OMP THREADPRIVATE(albsol1,albsol2)
273
274!albedo SB >>>
275      REAL,ALLOCATABLE,SAVE :: albsol_dif(:,:),albsol_dir(:,:)
276!$OMP THREADPRIVATE(albsol_dif,albsol_dir)
277!albedo SB <<<
278
279
280      REAL, ALLOCATABLE, SAVE:: wo(:, :, :)
281      ! column-density of ozone in a layer, in kilo-Dobsons
282      ! Third dimension has size 1 or 2.
283      ! "wo(:, :, 1)" is for the average day-night field,
284      ! "wo(:, :, 2)" is for daylight time.
285      !$OMP THREADPRIVATE(wo)
286
287! heat : chauffage solaire
288! heat0: chauffage solaire ciel clair
289! cool : refroidissement infrarouge
290! cool0 : refroidissement infrarouge ciel clair
291! sollwdown : downward LW flux at surface
292! sollwdownclr : downward CS LW flux at surface
293! toplwdown : downward CS LW flux at TOA
294! toplwdownclr : downward CS LW flux at TOA
295      REAL,ALLOCATABLE,SAVE :: clwcon0(:,:),rnebcon0(:,:)
296!$OMP THREADPRIVATE(clwcon0,rnebcon0)
297      REAL,ALLOCATABLE,SAVE :: heat(:,:)   
298!$OMP THREADPRIVATE(heat)
299      REAL,ALLOCATABLE,SAVE :: heat0(:,:)
300!$OMP THREADPRIVATE(heat0)
301      REAL,ALLOCATABLE,SAVE :: cool(:,:)
302!$OMP THREADPRIVATE(cool)
303      REAL,ALLOCATABLE,SAVE :: cool0(:,:)
304!$OMP THREADPRIVATE(cool0)
305      REAL,ALLOCATABLE,SAVE :: topsw(:), toplw(:)
306!$OMP THREADPRIVATE(topsw,toplw)
307      REAL,ALLOCATABLE,SAVE :: sollwdown(:)
308!$OMP THREADPRIVATE(sollwdown)
309      REAL,ALLOCATABLE,SAVE :: gustiness(:)
310!$OMP THREADPRIVATE(gustiness)
311      REAL,ALLOCATABLE,SAVE :: sollwdownclr(:)
312!$OMP THREADPRIVATE(sollwdownclr)
313      REAL,ALLOCATABLE,SAVE :: toplwdown(:)
314!$OMP THREADPRIVATE(toplwdown)
315      REAL,ALLOCATABLE,SAVE :: toplwdownclr(:)
316!$OMP THREADPRIVATE(toplwdownclr)
317      REAL,ALLOCATABLE,SAVE :: topsw0(:),toplw0(:),solsw0(:),sollw0(:)
318!$OMP THREADPRIVATE(topsw0,toplw0,solsw0,sollw0)
319      REAL,ALLOCATABLE,SAVE :: albpla(:)
320!$OMP THREADPRIVATE(albpla)
321
322!IM ajout variables CFMIP2/CMIP5
323      REAL,ALLOCATABLE,SAVE :: heatp(:,:), coolp(:,:)
324!$OMP THREADPRIVATE(heatp, coolp)
325      REAL,ALLOCATABLE,SAVE :: heat0p(:,:), cool0p(:,:)
326!$OMP THREADPRIVATE(heat0p, cool0p)
327      REAL,ALLOCATABLE,SAVE :: radsolp(:), topswp(:), toplwp(:)
328!$OMP THREADPRIVATE(radsolp, topswp, toplwp)
329      REAL,ALLOCATABLE,SAVE :: albplap(:)
330!$OMP THREADPRIVATE(albplap)
331      REAL,ALLOCATABLE,SAVE :: solswp(:), sollwp(:)
332!$OMP THREADPRIVATE(solswp, sollwp)
333      REAL,ALLOCATABLE,SAVE :: sollwdownp(:)
334!$OMP THREADPRIVATE(sollwdownp)
335      REAL,ALLOCATABLE,SAVE :: topsw0p(:),toplw0p(:)
336      REAL,ALLOCATABLE,SAVE :: solsw0p(:),sollw0p(:)
337!$OMP THREADPRIVATE(topsw0p,toplw0p,solsw0p,sollw0p)
338      REAL,ALLOCATABLE,SAVE :: lwdn0p(:,:), lwdnp(:,:)
339      REAL,ALLOCATABLE,SAVE :: lwup0p(:,:), lwupp(:,:)
340!$OMP THREADPRIVATE(lwdn0p, lwdnp, lwup0p, lwupp)
341      REAL,ALLOCATABLE,SAVE :: swdn0p(:,:), swdnp(:,:)
342      REAL,ALLOCATABLE,SAVE :: swup0p(:,:), swupp(:,:)
343!$OMP THREADPRIVATE(swdn0p, swdnp, swup0p, swupp)
344
345! pbase : cloud base pressure
346! bbase : cloud base buoyancy
347      REAL,ALLOCATABLE,SAVE :: cape(:)
348!$OMP THREADPRIVATE(cape)
349      REAL,ALLOCATABLE,SAVE :: pbase(:)
350!$OMP THREADPRIVATE(pbase)
351      REAL,ALLOCATABLE,SAVE :: bbase(:)
352!$OMP THREADPRIVATE(bbase)
353!
354      REAL,SAVE,ALLOCATABLE :: zqasc(:,:)
355!$OMP THREADPRIVATE( zqasc)
356      INTEGER,ALLOCATABLE,SAVE :: ibas_con(:), itop_con(:)
357!$OMP THREADPRIVATE(ibas_con,itop_con)
358      REAL,SAVE,ALLOCATABLE :: rain_con(:)
359!$OMP THREADPRIVATE(rain_con)
360      REAL,SAVE,ALLOCATABLE :: snow_con(:)
361!$OMP THREADPRIVATE(snow_con)
362!
363      REAL,SAVE,ALLOCATABLE :: rlonPOS(:)
364!$OMP THREADPRIVATE(rlonPOS)
365      REAL,SAVE,ALLOCATABLE :: newsst(:)
366!$OMP THREADPRIVATE(newsst)
367      REAL,SAVE,ALLOCATABLE :: ustar(:,:),u10m(:,:), v10m(:,:),wstar(:,:)
368!$OMP THREADPRIVATE(ustar,u10m,v10m,wstar)
369!
370! ok_ade=T -ADE=topswad-topsw
371! ok_aie=T ->
372!       ok_ade=T -AIE=topswai-topswad
373!       ok_ade=F -AIE=topswai-topsw
374!
375!topswad, solswad : Aerosol direct effect
376      REAL,SAVE,ALLOCATABLE :: topswad(:), solswad(:)
377!$OMP THREADPRIVATE(topswad,solswad)
378!topswai, solswai : Aerosol indirect effect
379      REAL,SAVE,ALLOCATABLE :: topswai(:), solswai(:)
380!$OMP THREADPRIVATE(topswai,solswai)
381
382      REAL,SAVE,ALLOCATABLE :: tau_aero(:,:,:,:), piz_aero(:,:,:,:), cg_aero(:,:,:,:)
383!$OMP THREADPRIVATE(tau_aero, piz_aero, cg_aero)
384      REAL,SAVE,ALLOCATABLE :: tau_aero_sw_rrtm(:,:,:,:), piz_aero_sw_rrtm(:,:,:,:), cg_aero_sw_rrtm(:,:,:,:)
385!$OMP THREADPRIVATE(tau_aero_sw_rrtm, piz_aero_sw_rrtm, cg_aero_sw_rrtm)
386      REAL,SAVE,ALLOCATABLE :: tau_aero_lw_rrtm(:,:,:,:), piz_aero_lw_rrtm(:,:,:,:), cg_aero_lw_rrtm(:,:,:,:)
387!$OMP THREADPRIVATE(tau_aero_lw_rrtm, piz_aero_lw_rrtm, cg_aero_lw_rrtm)
388      REAL,SAVE,ALLOCATABLE :: ccm(:,:,:)
389!$OMP THREADPRIVATE(ccm)
390
391!!! nrlmd le 10/04/2012
392      REAL,SAVE,ALLOCATABLE :: ale_bl_trig(:)
393!$OMP THREADPRIVATE(ale_bl_trig)
394!!! fin nrlmd le 10/04/2012
395
396      REAL, ALLOCATABLE, SAVE:: du_gwd_rando(:, :), dv_gwd_rando(:, :)
397      !$OMP THREADPRIVATE(du_gwd_rando, dv_gwd_rando)
398      ! tendencies on wind due to gravity waves
399
400CONTAINS
401
402!======================================================================
403SUBROUTINE phys_state_var_init(read_climoz)
404USE dimphy
405!USE control_mod
406USE aero_mod
407USE infotrac_phy, ONLY : nbtr
408!USE phytrac_mod, ONLY: nbtr
409USE indice_sol_mod
410IMPLICIT NONE
411
412integer, intent(in)::  read_climoz
413! read ozone climatology
414! Allowed values are 0, 1 and 2
415! 0: do not read an ozone climatology
416! 1: read a single ozone climatology that will be used day and night
417! 2: read two ozone climatologies, the average day and night
418! climatology and the daylight climatology
419
420include "clesphys.h"
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(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.