source: LMDZ5/trunk/libf/phylmd/phys_output_write_F90.h @ 1798

Last change on this file since 1798 was 1798, checked in by Ehouarn Millour, 12 years ago

Création d'un module phys_output_write_mod en remplacement de phys_output_write_new.h.
UG
.............................
Turning phys_output_write_new.h into a module named phys_output_write_mod.
UG

File size: 31.6 KB
Line 
1
2      ndex2d = 0
3      ndex3d = 0
4
5!!! Champs 1D !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
6      CALL histwrite_phy(o_phis, pphis)
7       IF (.TRUE.) THEN
8      CALL histwrite_phy(o_aire, airephy)
9      DO i=1, klon
10       zx_tmp_fi2d(i)=pctsrf(i,is_ter)+pctsrf(i,is_lic)
11      ENDDO
12      CALL histwrite_phy(o_contfracATM, zx_tmp_fi2d)
13       ENDIF
14      CALL histwrite_phy(o_contfracOR, pctsrf(:,is_ter))
15      CALL histwrite_phy(o_aireTER, paire_ter)
16!!! Champs 2D !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
17      CALL histwrite_phy(o_flat, zxfluxlat)
18      CALL histwrite_phy(o_slp, slp)
19      CALL histwrite_phy(o_tsol, zxtsol)
20      CALL histwrite_phy(o_t2m, zt2m)
21      IF (.TRUE.) THEN
22      CALL histwrite_phy(o_t2m_min, zt2m)
23      CALL histwrite_phy(o_t2m_max, zt2m)
24       ENDIF
25      DO i=1, klon
26       zx_tmp_fi2d(i)=SQRT(zu10m(i)*zu10m(i)+zv10m(i)*zv10m(i))
27      ENDDO
28      CALL histwrite_phy(o_wind10m, zx_tmp_fi2d)
29      IF (.TRUE.) THEN
30      DO i=1, klon
31       zx_tmp_fi2d(i)=SQRT(zu10m(i)*zu10m(i)+zv10m(i)*zv10m(i))
32      ENDDO
33      CALL histwrite_phy(o_wind10max, zx_tmp_fi2d)
34      ENDIF
35      DO i = 1, klon
36         zx_tmp_fi2d(i) = pctsrf(i,is_sic)
37      ENDDO
38      CALL histwrite_phy(o_sicf, zx_tmp_fi2d)
39      CALL histwrite_phy(o_q2m, zq2m)
40      CALL histwrite_phy(o_ustar, zustar)
41      CALL histwrite_phy(o_u10m, zu10m)
42      CALL histwrite_phy(o_v10m, zv10m)
43      DO i = 1, klon
44         zx_tmp_fi2d(i) = paprs(i,1)
45      ENDDO
46      CALL histwrite_phy(o_psol, zx_tmp_fi2d)
47      CALL histwrite_phy(o_mass, zmasse)
48      CALL histwrite_phy(o_qsurf, zxqsurf)
49       if (.not. ok_veget) then
50      CALL histwrite_phy(o_qsol, qsol)
51       endif
52       DO i = 1, klon
53         zx_tmp_fi2d(i) = rain_fall(i) + snow_fall(i)
54       ENDDO
55      CALL histwrite_phy(o_precip, zx_tmp_fi2d)
56      CALL histwrite_phy(o_ndayrain, nday_rain)
57       DO i = 1, klon
58         zx_tmp_fi2d(i) = rain_lsc(i) + snow_lsc(i)
59       ENDDO
60      CALL histwrite_phy(o_plul, zx_tmp_fi2d)
61      DO i = 1, klon
62         zx_tmp_fi2d(i) = rain_con(i) + snow_con(i)
63      ENDDO
64      CALL histwrite_phy(o_pluc, zx_tmp_fi2d)
65      CALL histwrite_phy(o_snow, snow_fall)
66      CALL histwrite_phy(o_msnow, snow_o)
67      CALL histwrite_phy(o_fsnow, zfra_o)
68      CALL histwrite_phy(o_evap, evap)
69      CALL histwrite_phy(o_tops, topsw)
70      CALL histwrite_phy(o_tops0, topsw0)
71      CALL histwrite_phy(o_topl, toplw)
72      CALL histwrite_phy(o_topl0, toplw0)
73      zx_tmp_fi2d(1 : klon) = swup ( 1 : klon, klevp1 )
74      CALL histwrite_phy(o_SWupTOA, zx_tmp_fi2d)
75      zx_tmp_fi2d(1 : klon) = swup0 ( 1 : klon, klevp1 )
76      CALL histwrite_phy(o_SWupTOAclr, zx_tmp_fi2d)
77      zx_tmp_fi2d(1 : klon) = swdn ( 1 : klon, klevp1 )
78      CALL histwrite_phy(o_SWdnTOA, zx_tmp_fi2d)
79      zx_tmp_fi2d(1 : klon) = swdn0 ( 1 : klon, klevp1 )
80      CALL histwrite_phy(o_SWdnTOAclr, zx_tmp_fi2d)
81      zx_tmp_fi2d(:) = topsw(:)-toplw(:)
82      CALL histwrite_phy(o_nettop, zx_tmp_fi2d)
83      CALL histwrite_phy(o_SWup200, SWup200)
84      CALL histwrite_phy(o_SWup200clr, SWup200clr)
85      CALL histwrite_phy(o_SWdn200, SWdn200)
86      CALL histwrite_phy(o_SWdn200clr, SWdn200clr)
87      CALL histwrite_phy(o_LWup200, LWup200)
88      CALL histwrite_phy(o_LWup200clr, LWup200clr)
89      CALL histwrite_phy(o_LWdn200, LWdn200)
90      CALL histwrite_phy(o_LWdn200clr, LWdn200clr)
91      CALL histwrite_phy(o_sols, solsw)
92      CALL histwrite_phy(o_sols0, solsw0)
93      CALL histwrite_phy(o_soll, sollw)
94      CALL histwrite_phy(o_radsol, radsol)
95      CALL histwrite_phy(o_soll0, sollw0)
96      zx_tmp_fi2d(1 : klon) = swup ( 1 : klon, 1 )
97      CALL histwrite_phy(o_SWupSFC, zx_tmp_fi2d)
98      zx_tmp_fi2d(1 : klon) = swup0 ( 1 : klon, 1 )
99      CALL histwrite_phy(o_SWupSFCclr, zx_tmp_fi2d)
100      zx_tmp_fi2d(1 : klon) = swdn ( 1 : klon, 1 )
101      CALL histwrite_phy(o_SWdnSFC, zx_tmp_fi2d)
102      zx_tmp_fi2d(1 : klon) = swdn0 ( 1 : klon, 1 )
103      CALL histwrite_phy(o_SWdnSFCclr, zx_tmp_fi2d)
104      zx_tmp_fi2d(1:klon)=sollwdown(1:klon)-sollw(1:klon)
105      CALL histwrite_phy(o_LWupSFC, zx_tmp_fi2d)
106      CALL histwrite_phy(o_LWdnSFC, sollwdown)
107
108       sollwdownclr(1:klon) = -1.*lwdn0(1:klon,1)
109      zx_tmp_fi2d(1:klon)=sollwdownclr(1:klon)-sollw0(1:klon)
110      CALL histwrite_phy(o_LWupSFCclr, zx_tmp_fi2d)
111      CALL histwrite_phy(o_LWdnSFCclr, sollwdownclr)
112      CALL histwrite_phy(o_bils, bils)
113      CALL histwrite_phy(o_bils_diss, bils_diss)
114      CALL histwrite_phy(o_bils_ec, bils_ec)
115      CALL histwrite_phy(o_bils_tke, bils_tke)
116      CALL histwrite_phy(o_bils_kinetic, bils_kinetic)
117      CALL histwrite_phy(o_bils_latent, bils_latent)
118      CALL histwrite_phy(o_bils_enthalp, bils_enthalp)
119
120      zx_tmp_fi2d(1:klon)=-1*sens(1:klon)
121
122      CALL histwrite_phy(o_sens, zx_tmp_fi2d)
123      CALL histwrite_phy(o_fder, fder)
124      CALL histwrite_phy(o_ffonte, zxffonte)
125      CALL histwrite_phy(o_fqcalving, zxfqcalving)
126      CALL histwrite_phy(o_fqfonte, zxfqfonte)
127         zx_tmp_fi2d=0.
128         do nsrf=1,nbsrf
129          zx_tmp_fi2d(:)=zx_tmp_fi2d(:)+pctsrf(:,nsrf)*fluxu(:,1,nsrf)
130         enddo
131      CALL histwrite_phy(o_taux, zx_tmp_fi2d)
132         zx_tmp_fi2d=0.
133         do nsrf=1,nbsrf
134          zx_tmp_fi2d(:)=zx_tmp_fi2d(:)+pctsrf(:,nsrf)*fluxv(:,1,nsrf)
135         enddo
136      CALL histwrite_phy(o_tauy, zx_tmp_fi2d)
137
138
139         DO nsrf = 1, nbsrf
140!           IF(nsrf.GE.2) THEN
141            zx_tmp_fi2d(1 : klon) = pctsrf( 1 : klon, nsrf)*100.
142      CALL histwrite_phy(o_pourc_srf(nsrf), zx_tmp_fi2d)
143          zx_tmp_fi2d(1 : klon) = pctsrf( 1 : klon, nsrf)
144      CALL histwrite_phy(o_fract_srf(nsrf), zx_tmp_fi2d)
145!         ENDIF !nsrf.GT.2
146        zx_tmp_fi2d(1 : klon) = fluxu( 1 : klon, 1, nsrf)
147      CALL histwrite_phy(o_taux_srf(nsrf), zx_tmp_fi2d)
148        zx_tmp_fi2d(1 : klon) = fluxv( 1 : klon, 1, nsrf)
149      CALL histwrite_phy(o_tauy_srf(nsrf), zx_tmp_fi2d)
150        zx_tmp_fi2d(1 : klon) = ftsol( 1 : klon, nsrf)
151      CALL histwrite_phy(o_tsol_srf(nsrf), zx_tmp_fi2d)
152        zx_tmp_fi2d(1 : klon) = evap_pot( 1 : klon, nsrf)
153      CALL histwrite_phy(o_evappot_srf(nsrf), zx_tmp_fi2d)
154      zx_tmp_fi2d(1 : klon) = ustar(1 : klon, nsrf)
155      CALL histwrite_phy(o_ustar_srf(nsrf), zx_tmp_fi2d)
156      zx_tmp_fi2d(1 : klon) = u10m(1 : klon, nsrf)
157      CALL histwrite_phy(o_u10m_srf(nsrf), zx_tmp_fi2d)
158      zx_tmp_fi2d(1 : klon) = v10m(1 : klon, nsrf)
159      CALL histwrite_phy(o_v10m_srf(nsrf), zx_tmp_fi2d)
160      zx_tmp_fi2d(1 : klon) = t2m(1 : klon, nsrf)
161      CALL histwrite_phy(o_t2m_srf(nsrf), zx_tmp_fi2d)
162      zx_tmp_fi2d(1 : klon) = fevap(1 : klon, nsrf)
163      CALL histwrite_phy(o_evap_srf(nsrf), zx_tmp_fi2d)
164       zx_tmp_fi2d(1 : klon) = fluxt( 1 : klon, 1, nsrf)
165      CALL histwrite_phy(o_sens_srf(nsrf), zx_tmp_fi2d)
166        zx_tmp_fi2d(1 : klon) = fluxlat( 1 : klon, nsrf)
167      CALL histwrite_phy(o_lat_srf(nsrf), zx_tmp_fi2d)
168        zx_tmp_fi2d(1 : klon) = fsollw( 1 : klon, nsrf)
169      CALL histwrite_phy(o_flw_srf(nsrf), zx_tmp_fi2d)
170        zx_tmp_fi2d(1 : klon) = fsolsw( 1 : klon, nsrf)
171      CALL histwrite_phy(o_fsw_srf(nsrf), zx_tmp_fi2d)
172        zx_tmp_fi2d(1 : klon) = wfbils( 1 : klon, nsrf)
173      CALL histwrite_phy(o_wbils_srf(nsrf), zx_tmp_fi2d)
174        zx_tmp_fi2d(1 : klon) = wfbilo( 1 : klon, nsrf)
175      CALL histwrite_phy(o_wbilo_srf(nsrf), zx_tmp_fi2d)
176
177      IF (iflag_pbl > 1) THEN
178      CALL histwrite_phy(o_tke_srf(nsrf),  &
179       pbl_tke(:,1:klev,nsrf))
180
181      IF (.TRUE.) THEN
182      CALL histwrite_phy(o_tke_max_srf(nsrf),  &
183       pbl_tke(:,1:klev,nsrf))
184      ENDIF
185      ENDIF
186
187      ENDDO
188      CALL histwrite_phy(o_cdrm, cdragm)
189      CALL histwrite_phy(o_cdrh, cdragh)
190      CALL histwrite_phy(o_cldl, cldl)
191      CALL histwrite_phy(o_cldm, cldm)
192      CALL histwrite_phy(o_cldh, cldh)
193      CALL histwrite_phy(o_cldt, cldt)
194      CALL histwrite_phy(o_cldq, cldq)
195      zx_tmp_fi2d(1:klon) = flwp(1:klon)
196      CALL histwrite_phy(o_lwp, zx_tmp_fi2d)
197      zx_tmp_fi2d(1:klon) = fiwp(1:klon)
198      CALL histwrite_phy(o_iwp, zx_tmp_fi2d)
199      CALL histwrite_phy(o_ue, ue)
200      CALL histwrite_phy(o_ve, ve)
201      CALL histwrite_phy(o_uq, uq)
202      CALL histwrite_phy(o_vq, vq)
203      IF(iflag_con.GE.3) THEN ! sb
204      CALL histwrite_phy(o_cape, cape)
205      CALL histwrite_phy(o_pbase, ema_pcb)
206      CALL histwrite_phy(o_ptop, ema_pct)
207      CALL histwrite_phy(o_fbase, ema_cbmf)
208        if (iflag_con /= 30) then
209      CALL histwrite_phy(o_plcl, plcl)
210      CALL histwrite_phy(o_plfc, plfc)
211      CALL histwrite_phy(o_wbeff, wbeff)
212        end if
213      IF (.TRUE.) THEN
214      CALL histwrite_phy(o_cape_max, cape)
215      ENDIF
216      CALL histwrite_phy(o_upwd, upwd)
217      CALL histwrite_phy(o_Ma, Ma)
218      CALL histwrite_phy(o_dnwd, dnwd)
219      CALL histwrite_phy(o_dnwd0, dnwd0)
220        zx_tmp_fi2d=float(itau_con)/float(itap)
221      CALL histwrite_phy(o_ftime_con, zx_tmp_fi2d)
222        if(iflag_thermals>=1)then
223         zx_tmp_fi3d=dnwd+dnwd0+upwd+fm_therm(:,1:klev)
224        else
225         zx_tmp_fi3d=dnwd+dnwd0+upwd
226        endif
227      CALL histwrite_phy(o_mc, zx_tmp_fi3d)
228      ENDIF !iflag_con .GE. 3
229      CALL histwrite_phy(o_prw, prw)
230      CALL histwrite_phy(o_s_pblh, s_pblh)
231      CALL histwrite_phy(o_s_pblt, s_pblt)
232      CALL histwrite_phy(o_s_lcl, s_lcl)
233      CALL histwrite_phy(o_s_therm, s_therm)
234!IM : Les champs suivants (s_capCL, s_oliqCL, s_cteiCL, s_trmb1, s_trmb2, s_trmb3) ne sont pas definis dans HBTM.F
235!       IF (o_s_capCL%flag(iff)<=lev_files(iff)) THEN
236!     CALL histwrite_phy(nid_files(iff),clef_stations(iff),
237!    $o_s_capCL%name,itau_w,s_capCL)
238!       ENDIF
239!       IF (o_s_oliqCL%flag(iff)<=lev_files(iff)) THEN
240!     CALL histwrite_phy(nid_files(iff),clef_stations(iff),
241!    $o_s_oliqCL%name,itau_w,s_oliqCL)
242!       ENDIF
243!       IF (o_s_cteiCL%flag(iff)<=lev_files(iff)) THEN
244!     CALL histwrite_phy(nid_files(iff),clef_stations(iff),
245!    $o_s_cteiCL%name,itau_w,s_cteiCL)
246!       ENDIF
247!       IF (o_s_trmb1%flag(iff)<=lev_files(iff)) THEN
248!     CALL histwrite_phy(nid_files(iff),clef_stations(iff),
249!    $o_s_trmb1%name,itau_w,s_trmb1)
250!       ENDIF
251!       IF (o_s_trmb2%flag(iff)<=lev_files(iff)) THEN
252!     CALL histwrite_phy(nid_files(iff),clef_stations(iff),
253!    $o_s_trmb2%name,itau_w,s_trmb2)
254!       ENDIF
255!       IF (o_s_trmb3%flag(iff)<=lev_files(iff)) THEN
256!     CALL histwrite_phy(nid_files(iff),clef_stations(iff),
257!    $o_s_trmb3%name,itau_w,s_trmb3)
258!       ENDIF
259
260
261
262! ATTENTION, LES ANCIENS HISTWRITE ONT ETES CONSERVES EN ATTENDANT MIEUX:
263! Champs interpolles sur des niveaux de pression
264      DO iff=1, nfiles
265        ll=0
266        DO k=1, nlevSTD
267         bb2=clevSTD(k) 
268         IF(bb2.EQ."850".OR.bb2.EQ."700".OR. &
269            bb2.EQ."500".OR.bb2.EQ."200".OR. &
270            bb2.EQ."100".OR. &
271            bb2.EQ."50".OR.bb2.EQ."10") THEN
272
273! a refaire correctement !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
274          ll=ll+1
275      CALL histwrite_phy(o_uSTDlevs(ll),uwriteSTD(:,k,iff), iff)
276      CALL histwrite_phy(o_vSTDlevs(ll),vwriteSTD(:,k,iff), iff)
277      CALL histwrite_phy(o_wSTDlevs(ll),wwriteSTD(:,k,iff), iff)
278      CALL histwrite_phy(o_zSTDlevs(ll),phiwriteSTD(:,k,iff), iff)
279      CALL histwrite_phy(o_qSTDlevs(ll),qwriteSTD(:,k,iff), iff)
280      CALL histwrite_phy(o_tSTDlevs(ll),twriteSTD(:,k,iff), iff)
281
282       ENDIF !(bb2.EQ."850".OR.bb2.EQ."700".OR.
283       ENDDO
284       ENDDO
285
286
287
288
289      DO i=1, klon
290       IF (pctsrf(i,is_oce).GT.epsfra.OR. &
291           pctsrf(i,is_sic).GT.epsfra) THEN
292        zx_tmp_fi2d(i) = (ftsol(i, is_oce) * pctsrf(i,is_oce)+ &
293                         ftsol(i, is_sic) * pctsrf(i,is_sic))/ &
294                         (pctsrf(i,is_oce)+pctsrf(i,is_sic))
295       ELSE
296        zx_tmp_fi2d(i) = 273.15
297       ENDIF
298      ENDDO
299      CALL histwrite_phy(o_t_oce_sic, zx_tmp_fi2d)
300
301! Couplage convection-couche limite
302      IF (iflag_con.GE.3) THEN
303      IF (iflag_coupl>=1) THEN
304      CALL histwrite_phy(o_ale_bl, ale_bl)
305      CALL histwrite_phy(o_alp_bl, alp_bl)
306      ENDIF !iflag_coupl>=1
307      ENDIF !(iflag_con.GE.3)
308! Wakes
309      IF (iflag_con.EQ.3) THEN
310      IF (iflag_wake>=1) THEN
311      CALL histwrite_phy(o_ale_wk, ale_wake)
312      CALL histwrite_phy(o_alp_wk, alp_wake)
313      CALL histwrite_phy(o_ale, ale)
314      CALL histwrite_phy(o_alp, alp)
315      CALL histwrite_phy(o_cin, cin)
316      CALL histwrite_phy(o_WAPE, wake_pe)
317      CALL histwrite_phy(o_wake_h, wake_h)
318      CALL histwrite_phy(o_wake_s, wake_s)
319      CALL histwrite_phy(o_wake_deltat, wake_deltat)
320      CALL histwrite_phy(o_wake_deltaq, wake_deltaq)
321      CALL histwrite_phy(o_wake_omg, wake_omg)
322           zx_tmp_fi3d(1:klon,1:klev)=d_t_wake(1:klon,1:klev) &
323                                              /pdtphys
324      CALL histwrite_phy(o_dtwak, zx_tmp_fi3d)
325        zx_tmp_fi3d(1:klon,1:klev)=d_q_wake(1:klon,1:klev)/pdtphys
326      CALL histwrite_phy(o_dqwak, zx_tmp_fi3d)
327      ENDIF ! iflag_wake>=1
328      CALL histwrite_phy(o_Vprecip, Vprecip)
329      CALL histwrite_phy(o_ftd, ftd)
330      CALL histwrite_phy(o_fqd, fqd)
331      ELSEIF (iflag_con.EQ.30) THEN
332! sortie RomP convection descente insaturee iflag_con=30
333      CALL histwrite_phy(o_Vprecip, Vprecip)
334      CALL histwrite_phy(o_wdtrainA, wdtrainA)
335      CALL histwrite_phy(o_wdtrainM, wdtrainM)
336      ENDIF !(iflag_con.EQ.3.or.iflag_con.EQ.30)
337!!! nrlmd le 10/04/2012
338        IF (iflag_trig_bl>=1) THEN
339      CALL histwrite_phy(o_n2, n2)
340      CALL histwrite_phy(o_s2, s2)
341      CALL histwrite_phy(o_proba_notrig, proba_notrig)
342      CALL histwrite_phy(o_random_notrig, random_notrig)
343      CALL histwrite_phy(o_ale_bl_stat, ale_bl_stat)
344      CALL histwrite_phy(o_ale_bl_trig, ale_bl_trig)
345       ENDIF  !(iflag_trig_bl>=1)
346        IF (iflag_clos_bl>=1) THEN
347      CALL histwrite_phy(o_alp_bl_det, alp_bl_det)
348      CALL histwrite_phy(o_alp_bl_fluct_m, alp_bl_fluct_m)
349      CALL histwrite_phy(o_alp_bl_fluct_tke,  &
350       alp_bl_fluct_tke)
351      CALL histwrite_phy(o_alp_bl_conv, alp_bl_conv)
352      CALL histwrite_phy(o_alp_bl_stat, alp_bl_stat)
353       ENDIF  !(iflag_clos_bl>=1)
354!!! fin nrlmd le 10/04/2012
355      WRITE(*,*) "TOTOTYPE OCEAN=",type_ocean
356      IF (type_ocean=='slab ') THEN
357      WRITE(*,*) "TOTOTYPE OCEAN=slab "
358      CALL histwrite_phy(o_slab_bils, slab_wfbils)
359      ENDIF !type_ocean == force/slab
360      CALL histwrite_phy(o_weakinv, weak_inversion)
361      CALL histwrite_phy(o_dthmin, dthmin)
362      CALL histwrite_phy(o_cldtau, cldtau)
363      CALL histwrite_phy(o_cldemi, cldemi)
364      CALL histwrite_phy(o_pr_con_l, pmflxr(:,1:klev))
365      CALL histwrite_phy(o_pr_con_i, pmflxs(:,1:klev))
366      CALL histwrite_phy(o_pr_lsc_l, prfl(:,1:klev))
367      CALL histwrite_phy(o_pr_lsc_i, psfl(:,1:klev))
368      CALL histwrite_phy(o_re, re)
369      CALL histwrite_phy(o_fl, fl)
370      DO i=1, klon
371       zx_tmp_fi2d(i)=MIN(100.,rh2m(i)*100.)
372      ENDDO
373      CALL histwrite_phy(o_rh2m, zx_tmp_fi2d)
374      IF (.TRUE.) THEN
375      DO i=1, klon
376       zx_tmp_fi2d(i)=MIN(100.,rh2m(i)*100.)
377      ENDDO
378      CALL histwrite_phy(o_rh2m_min, zx_tmp_fi2d)
379      DO i=1, klon
380       zx_tmp_fi2d(i)=MIN(100.,rh2m(i)*100.)
381      ENDDO
382      CALL histwrite_phy(o_rh2m_max, zx_tmp_fi2d)
383      ENDIF
384      CALL histwrite_phy(o_qsat2m, qsat2m)
385      CALL histwrite_phy(o_tpot, tpot)
386      CALL histwrite_phy(o_tpote, tpote)
387      zx_tmp_fi2d(1 : klon) = fsolsw( 1 : klon, is_ter)
388      CALL histwrite_phy(o_SWnetOR,  zx_tmp_fi2d)
389      zx_tmp_fi2d(1:klon) = solsw(1:klon)/(1.-albsol1(1:klon))
390      CALL histwrite_phy(o_SWdownOR,  zx_tmp_fi2d)
391      CALL histwrite_phy(o_LWdownOR, sollwdown)
392      CALL histwrite_phy(o_snowl, snow_lsc)
393      CALL histwrite_phy(o_solldown, sollwdown)
394      CALL histwrite_phy(o_dtsvdfo, d_ts(:,is_oce))
395      CALL histwrite_phy(o_dtsvdft, d_ts(:,is_ter))
396      CALL histwrite_phy(o_dtsvdfg,  d_ts(:,is_lic))
397      CALL histwrite_phy(o_dtsvdfi, d_ts(:,is_sic))
398      CALL histwrite_phy(o_rugs, zxrugs)
399! OD550 per species
400      IF (new_aod .and. (.not. aerosol_couple)) THEN
401          IF (ok_ade.OR.ok_aie) THEN
402      CALL histwrite_phy(o_od550aer, od550aer)
403      CALL histwrite_phy(o_od865aer, od865aer)
404      CALL histwrite_phy(o_absvisaer, absvisaer)
405      CALL histwrite_phy(o_od550lt1aer, od550lt1aer)
406      CALL histwrite_phy(o_sconcso4, sconcso4)
407      CALL histwrite_phy(o_sconcoa, sconcoa)
408      CALL histwrite_phy(o_sconcbc, sconcbc)
409      CALL histwrite_phy(o_sconcss, sconcss)
410      CALL histwrite_phy(o_sconcdust, sconcdust)
411      CALL histwrite_phy(o_concso4, concso4)
412      CALL histwrite_phy(o_concoa, concoa)
413      CALL histwrite_phy(o_concbc, concbc)
414      CALL histwrite_phy(o_concss, concss)
415      CALL histwrite_phy(o_concdust, concdust)
416      CALL histwrite_phy(o_loadso4, loadso4)
417      CALL histwrite_phy(o_loadoa, loadoa)
418      CALL histwrite_phy(o_loadbc, loadbc)
419      CALL histwrite_phy(o_loadss, loadss)
420      CALL histwrite_phy(o_loaddust, loaddust)
421!--STRAT AER
422          endif
423          IF (ok_ade.OR.ok_aie.OR.flag_aerosol_strat) THEN
424          DO naero = 1, naero_spc
425      CALL histwrite_phy(o_tausumaero(naero), &
426       tausum_aero(:,2,naero) )
427          END DO
428          endif
429      ENDIF
430       IF (ok_ade) THEN
431      CALL histwrite_phy(o_topswad, topswad_aero)
432      CALL histwrite_phy(o_topswad0, topswad0_aero)
433      CALL histwrite_phy(o_solswad, solswad_aero)
434      CALL histwrite_phy(o_solswad0, solswad0_aero)
435!====MS forcing diagnostics
436        if (new_aod) then
437      CALL histwrite_phy(o_swtoaas_nat, topsw_aero(:,1))
438      CALL histwrite_phy(o_swsrfas_nat, solsw_aero(:,1))
439      CALL histwrite_phy(o_swtoacs_nat, topsw0_aero(:,1))
440      CALL histwrite_phy(o_swsrfcs_nat, solsw0_aero(:,1))
441!ant
442      CALL histwrite_phy(o_swtoaas_ant, topsw_aero(:,2))
443      CALL histwrite_phy(o_swsrfas_ant, solsw_aero(:,2))
444      CALL histwrite_phy(o_swtoacs_ant, topsw0_aero(:,2))
445      CALL histwrite_phy(o_swsrfcs_ant, solsw0_aero(:,2))
446!cf
447        if (.not. aerosol_couple) then
448      CALL histwrite_phy(o_swtoacf_nat, topswcf_aero(:,1))
449      CALL histwrite_phy(o_swsrfcf_nat, solswcf_aero(:,1))
450      CALL histwrite_phy(o_swtoacf_ant, topswcf_aero(:,2))
451      CALL histwrite_phy(o_swsrfcf_ant, solswcf_aero(:,2))
452      CALL histwrite_phy(o_swtoacf_zero,topswcf_aero(:,3))
453      CALL histwrite_phy(o_swsrfcf_zero,solswcf_aero(:,3))
454        endif
455        endif ! new_aod
456!====MS forcing diagnostics
457       ENDIF
458       IF (ok_aie) THEN
459      CALL histwrite_phy(o_topswai, topswai_aero)
460      CALL histwrite_phy(o_solswai, solswai_aero)
461      CALL histwrite_phy(o_scdnc, scdnc)
462      CALL histwrite_phy(o_cldncl, cldncl)
463      CALL histwrite_phy(o_reffclws, reffclws)
464      CALL histwrite_phy(o_reffclwc, reffclwc)
465      CALL histwrite_phy(o_cldnvi, cldnvi)
466      CALL histwrite_phy(o_lcc, lcc)
467      CALL histwrite_phy(o_lcc3d, lcc3d)
468      CALL histwrite_phy(o_lcc3dcon, lcc3dcon)
469      CALL histwrite_phy(o_lcc3dstra, lcc3dstra)
470      CALL histwrite_phy(o_reffclwtop, reffclwtop)
471       ENDIF
472! Champs 3D:
473       IF (ok_ade .OR. ok_aie) then
474      CALL histwrite_phy(o_ec550aer, ec550aer)
475       ENDIF
476      CALL histwrite_phy(o_lwcon, flwc)
477      CALL histwrite_phy(o_iwcon, fiwc)
478      CALL histwrite_phy(o_temp, t_seri)
479      CALL histwrite_phy(o_theta, theta)
480      CALL histwrite_phy(o_ovapinit, qx(:,:,ivap))
481      CALL histwrite_phy(o_ovap, q_seri)
482      CALL histwrite_phy(o_oliq, ql_seri)
483      CALL histwrite_phy(o_geop, zphi)
484      CALL histwrite_phy(o_vitu, u_seri)
485      CALL histwrite_phy(o_vitv, v_seri)
486      CALL histwrite_phy(o_vitw, omega)
487      CALL histwrite_phy(o_pres, pplay)
488      CALL histwrite_phy(o_paprs, paprs(:,1:klev))
489         DO i=1, klon
490          zx_tmp_fi3d1(i,1)= pphis(i)/RG
491!020611   zx_tmp_fi3d(i,1)= pphis(i)/RG
492         ENDDO
493         DO k=1, klev
494!020611        DO k=1, klev-1
495         DO i=1, klon
496!020611         zx_tmp_fi3d(i,k+1)= zx_tmp_fi3d(i,k) - (t_seri(i,k) *RD * 
497          zx_tmp_fi3d1(i,k+1)= zx_tmp_fi3d1(i,k) - (t_seri(i,k) *RD *  &
498          (paprs(i,k+1) - paprs(i,k))) / ( pplay(i,k) * RG ) 
499         ENDDO
500         ENDDO
501      CALL histwrite_phy(o_zfull,zx_tmp_fi3d1(:,2:klevp1))
502!020611    $o_zfull%name,itau_w,zx_tmp_fi3d)
503         DO i=1, klon
504          zx_tmp_fi3d(i,1)= pphis(i)/RG - ( &
505          (t_seri(i,1)+zxtsol(i))/2. *RD * &
506          (pplay(i,1) - paprs(i,1)))/( (paprs(i,1)+pplay(i,1))/2.* RG)
507         ENDDO
508         DO k=1, klev-1
509         DO i=1, klon
510          zx_tmp_fi3d(i,k+1)= zx_tmp_fi3d(i,k) - ( &
511          (t_seri(i,k)+t_seri(i,k+1))/2. *RD *  &
512          (pplay(i,k+1) - pplay(i,k))) / ( paprs(i,k) * RG ) 
513         ENDDO
514         ENDDO
515      CALL histwrite_phy(o_zhalf, zx_tmp_fi3d)
516      CALL histwrite_phy(o_rneb, cldfra)
517      CALL histwrite_phy(o_rnebcon, rnebcon)
518      CALL histwrite_phy(o_rnebls, rneb)
519      CALL histwrite_phy(o_rhum, zx_rh)
520      CALL histwrite_phy(o_ozone, &
521       wo(:, :, 1) * dobson_u * 1e3 / zmasse / rmo3 * rmd)
522
523      IF (read_climoz == 2) THEN
524      CALL histwrite_phy(o_ozone_light, &
525       wo(:, :, 2) * dobson_u * 1e3 / zmasse / rmo3 * rmd)
526      ENDIF
527
528      CALL histwrite_phy(o_dtphy, d_t)
529      CALL histwrite_phy(o_dqphy,  d_qx(:,:,ivap))
530        DO nsrf=1, nbsrf
531        zx_tmp_fi2d(1 : klon) = falb1( 1 : klon, nsrf)
532      CALL histwrite_phy(o_albe_srf(nsrf), zx_tmp_fi2d)
533        zx_tmp_fi2d(1 : klon) = frugs( 1 : klon, nsrf)
534      CALL histwrite_phy(o_rugs_srf(nsrf), zx_tmp_fi2d)
535        zx_tmp_fi2d(1 : klon) = agesno( 1 : klon, nsrf)
536      CALL histwrite_phy(o_ages_srf(nsrf), zx_tmp_fi2d)
537        ENDDO !nsrf=1, nbsrf
538      CALL histwrite_phy(o_alb1, albsol1)
539      CALL histwrite_phy(o_alb2, albsol2)
540!FH Sorties pour la couche limite
541      if (iflag_pbl>1) then
542      zx_tmp_fi3d=0.
543      do nsrf=1,nbsrf
544         do k=1,klev
545          zx_tmp_fi3d(:,k)=zx_tmp_fi3d(:,k) &
546          +pctsrf(:,nsrf)*pbl_tke(:,k,nsrf)
547         enddo
548      enddo
549      CALL histwrite_phy(o_tke, zx_tmp_fi3d)
550      IF (.TRUE.) THEN
551      CALL histwrite_phy(o_tke_max, zx_tmp_fi3d)
552      ENDIF
553      endif
554      CALL histwrite_phy(o_kz, coefh(:,:,is_ave))
555      IF (.TRUE.) THEN
556      CALL histwrite_phy(o_kz_max, coefh(:,:,is_ave))
557      ENDIF
558      CALL histwrite_phy(o_clwcon, clwcon0)
559      CALL histwrite_phy(o_dtdyn, d_t_dyn)
560      CALL histwrite_phy(o_dqdyn, d_q_dyn)
561      CALL histwrite_phy(o_dudyn, d_u_dyn)
562      CALL histwrite_phy(o_dvdyn, d_v_dyn)
563      zx_tmp_fi3d(1:klon,1:klev)=d_t_con(1:klon,1:klev)/pdtphys
564      CALL histwrite_phy(o_dtcon, zx_tmp_fi3d)
565      if(iflag_thermals.eq.1)then
566      zx_tmp_fi3d(1:klon,1:klev)=d_t_con(1:klon,1:klev)/pdtphys + &
567                                 d_t_ajsb(1:klon,1:klev)/pdtphys
568      CALL histwrite_phy(o_tntc, zx_tmp_fi3d)
569      else if(iflag_thermals.gt.1.and.iflag_wake.EQ.1)then
570      zx_tmp_fi3d(1:klon,1:klev)=d_t_con(1:klon,1:klev)/pdtphys + &
571                                 d_t_ajs(1:klon,1:klev)/pdtphys + &
572                                 d_t_wake(1:klon,1:klev)/pdtphys
573      CALL histwrite_phy(o_tntc, zx_tmp_fi3d)
574      endif
575      zx_tmp_fi3d(1:klon,1:klev)=d_u_con(1:klon,1:klev)/pdtphys
576      CALL histwrite_phy(o_ducon, zx_tmp_fi3d)
577      zx_tmp_fi3d(1:klon,1:klev)=d_v_con(1:klon,1:klev)/pdtphys
578      CALL histwrite_phy(o_dvcon, zx_tmp_fi3d)
579      zx_tmp_fi3d(1:klon,1:klev)=d_q_con(1:klon,1:klev)/pdtphys
580      CALL histwrite_phy(o_dqcon, zx_tmp_fi3d)
581      if(iflag_thermals.eq.1)then
582      zx_tmp_fi3d(1:klon,1:klev)=d_q_con(1:klon,1:klev)/pdtphys
583      CALL histwrite_phy(o_tnhusc, zx_tmp_fi3d)
584      else if(iflag_thermals.gt.1.and.iflag_wake.EQ.1)then
585      zx_tmp_fi3d(1:klon,1:klev)=d_q_con(1:klon,1:klev)/pdtphys + &
586                                 d_q_ajs(1:klon,1:klev)/pdtphys + &
587                                 d_q_wake(1:klon,1:klev)/pdtphys
588      CALL histwrite_phy(o_tnhusc, zx_tmp_fi3d)
589      endif
590      zx_tmp_fi3d(1:klon,1:klev)=d_t_lsc(1:klon,1:klev)/pdtphys
591      CALL histwrite_phy(o_dtlsc, zx_tmp_fi3d)
592      zx_tmp_fi3d(1:klon, 1:klev)=(d_t_lsc(1:klon,1:klev)+ &
593                                 d_t_eva(1:klon,1:klev))/pdtphys
594      CALL histwrite_phy(o_dtlschr, zx_tmp_fi3d)
595      zx_tmp_fi3d(1:klon,1:klev)=d_q_lsc(1:klon,1:klev)/pdtphys
596      CALL histwrite_phy(o_dqlsc, zx_tmp_fi3d)
597      zx_tmp_fi3d(1:klon,1:klev)=beta_prec(1:klon,1:klev)
598      CALL histwrite_phy(o_beta_prec, zx_tmp_fi3d)
599!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
600! Sorties specifiques a la separation thermiques/non thermiques
601       if (iflag_thermals>=1) then
602      zx_tmp_fi3d(1:klon,1:klev)=d_t_lscth(1:klon,1:klev)/pdtphys
603      CALL histwrite_phy(o_dtlscth, zx_tmp_fi3d)
604      zx_tmp_fi3d(1:klon,1:klev)=d_t_lscst(1:klon,1:klev)/pdtphys
605      CALL histwrite_phy(o_dtlscst, zx_tmp_fi3d)
606      zx_tmp_fi3d(1:klon,1:klev)=d_q_lscth(1:klon,1:klev)/pdtphys
607      CALL histwrite_phy(o_dqlscth, zx_tmp_fi3d)
608      zx_tmp_fi3d(1:klon,1:klev)=d_q_lscst(1:klon,1:klev)/pdtphys
609      CALL histwrite_phy(o_dqlscst, zx_tmp_fi3d)
610      CALL histwrite_phy(o_plulth, plul_th)
611      CALL histwrite_phy(o_plulst, plul_st)
612      do k=1,klev
613      do i=1,klon
614          if (ptconvth(i,k)) then
615           zx_tmp_fi3d(i,k)=1.
616          else
617           zx_tmp_fi3d(i,k)=0.
618          endif
619      enddo
620      enddo
621      CALL histwrite_phy(o_ptconvth, zx_tmp_fi3d)
622      do i=1,klon
623           zx_tmp_fi2d(1:klon)=lmax_th(:)
624      enddo
625      CALL histwrite_phy(o_lmaxth, zx_tmp_fi2d)
626      endif ! iflag_thermals>=1
627!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
628      zx_tmp_fi3d(1:klon,1:klev)=d_t_vdf(1:klon,1:klev)/pdtphys
629      CALL histwrite_phy(o_dtvdf, zx_tmp_fi3d)
630      zx_tmp_fi3d(1:klon,1:klev)=d_t_diss(1:klon,1:klev)/pdtphys
631      CALL histwrite_phy(o_dtdis, zx_tmp_fi3d)
632      zx_tmp_fi3d(1:klon,1:klev)=d_q_vdf(1:klon,1:klev)/pdtphys
633      CALL histwrite_phy(o_dqvdf, zx_tmp_fi3d)
634      zx_tmp_fi3d(1:klon,1:klev)=d_t_eva(1:klon,1:klev)/pdtphys
635      CALL histwrite_phy(o_dteva, zx_tmp_fi3d)
636      zx_tmp_fi3d(1:klon,1:klev)=d_q_eva(1:klon,1:klev)/pdtphys
637      CALL histwrite_phy(o_dqeva, zx_tmp_fi3d)
638      zpt_conv = 0.
639      where (ptconv) zpt_conv = 1.
640      CALL histwrite_phy(o_ptconv, zpt_conv)
641      CALL histwrite_phy(o_ratqs, ratqs)
642      zx_tmp_fi3d(1:klon,1:klev)=d_t_ajs(1:klon,1:klev)/pdtphys - &
643                                 d_t_ajsb(1:klon,1:klev)/pdtphys
644      CALL histwrite_phy(o_dtthe, zx_tmp_fi3d)
645       IF (iflag_thermals>=1) THEN
646! Pour l instant 0 a y reflichir pour les thermiques
647         zx_tmp_fi2d=0. 
648      CALL histwrite_phy(o_ftime_th, zx_tmp_fi2d)
649      CALL histwrite_phy(o_f_th, fm_therm)
650      CALL histwrite_phy(o_e_th, entr_therm)
651      CALL histwrite_phy(o_w_th, zw2)
652      CALL histwrite_phy(o_q_th, zqasc)
653      CALL histwrite_phy(o_a_th, fraca)
654      CALL histwrite_phy(o_d_th, detr_therm)
655      CALL histwrite_phy(o_f0_th, f0)
656      CALL histwrite_phy(o_zmax_th, zmax_th)
657      zx_tmp_fi3d(1:klon,1:klev)=d_q_ajs(1:klon,1:klev)/pdtphys - &
658                                 d_q_ajsb(1:klon,1:klev)/pdtphys
659      CALL histwrite_phy(o_dqthe, zx_tmp_fi3d)
660      ENDIF !iflag_thermals
661      zx_tmp_fi3d(1:klon,1:klev)=d_t_ajsb(1:klon,1:klev)/pdtphys
662      CALL histwrite_phy(o_dtajs, zx_tmp_fi3d)
663      zx_tmp_fi3d(1:klon,1:klev)=d_q_ajsb(1:klon,1:klev)/pdtphys
664      CALL histwrite_phy(o_dqajs, zx_tmp_fi3d)
665      zx_tmp_fi3d(1:klon,1:klev)=heat(1:klon,1:klev)/RDAY
666      CALL histwrite_phy(o_dtswr, zx_tmp_fi3d)
667      zx_tmp_fi3d(1:klon,1:klev)=heat0(1:klon,1:klev)/RDAY
668      CALL histwrite_phy(o_dtsw0, zx_tmp_fi3d)
669      zx_tmp_fi3d(1:klon,1:klev)=-1.*cool(1:klon,1:klev)/RDAY
670      CALL histwrite_phy(o_dtlwr, zx_tmp_fi3d)
671      zx_tmp_fi3d(1:klon,1:klev)=-1.*cool0(1:klon,1:klev)/RDAY
672      CALL histwrite_phy(o_dtlw0, zx_tmp_fi3d)
673      zx_tmp_fi3d(1:klon,1:klev)=d_t_ec(1:klon,1:klev)/pdtphys
674      CALL histwrite_phy(o_dtec, zx_tmp_fi3d)
675      zx_tmp_fi3d(1:klon,1:klev)=d_u_vdf(1:klon,1:klev)/pdtphys
676      CALL histwrite_phy(o_duvdf, zx_tmp_fi3d)
677      zx_tmp_fi3d(1:klon,1:klev)=d_v_vdf(1:klon,1:klev)/pdtphys
678      CALL histwrite_phy(o_dvvdf, zx_tmp_fi3d)
679       IF (ok_orodr) THEN
680      zx_tmp_fi3d(1:klon,1:klev)=d_u_oro(1:klon,1:klev)/pdtphys
681      CALL histwrite_phy(o_duoro, zx_tmp_fi3d)
682      zx_tmp_fi3d(1:klon,1:klev)=d_v_oro(1:klon,1:klev)/pdtphys
683      CALL histwrite_phy(o_dvoro, zx_tmp_fi3d)
684      zx_tmp_fi3d(1:klon,1:klev)=d_t_oro(1:klon,1:klev)/pdtphys
685      CALL histwrite_phy(o_dtoro, zx_tmp_fi3d)
686       ENDIF
687        IF (ok_orolf) THEN
688      zx_tmp_fi3d(1:klon,1:klev)=d_u_lif(1:klon,1:klev)/pdtphys
689      CALL histwrite_phy(o_dulif, zx_tmp_fi3d)
690       ENDIF
691      zx_tmp_fi3d(1:klon,1:klev)=d_v_lif(1:klon,1:klev)/pdtphys
692      CALL histwrite_phy(o_dvlif, zx_tmp_fi3d)
693
694      zx_tmp_fi3d(1:klon,1:klev)=d_t_lif(1:klon,1:klev)/pdtphys
695      CALL histwrite_phy(o_dtlif, zx_tmp_fi3d)
696
697       IF (ok_hines) THEN
698      zx_tmp_fi3d(1:klon,1:klev)=d_u_hin(1:klon,1:klev)/pdtphys
699      CALL histwrite_phy(o_duhin, zx_tmp_fi3d)
700      zx_tmp_fi3d(1:klon,1:klev)=d_v_hin(1:klon,1:klev)/pdtphys
701      CALL histwrite_phy(o_dvhin, zx_tmp_fi3d)
702      zx_tmp_fi3d(1:klon,1:klev)=d_t_hin(1:klon,1:klev)/pdtphys
703      CALL histwrite_phy(o_dthin, zx_tmp_fi3d)
704        ENDIF
705      CALL histwrite_phy(o_rsu, swup)
706      CALL histwrite_phy(o_rsd, swdn)
707      CALL histwrite_phy(o_rlu, lwup)
708      CALL histwrite_phy(o_rld, lwdn)
709      CALL histwrite_phy(o_rsucs, swup0)
710      CALL histwrite_phy(o_rsdcs, swdn0)
711      CALL histwrite_phy(o_rlucs, lwup0)
712      CALL histwrite_phy(o_rldcs, lwdn0)
713      zx_tmp_fi3d(1:klon,1:klev)=d_t(1:klon,1:klev)+ &
714      d_t_dyn(1:klon,1:klev)
715      CALL histwrite_phy(o_tnt, zx_tmp_fi3d)
716      zx_tmp_fi3d(1:klon,1:klev)=heat(1:klon,1:klev)/RDAY - &
717      cool(1:klon,1:klev)/RDAY
718      CALL histwrite_phy(o_tntr, zx_tmp_fi3d)
719      zx_tmp_fi3d(1:klon,1:klev)= (d_t_lsc(1:klon,1:klev)+ &
720                                   d_t_eva(1:klon,1:klev)+ &
721                                   d_t_vdf(1:klon,1:klev))/pdtphys
722      CALL histwrite_phy(o_tntscpbl, zx_tmp_fi3d)
723      zx_tmp_fi3d(1:klon,1:klev)=d_qx(1:klon,1:klev,ivap)+ &
724      d_q_dyn(1:klon,1:klev)
725      CALL histwrite_phy(o_tnhus, zx_tmp_fi3d)
726      zx_tmp_fi3d(1:klon,1:klev)=d_q_lsc(1:klon,1:klev)/pdtphys+ &
727                                 d_q_eva(1:klon,1:klev)/pdtphys
728      CALL histwrite_phy(o_tnhusscpbl, zx_tmp_fi3d)
729      CALL histwrite_phy(o_evu, coefm(:,:,is_ave))
730      zx_tmp_fi3d(1:klon,1:klev)=q_seri(1:klon,1:klev)+ &
731                                 ql_seri(1:klon,1:klev) 
732      CALL histwrite_phy(o_h2o, zx_tmp_fi3d)
733       if (iflag_con >= 3) then
734             zx_tmp_fi3d(1:klon,1:klev)=-1 * (dnwd(1:klon,1:klev)+ &
735                  dnwd0(1:klon,1:klev)) 
736      CALL histwrite_phy(o_mcd, zx_tmp_fi3d)
737             zx_tmp_fi3d(1:klon,1:klev)=upwd(1:klon,1:klev) + &
738                  dnwd(1:klon,1:klev)+ dnwd0(1:klon,1:klev) 
739      CALL histwrite_phy(o_dmc, zx_tmp_fi3d)
740       else if (iflag_con == 2) then
741      CALL histwrite_phy(o_mcd,  pmfd)
742      CALL histwrite_phy(o_dmc,  pmfu + pmfd)
743       end if
744      CALL histwrite_phy(o_ref_liq, ref_liq)
745      CALL histwrite_phy(o_ref_ice, ref_ice)
746      if (RCO2_per.NE.RCO2_act.OR.RCH4_per.NE.RCH4_act.OR. &
747       RN2O_per.NE.RN2O_act.OR.RCFC11_per.NE.RCFC11_act.OR. &
748       RCFC12_per.NE.RCFC12_act) THEN
749      zx_tmp_fi2d(1 : klon) = swupp ( 1 : klon, klevp1 )
750      CALL histwrite_phy(o_rsut4co2, zx_tmp_fi2d)
751      zx_tmp_fi2d(1 : klon) = lwupp ( 1 : klon, klevp1 )
752      CALL histwrite_phy(o_rlut4co2, zx_tmp_fi2d)
753      zx_tmp_fi2d(1 : klon) = swup0p ( 1 : klon, klevp1 )
754      CALL histwrite_phy(o_rsutcs4co2, zx_tmp_fi2d)
755      zx_tmp_fi2d(1 : klon) = lwup0p ( 1 : klon, klevp1 )
756      CALL histwrite_phy(o_rlutcs4co2, zx_tmp_fi2d)
757      CALL histwrite_phy(o_rsu4co2, swupp)
758      CALL histwrite_phy(o_rlu4co2, lwupp)
759      CALL histwrite_phy(o_rsucs4co2, swup0p)
760      CALL histwrite_phy(o_rlucs4co2, lwup0p)
761      CALL histwrite_phy(o_rsd4co2, swdnp)
762      CALL histwrite_phy(o_rld4co2, lwdnp)
763      CALL histwrite_phy(o_rsdcs4co2, swdn0p)
764      CALL histwrite_phy(o_rldcs4co2, lwdn0p)
765      endif
766        if (nqtot.GE.3) THEN
767         DO iq=3,nqtot
768      CALL histwrite_phy(o_trac(iq-2), qx(:,:,iq))
769         ENDDO
770         DO iq=3,nqtot
771         zx_tmp_fi2d=0.
772         do k=1,klev
773            zx_tmp_fi2d(:)=zx_tmp_fi2d(:)+zmasse(:,k)*qx(:,k,iq)
774         enddo
775      CALL histwrite_phy(o_trac_cum(iq-2), zx_tmp_fi2d)
776         ENDDO
777        endif
778
Note: See TracBrowser for help on using the repository browser.