source: LMDZ4/branches/LMDZ4_AR5/libf/phylmd/phys_state_var_mod.F90 @ 3536

Last change on this file since 3536 was 1534, checked in by musat, 14 years ago

Ajouts CFMIP2/CMIP5

  • 6eme fichier de sortie "stations" histstn.nc qui necessite 2 fichiers: PARAM/npCFMIP_param.data contenant le nombre de points (120 pour simulations AMIP, 73 pour aqua) PARAM/pointlocations.txt contenat le numero, les coordonnees (lon,lat) et le nom de chaque station
  • flag LOGICAL dans tous les appels histwrite_phy pour pouvoir sortir le fichier histstn.nc

NB: 1) les flags de type phys_ que l'on met dans le physiq.def_L* pour ajouter plus de sorties

necessitent dorenavant 6 valeurs, la 6eme correspondant au fichier histstn.nc

2) par defaut le fichier histstn.nc ne sort pas; pour le sortir ajouter les lignes suivantes

dans physiq.def_L*

### Type de fichier : global (n) ou stations (y)
phys_out_filestations = n n n n n y

  • introduction de 2 jeux de flags pour les taux des GES; taux actuels avec suffixes _act, taux futurs avec "_per" avec 2 appels au rayonnement si taux "_per" different des taux "_act" (utiles pour diags. CFMIP 4CO2)
  • flags "betaCRF" pour calculs CRF pour experiences sensibilite proprietes optiques eau liquide nuageuse avec initialisations par defaut; sinon besoin de fichier beta_crf.data

IM

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