source: LMDZ6/branches/Ocean_skin/libf/phylmd/phys_state_var_mod.F90 @ 3777

Last change on this file since 3777 was 3767, checked in by lguez, 5 years ago

Store delta_sal instead of s_int

Revision analoguous to revision [3744], for salinity. Store as a state
variable and send to the ocean delta_sal, the difference between
ocean-air interface salinity and bulk salinity, instead of s_int,
the interface salinity.

So replace dummy argument s_int of procedure cpl_send_ocean_fields
by dummy argument delta_sal. Replace dummy argument s_int of
procedures ocean_cpl_noice and surf_ocean by dummy argument
delta_sal. Replace variable s_int of module phys_state_var_mod
by variable delta_sal. Rename local variable ys_int of procedure
pbl_surface to ydelta_sal. Set variable delta_sal of module
phys_state_var_mod to 0 for an appearing ocean fraction and a
missing startup field. Replace variable o_s_int of module
phys_output_ctrlout_mod by variable o_delta_sal.

Rename variables cpl_s_int and cpl_s_int_2D of module cpl_mod to
cpl_delta_sal and cpl_delta_sal_2D. Rename variable ids_s_int of
module oasis to ids_delta_sal. Change infosend(ids_delta_sal)%name
to "CODELSSS".

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