source: LMDZ4/trunk/libf/phylmd/write_histmth.h @ 928

Last change on this file since 928 was 903, checked in by Laurent Fairhead, 17 years ago

On avait perdu les sorties aerosols de Johannes dans un merge
LF

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 71.1 KB
RevLine 
[644]1c
2c $Header$
3c
[524]4      IF (ok_mensuel) THEN
5c
6      ndex2d = 0
7      ndex3d = 0
8
9         itau_w = itau_phy + itap
10
[879]11c  temperature tendency due to moist convective processes
12       DO l=1, klev
13       DO i=1, klon
14        zx_tmp_fi3d(i,l)=d_t_con(i,l)/pdtphys
15       ENDDO !i
16       ENDDO !l
[524]17c
[879]18
19c
[644]20      IF(type_run.EQ."CLIM".OR.type_run.EQ."ENSP") THEN
21c
[524]22      IF(lev_histmth.GE.1) THEN
23c
24c Champs 2D:
25c
[766]26cym      CALL gr_fi_ecrit(1,klon,iim,jjmp1,pphis,zx_tmp_2d)
27      CALL histwrite_phy(nid_mth,"phis",itau_w,pphis)
[524]28C
[644]29cIM 310804   CALL gr_fi_ecrit(1,klon,iim,jjmp1,paire,zx_tmp_2d)
[766]30cym      CALL gr_fi_ecrit(1,klon,iim,jjmp1,airephy,zx_tmp_2d)
31      CALL histwrite_phy(nid_mth,"aire",itau_w,airephy)
[524]32c
[644]33      zx_tmp_fi2d(1 : klon) = pctsrf(1 : klon, is_ter)* 100.
[766]34cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1,zx_tmp_fi2d,zx_tmp_2d)
35      CALL histwrite_phy(nid_mth,"pourc_"//clnsurf(is_ter),itau_w,
36     $                   zx_tmp_fi2d)
[524]37c
[644]38      zx_tmp_fi2d(1 : klon) = pctsrf(1 : klon, is_ter)
[766]39cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1,zx_tmp_fi2d,zx_tmp_2d)
40      CALL histwrite_phy(nid_mth,"fract_"//clnsurf(is_ter),itau_w,
41     $                   zx_tmp_fi2d)
[644]42c
[766]43cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, slp,zx_tmp_2d)
44      CALL histwrite_phy(nid_mth,"slp",itau_w,slp)
[524]45
[766]46cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zxtsol,zx_tmp_2d)
47      CALL histwrite_phy(nid_mth,"tsol",itau_w,zxtsol)
[524]48c
[766]49cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zt2m,zx_tmp_2d)
50      CALL histwrite_phy(nid_mth,"t2m",itau_w,zt2m)
[524]51c
52c ENSEMBLES BEG
[766]53cym      CALL gr_fi_ecrit(1,klon,iim,jjmp1,zt2m,zx_tmp_2d)
[879]54c     CALL histwrite_phy(nid_mth,"t2m_min",itau_w,zt2m)
[524]55c
[766]56cym      CALL gr_fi_ecrit(1,klon,iim,jjmp1,zt2m,zx_tmp_2d)
[879]57c     CALL histwrite_phy(nid_mth,"t2m_max",itau_w,zt2m)
[524]58c
59c     CALL gr_fi_ecrit(1,klon,iim,jjmp1,ftsoil(:,1,is_ter),zx_tmp_2d)
60c     CALL gr_fi_ecrit(1,klon,iim,jjmp1,ftsol(:,is_ter),zx_tmp_2d)
61c     CALL gr_fi_ecrit(1,klon,iim,jjmp1,ztsol,zx_tmp_2d)
[766]62c     CALL histwrite_phy(nid_mth,"tsoil",itau_w,zx_tmp_2d,
[524]63c    .               iim*jjmp1,ndex2d)
64c
65      DO i=1, klon
66       zx_tmp_fi2d(i)=SQRT(zu10m(i)*zu10m(i)+zv10m(i)*zv10m(i))
67      ENDDO
[766]68cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
69      CALL histwrite_phy(nid_mth,"wind10m",itau_w,zx_tmp_fi2d)
[524]70c
71      DO i = 1, klon
72         zx_tmp_fi2d(i) = pctsrf(i,is_sic)
73      ENDDO
[766]74cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
75      CALL histwrite_phy(nid_mth,"sicf",itau_w,zx_tmp_fi2d)
[524]76c
77c     CALL gr_fi_ecrit(klev,klon,iim,jjmp1, t_seri, zx_tmp_3d)
[766]78c     CALL histwrite_phy(nid_mth,"temp",itau_w,zx_tmp_3d,
[524]79c    .                                   iim*jjmp1*klev,ndex3d)
80c
81c ENSEMBLES END
82c
[766]83cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zq2m,zx_tmp_2d)
84      CALL histwrite_phy(nid_mth,"q2m",itau_w,zq2m)
[524]85c
[766]86cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zu10m,zx_tmp_2d)
87      CALL histwrite_phy(nid_mth,"u10m",itau_w,zu10m)
[524]88C
[766]89cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zv10m,zx_tmp_2d)
90      CALL histwrite_phy(nid_mth,"v10m",itau_w,zv10m)
[524]91C
92      DO i = 1, klon
93         zx_tmp_fi2d(i) = paprs(i,1)
94      ENDDO
[766]95cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
96      CALL histwrite_phy(nid_mth,"psol",itau_w,zx_tmp_fi2d)
[524]97c
[766]98cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zxqsurf,zx_tmp_2d)
99      CALL histwrite_phy(nid_mth,"qsurf",itau_w,zxqsurf)
[524]100c
101      if (.not. ok_veget) then
[766]102cym          CALL gr_fi_ecrit(1, klon,iim,jjmp1, qsol,zx_tmp_2d)
103          CALL histwrite_phy(nid_mth,"qsol",itau_w,qsol)
[524]104      endif
105c
106      DO i = 1, klon
107         zx_tmp_fi2d(i) = rain_fall(i) + snow_fall(i)
108      ENDDO
[766]109cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
110      CALL histwrite_phy(nid_mth,"precip",itau_w,zx_tmp_fi2d)
[524]111c
[766]112cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, nday_rain,zx_tmp_2d)
[879]113c     CALL histwrite_phy(nid_mth,"ndayrain",itau_w,nday_rain)
[524]114c
115      DO i = 1, klon
116         zx_tmp_fi2d(i) = rain_lsc(i) + snow_lsc(i)
117      ENDDO
[766]118cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
119      CALL histwrite_phy(nid_mth,"plul",itau_w,zx_tmp_fi2d)
[524]120c
121      DO i = 1, klon
122         zx_tmp_fi2d(i) = rain_con(i) + snow_con(i)
123      ENDDO
[766]124cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
125      CALL histwrite_phy(nid_mth,"pluc",itau_w,zx_tmp_fi2d)
[524]126c
[766]127cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, snow_fall,zx_tmp_2d)
128      CALL histwrite_phy(nid_mth,"snow",itau_w,snow_fall)
[524]129c
[644]130c     CALL gr_fi_ecrit(1, klon,iim,jjmp1, zsnow_mass,zx_tmp_2d)
131c     CALL histwrite(nid_mth,"snow_mass",itau_w,zx_tmp_2d,iim*jjmp1,
132c    .               ndex2d)
[524]133c
[766]134cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, evap,zx_tmp_2d)
135      CALL histwrite_phy(nid_mth,"evap",itau_w,evap)
[524]136c
[766]137cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, topsw,zx_tmp_2d)
138      CALL histwrite_phy(nid_mth,"tops",itau_w,topsw)
[524]139c
[766]140cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, topsw0,zx_tmp_2d)
141      CALL histwrite_phy(nid_mth,"tops0",itau_w,topsw0)
[524]142c
[766]143cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, toplw,zx_tmp_2d)
144      CALL histwrite_phy(nid_mth,"topl",itau_w,toplw)
[524]145c
[766]146cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, toplw0,zx_tmp_2d)
147      CALL histwrite_phy(nid_mth,"topl0",itau_w,toplw0)
[524]148c
149      zx_tmp_fi2d(1 : klon) = swup ( 1 : klon, klevp1 )
[766]150cym      CALL gr_fi_ecrit(1,klon,iim,jjmp1,zx_tmp_fi2d,zx_tmp_2d)
151      CALL histwrite_phy(nid_mth, "SWupTOA",itau_w,zx_tmp_fi2d)
[524]152c
[766]153c
[524]154      zx_tmp_fi2d(1 : klon) = swup0 ( 1 : klon, klevp1 )
[766]155cym      CALL gr_fi_ecrit(1,klon,iim,jjmp1,zx_tmp_fi2d,zx_tmp_2d)
156      CALL histwrite_phy(nid_mth, "SWupTOAclr",itau_w,zx_tmp_fi2d)
[524]157c
158      zx_tmp_fi2d(1 : klon) = swdn ( 1 : klon, klevp1 )
[766]159cym      CALL gr_fi_ecrit(1,klon,iim,jjmp1,zx_tmp_fi2d,zx_tmp_2d)
160      CALL histwrite_phy(nid_mth, "SWdnTOA",itau_w,zx_tmp_fi2d)
[524]161c
162      zx_tmp_fi2d(1 : klon) = swdn0 ( 1 : klon, klevp1 )
[766]163cym      CALL gr_fi_ecrit(1,klon,iim,jjmp1,zx_tmp_fi2d,zx_tmp_2d)
164      CALL histwrite_phy(nid_mth, "SWdnTOAclr",itau_w,zx_tmp_fi2d)
[524]165c
[766]166cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, SWup200,zx_tmp_2d)
167      CALL histwrite_phy(nid_mth,"SWup200",itau_w,SWup200)
[524]168c
[766]169cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, SWup200clr,zx_tmp_2d)
170      CALL histwrite_phy(nid_mth,"SWup200clr",itau_w,SWup200clr)
[524]171c
[766]172cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, SWdn200,zx_tmp_2d)
173      CALL histwrite_phy(nid_mth,"SWdn200",itau_w,SWdn200)
[524]174c
[766]175cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, SWdn200clr,zx_tmp_2d)
176      CALL histwrite_phy(nid_mth,"SWdn200clr",itau_w,SWdn200clr)
[524]177c
[766]178cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, LWup200,zx_tmp_2d)
179      CALL histwrite_phy(nid_mth,"LWup200",itau_w,LWup200)
[524]180c
[766]181cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, LWup200clr,zx_tmp_2d)
182      CALL histwrite_phy(nid_mth,"LWup200clr",itau_w,LWup200clr)
[524]183c
184      zx_tmp_fi2d(1:klon)=-1*LWdn200(1:klon)
[766]185cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
186      CALL histwrite_phy(nid_mth,"LWdn200",itau_w,zx_tmp_fi2d)
[524]187c
188      zx_tmp_fi2d(1:klon)=-1*LWdn200clr(1:klon)
[766]189cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
190      CALL histwrite_phy(nid_mth,"LWdn200clr",itau_w,zx_tmp_fi2d)
[524]191c
192c200 END
[766]193cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, solsw,zx_tmp_2d)
194      CALL histwrite_phy(nid_mth,"sols",itau_w,solsw)
[524]195c
[766]196cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, solsw0,zx_tmp_2d)
197      CALL histwrite_phy(nid_mth,"sols0",itau_w,solsw0)
[524]198c
[766]199cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, sollw,zx_tmp_2d)
200      CALL histwrite_phy(nid_mth,"soll",itau_w,sollw)
[524]201c
[766]202cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, radsol,zx_tmp_2d)
203      CALL histwrite_phy(nid_mth,"radsol",itau_w,radsol)
[684]204c
[766]205cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, sollw0,zx_tmp_2d)
206      CALL histwrite_phy(nid_mth,"soll0",itau_w,sollw0)
[524]207c
208c      zx_tmp_fi2d(1 : klon) = ZFSUP( 1 : klon, 1)
209      zx_tmp_fi2d(1 : klon) = swup ( 1 : klon, 1 )
[766]210cym      CALL gr_fi_ecrit(1,klon,iim,jjmp1,zx_tmp_fi2d,zx_tmp_2d)
211      CALL histwrite_phy(nid_mth, "SWupSFC",itau_w,zx_tmp_fi2d)
[524]212c
213c      zx_tmp_fi2d(1 : klon) = ZFSUP0( 1 : klon, 1)
214      zx_tmp_fi2d(1 : klon) = swup0 ( 1 : klon, 1 )
[766]215cym      CALL gr_fi_ecrit(1,klon,iim,jjmp1,zx_tmp_fi2d,zx_tmp_2d)
216      CALL histwrite_phy(nid_mth, "SWupSFCclr",itau_w,zx_tmp_fi2d)
[524]217c
218c      zx_tmp_fi2d(1 : klon) = ZFSDN( 1 : klon, 1)
219      zx_tmp_fi2d(1 : klon) = swdn ( 1 : klon, 1 )
[766]220cym      CALL gr_fi_ecrit(1,klon,iim,jjmp1,zx_tmp_fi2d,zx_tmp_2d)
221      CALL histwrite_phy(nid_mth, "SWdnSFC",itau_w,zx_tmp_fi2d)
[524]222c
223c      zx_tmp_fi2d(1 : klon) = ZFSDN0( 1 : klon, 1)
224      zx_tmp_fi2d(1 : klon) = swdn0 ( 1 : klon, 1 )
[766]225cym      CALL gr_fi_ecrit(1,klon,iim,jjmp1,zx_tmp_fi2d,zx_tmp_2d)
226      CALL histwrite_phy(nid_mth, "SWdnSFCclr",itau_w,zx_tmp_fi2d)
[524]227c
[644]228cIM 080904   zx_tmp_fi2d(1:klon)=sollw(1:klon)+sollwdown(1:klon)
229cIM 130904   zx_tmp_fi2d(1:klon)=sollw(1:klon)-sollwdown(1:klon)
230      zx_tmp_fi2d(1:klon)=sollwdown(1:klon)-sollw(1:klon)
[766]231cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d, zx_tmp_2d)
232      CALL histwrite_phy(nid_mth,"LWupSFC",itau_w,zx_tmp_fi2d)
[524]233c
[644]234      DO i=1, klon
235       sollwdownclr(i)=-1.*lwdn0(i,1)
236      ENDDO !i=1, klon
237
238cIM 080904   zx_tmp_fi2d(1:klon)=sollw0(1:klon)+sollwdownclr(1:klon)
239cIM 130904   zx_tmp_fi2d(1:klon)=sollw0(1:klon)-sollwdownclr(1:klon)
240      zx_tmp_fi2d(1:klon)=sollwdownclr(1:klon)-sollw0(1:klon)
[766]241cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d, zx_tmp_2d)
242      CALL histwrite_phy(nid_mth,"LWupSFCclr",itau_w,zx_tmp_fi2d)
[524]243c
[766]244cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, sollwdown,zx_tmp_2d)
245      CALL histwrite_phy(nid_mth,"LWdnSFC",itau_w,sollwdown)
[524]246c
[644]247c     DO i=1, klon
248cIM 080904     sollwdownclr(i)=lwdn0(i,1)
249c      sollwdownclr(i)=-1.*lwdn0(i,1)
250c     ENDDO !i=1, klon
[524]251c
[766]252cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, sollwdownclr,zx_tmp_2d)
253      CALL histwrite_phy(nid_mth,"LWdnSFCclr",itau_w,sollwdownclr)
[524]254c
[766]255cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, bils,zx_tmp_2d)
256      CALL histwrite_phy(nid_mth,"bils",itau_w,bils)
[524]257c
258      zx_tmp_fi2d(1:klon)=-1*sens(1:klon)
259c     CALL gr_fi_ecrit(1, klon,iim,jjmp1, sens,zx_tmp_2d)
[766]260cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
261      CALL histwrite_phy(nid_mth,"sens",itau_w,zx_tmp_fi2d)
[524]262c
[766]263cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, fder,zx_tmp_2d)
264      CALL histwrite_phy(nid_mth,"fder",itau_w,fder)
[524]265c
266c
267c      DO i = 1, klon
268c         zx_tmp_fi2d(i) = fluxu(i,1)
269c      ENDDO
270c      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
271c      CALL histwrite(nid_mth,"frtu",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
272c
273c      DO i = 1, klon
274c         zx_tmp_fi2d(i) = fluxv(i,1)
275c      ENDDO
276c      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
277c      CALL histwrite(nid_mth,"frtv",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
278c
279c
[766]280cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zxffonte,zx_tmp_2d)
281       CALL histwrite_phy(nid_mth,"ffonte",itau_w,zxffonte)
[524]282c
[766]283cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zxfqcalving,zx_tmp_2d)
284       CALL histwrite_phy(nid_mth,"fqcalving",itau_w,zxfqcalving)
285
286cym       CALL gr_fi_ecrit(1, klon,iim,jjmp1, zxfqfonte,zx_tmp_2d)
287       CALL histwrite_phy(nid_mth,"fqfonte",itau_w,zxfqfonte)
288
[524]289       DO nsrf = 1, nbsrf
290        zx_tmp_fi2d(1 : klon) = fluxu( 1 : klon, 1, nsrf)
[766]291cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
292        CALL histwrite_phy(nid_mth,"taux_"//clnsurf(nsrf),itau_w,
293     $      zx_tmp_fi2d) 
[524]294C     
295        zx_tmp_fi2d(1 : klon) = fluxv( 1 : klon, 1, nsrf)
[766]296cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
297        CALL histwrite_phy(nid_mth,"tauy_"//clnsurf(nsrf),itau_w,
298     $      zx_tmp_fi2d)
[524]299       ENDDO
300c
301      DO nsrf = 1, nbsrf
302CYYY
[890]303       IF(nsrf.GE.2) THEN
[644]304        zx_tmp_fi2d(1 : klon) = pctsrf( 1 : klon, nsrf)*100.
[766]305cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
306        CALL histwrite_phy(nid_mth,"pourc_"//clnsurf(nsrf),itau_w,
307     &                     zx_tmp_fi2d) 
[644]308c
309        zx_tmp_fi2d(1 : klon) = pctsrf( 1 : klon, nsrf)
[766]310cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
311        CALL histwrite_phy(nid_mth,"fract_"//clnsurf(nsrf),itau_w,
312     $      zx_tmp_fi2d) 
[644]313       ENDIF !nsrf.GT.2
[524]314C
315        zx_tmp_fi2d(1 : klon) = ftsol( 1 : klon, nsrf)
[766]316cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
317        CALL histwrite_phy(nid_mth,"tsol_"//clnsurf(nsrf),itau_w,
318     $      zx_tmp_fi2d)
[524]319C
320        zx_tmp_fi2d(1 : klon) = fluxt( 1 : klon, 1, nsrf)
[766]321cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
322        CALL histwrite_phy(nid_mth,"sens_"//clnsurf(nsrf),itau_w,
323     $      zx_tmp_fi2d)
[524]324C
325        zx_tmp_fi2d(1 : klon) = fluxlat( 1 : klon, nsrf)
[766]326cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
327        CALL histwrite_phy(nid_mth,"lat_"//clnsurf(nsrf),itau_w,
328     $      zx_tmp_fi2d) 
[524]329C
330        zx_tmp_fi2d(1 : klon) = fsollw( 1 : klon, nsrf)
[766]331cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
332        CALL histwrite_phy(nid_mth,"flw_"//clnsurf(nsrf),itau_w,
333     $      zx_tmp_fi2d)
[524]334c
335        zx_tmp_fi2d(1 : klon) = fsolsw( 1 : klon, nsrf)
[766]336cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
337        CALL histwrite_phy(nid_mth,"fsw_"//clnsurf(nsrf),itau_w,
338     $      zx_tmp_fi2d)
[524]339C
340        zx_tmp_fi2d(1 : klon) = wfbils( 1 : klon, nsrf)
[766]341cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
342        CALL histwrite_phy(nid_mth,"wbils_"//clnsurf(nsrf),itau_w,
343     $      zx_tmp_fi2d)
[524]344C
[684]345        zx_tmp_fi2d(1 : klon) = wfbilo( 1 : klon, nsrf)
[766]346cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
347        CALL histwrite_phy(nid_mth,"wbilo_"//clnsurf(nsrf),itau_w,
348     $      zx_tmp_fi2d)
[684]349C
[644]350       IF(1.EQ.0) THEN
351C
352        zx_tmp_fi2d(1:klon) = fevap(1:klon,nsrf)*pctsrf(1:klon,nsrf)
[766]353cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
354        CALL histwrite_phy(nid_mth,"evapour_"//clnsurf(nsrf),itau_w,
355     $      zx_tmp_fi2d)
[644]356C
357        zx_tmp_fi2d(1:klon) = (rain_fall(1:klon) + snow_fall(1:klon))
358     $                        *pctsrf(1:klon,nsrf)
[766]359cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
360        CALL histwrite_phy(nid_mth,"prepour_"//clnsurf(nsrf),itau_w,
361     $      zx_tmp_fi2d)
[644]362C
363       ENDIF !(1.EQ.0) THEN
364C
[524]365      END DO 
366c
[766]367cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, cdragm,zx_tmp_2d)
368      CALL histwrite_phy(nid_mth,"cdrm",itau_w,cdragm)
[524]369c
[766]370cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, cdragh,zx_tmp_2d)
371      CALL histwrite_phy(nid_mth,"cdrh",itau_w,cdragh)
[524]372c
[766]373cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, cldl,zx_tmp_2d)
374      CALL histwrite_phy(nid_mth,"cldl",itau_w,cldl)
[524]375c
[766]376cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, cldm,zx_tmp_2d)
377      CALL histwrite_phy(nid_mth,"cldm",itau_w,cldm)
[524]378c
[766]379cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, cldh,zx_tmp_2d)
380      CALL histwrite_phy(nid_mth,"cldh",itau_w,cldh)
[524]381c
[766]382cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, cldt,zx_tmp_2d)
383      CALL histwrite_phy(nid_mth,"cldt",itau_w,cldt)
[524]384c
[766]385cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, cldq,zx_tmp_2d)
386      CALL histwrite_phy(nid_mth,"cldq",itau_w,cldq)
[524]387c
388      zx_tmp_fi2d(1:klon) = flwp(1:klon)
[766]389cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
390      CALL histwrite_phy(nid_mth,"lwp",itau_w,zx_tmp_fi2d)
[524]391c
392      zx_tmp_fi2d(1:klon) = fiwp(1:klon)
[766]393cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
394      CALL histwrite_phy(nid_mth,"iwp",itau_w,zx_tmp_fi2d)
[524]395c
[766]396cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, ue,zx_tmp_2d)
397      CALL histwrite_phy(nid_mth,"ue",itau_w,ue)
[524]398c
[766]399cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, ve,zx_tmp_2d)
400      CALL histwrite_phy(nid_mth,"ve",itau_w,ve)
[524]401c
[766]402cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, uq,zx_tmp_2d)
403      CALL histwrite_phy(nid_mth,"uq",itau_w,uq)
[524]404c
[766]405cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, vq,zx_tmp_2d)
406      CALL histwrite_phy(nid_mth,"vq",itau_w,vq)
[524]407cKE43
408      IF (iflag_con.GE.3) THEN ! sb
409c
[766]410cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, cape,zx_tmp_2d)
411      CALL histwrite_phy(nid_mth,"cape",itau_w,cape)
[524]412c
[766]413cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1,pbase,zx_tmp_2d)
414      CALL histwrite_phy(nid_mth,"pbase",itau_w,pbase)
[524]415c
[766]416cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1,ema_pct,zx_tmp_2d)
417      CALL histwrite_phy(nid_mth,"ptop",itau_w,ema_pct)
[524]418c
[766]419cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1,ema_cbmf,zx_tmp_2d)
420      CALL histwrite_phy(nid_mth,"fbase",itau_w,ema_cbmf)
[524]421c
422c34EK
423c
[766]424cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, prw,zx_tmp_2d)
425      CALL histwrite_phy(nid_mth,"prw",itau_w,prw)
[524]426c
[644]427      ENDIF !iflag_con.GE.3
[524]428c
429c
[644]430cIM cf. AM 081204 BEG
431cHBTM2
[524]432c
[644]433c
[766]434cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, s_pblh,zx_tmp_2d)
435      CALL histwrite_phy(nid_mth,"s_pblh",itau_w,s_pblh)
[644]436c
[766]437cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, s_pblt,zx_tmp_2d)
438      CALL histwrite_phy(nid_mth,"s_pblt",itau_w,s_pblt)
[644]439c
[766]440cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, s_lcl,zx_tmp_2d)
441      CALL histwrite_phy(nid_mth,"s_lcl",itau_w,s_lcl)
[644]442c
[766]443cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, s_capCL,zx_tmp_2d)
444      CALL histwrite_phy(nid_mth,"s_capCL",itau_w,s_capCL)
[644]445c
[766]446cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, s_oliqCL,zx_tmp_2d)
447      CALL histwrite_phy(nid_mth,"s_oliqCL",itau_w,s_oliqCL)
[644]448c
[766]449cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, s_cteiCL,zx_tmp_2d)
450      CALL histwrite_phy(nid_mth,"s_cteiCL",itau_w,s_cteiCL)
[644]451c
[766]452cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, s_therm,zx_tmp_2d)
453      CALL histwrite_phy(nid_mth,"s_therm",itau_w,s_therm)
[644]454c
[766]455cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, s_trmb1,zx_tmp_2d)
456      CALL histwrite_phy(nid_mth,"s_trmb1",itau_w,s_trmb1)
[644]457c
[766]458cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, s_trmb2,zx_tmp_2d)
459      CALL histwrite_phy(nid_mth,"s_trmb2",itau_w,s_trmb2)
[644]460c
[766]461cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, s_trmb3,zx_tmp_2d)
462      CALL histwrite_phy(nid_mth,"s_trmb3",itau_w,s_trmb3)
[644]463c
464cIM cf. AM 081204 END
465c
[524]466c  Champs interpolles sur des niveaux de pression
[644]467      DO k=1, nlevSTD
[524]468c
[644]469c        bb=clevSTD(k)
470c
471c        IF(k.GE.2) THEN
472         IF(k.GE.2.AND.k.LE.12) bb2=clevSTD(k)
473         IF(k.GE.13.AND.k.LE.17) bb3=clevSTD(k)
474c         aa=clevSTD(k)
475c         bb=aa(1:lnblnk1(aa))
476c        ENDIF
477c
478      IF(bb2.EQ."850".OR.bb2.EQ."700".OR.
479     $   bb2.EQ."500".OR.bb2.EQ."200") THEN
480c
[766]481cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1,usumSTD(:,k,2),zx_tmp_2d)
482        CALL histwrite_phy(nid_mth,"u"//bb2,itau_w,usumSTD(:,k,2))
[524]483c
[766]484cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1,vsumSTD(:,k,2),zx_tmp_2d)
485        CALL histwrite_phy(nid_mth,"v"//bb2,itau_w,vsumSTD(:,k,2))
[524]486c
[766]487cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1,wsumSTD(:,k,2),zx_tmp_2d)
488      CALL histwrite_phy(nid_mth,"w"//bb2,itau_w,wsumSTD(:,k,2))
[524]489c
[766]490cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1,phisumSTD(:,k,2),zx_tmp_2d)
491      CALL histwrite_phy(nid_mth,"phi"//bb2,itau_w,phisumSTD(:,k,2))
[524]492c
[644]493      ENDIF !(bb2.EQ."850".OR.bb2.EQ."700".OR.
494      ENDDO !nlevSTD
495c
496      DO i=1, klon
497       IF (pctsrf(i,is_oce).GT.epsfra) THEN
498        zx_tmp_fi2d(i) = fluxo(i)
499       ELSE
[684]500        zx_tmp_fi2d(i) = 0.
[644]501       ENDIF
502      ENDDO
503c
[766]504cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
505      CALL histwrite_phy(nid_mth,"fluxo",itau_w,zx_tmp_fi2d)
[644]506c
507      DO i=1, klon
508       IF (pctsrf(i,is_sic).GT.epsfra) THEN
509        zx_tmp_fi2d(i) = fluxg(i)
510       ELSE
[684]511        zx_tmp_fi2d(i) = 0.
[644]512       ENDIF
513      ENDDO
514c
[766]515cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
516      CALL histwrite_phy(nid_mth,"fluxg",itau_w,zx_tmp_fi2d)
[644]517c
[684]518      DO i=1, klon
519       IF (pctsrf(i,is_oce).GT.epsfra.OR.
520     .     pctsrf(i,is_sic).GT.epsfra) THEN
521        zx_tmp_fi2d(i) = (ftsol(i, is_oce) * pctsrf(i,is_oce)+ 
522     .                   ftsol(i, is_sic) * pctsrf(i,is_sic))/
523     .                   (pctsrf(i,is_oce)+pctsrf(i,is_sic))
524       ELSE
525        zx_tmp_fi2d(i) = 273.15
526       ENDIF
527      ENDDO
528c
[766]529cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
530      CALL histwrite_phy(nid_mth,"t_oce_sic",itau_w,zx_tmp_fi2d)
[684]531c
[644]532      IF (OCEAN.EQ.'force ') THEN
533c
534      DO i=1, klon
535      IF((pctsrf(i,is_oce).GT.epsfra).OR.
536     .   (pctsrf(i,is_sic).GT.epsfra)) THEN
537       zx_tmp_fi2d(i) = (radsol(i) + fluxo(i))*pctsrf(i,is_oce)+
538     .                  fluxg(i)*pctsrf(i,is_sic)
539      ELSE
540       zx_tmp_fi2d(i) = 1.E+20
541      ENDIF
542      ENDDO
[766]543cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
544      CALL histwrite_phy(nid_mth,"lmt_bils",itau_w,zx_tmp_fi2d)
[644]545c
546      ELSE IF (OCEAN.EQ.'slab  ') THEN
547c
548      DO i=1, klon
549      IF((pctsrf(i,is_oce).GT.epsfra).OR.
550     .   (pctsrf(i,is_sic).GT.epsfra)) THEN
551       zx_tmp_fi2d(i) = (radsol(i) + fluxo(i))*pctsrf(i,is_oce)+
552     .                  fluxg(i)*pctsrf(i,is_sic)
553      ELSE
554       zx_tmp_fi2d(i) = 1.E+20
555      ENDIF
556      ENDDO
[766]557cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
558      CALL histwrite_phy(nid_mth,"slab_bils",itau_w,zx_tmp_fi2d)
[644]559c
560      DO i=1, klon
561       IF(pctsrf(i,is_oce).GT.epsfra.OR.
562     $    pctsrf(i,is_sic).GT.epsfra) THEN
563        zx_tmp_fi2d(i)=tslab(i)
564       ELSE
565        zx_tmp_fi2d(i) = 1.E+20
566       ENDIF
567      ENDDO !i=1, klon
[766]568cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
569      CALL histwrite_phy(nid_mth,"tslab",itau_w,zx_tmp_fi2d)
[644]570c
[766]571cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, seaice,zx_tmp_2d)
572      CALL histwrite_phy(nid_mth,"seaice",itau_w,seaice)
[644]573c
[766]574cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, seaice/1000.,zx_tmp_2d)
575      CALL histwrite_phy(nid_mth,"siceh",itau_w, seaice/1000.)
[644]576c
577      ENDIF !OCEAN.EQ.force/slab
578c
[524]579      ENDIF !lev_histmth.GE.1
580c
581      IF(lev_histmth.GE.2) THEN
582c
583c Champs 3D:
584C
585c
[766]586cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, flwc,zx_tmp_3d)
587      CALL histwrite_phy(nid_mth,"lwcon",itau_w,flwc)
[524]588c
[766]589cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, fiwc,zx_tmp_3d)
590      CALL histwrite_phy(nid_mth,"iwcon",itau_w,fiwc)
[524]591c
[766]592cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, t_seri, zx_tmp_3d)
593      CALL histwrite_phy(nid_mth,"temp",itau_w,t_seri)
[524]594c
595c#ifdef histmthNMC
596c#include "write_histmthNMC.h"
597c#endif
598c
[766]599cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, qx(1,1,ivap), zx_tmp_3d)
600      CALL histwrite_phy(nid_mth,"ovap",itau_w,qx(:,:,ivap))
[524]601c
602c     zx_tmp_fi3d(1:klon,1:klev)=qx(1:klon,1:klev,ivap)/
603c    .                         (1-qx(1:klon,1:klev,ivap))
604c     CALL gr_fi_ecrit(klev,klon,iim,jjmp1, zx_tmp_fi3d, zx_tmp_3d)
605c     CALL histwrite(nid_mth,"wvap",itau_w,zx_tmp_3d,
606c    .                                   iim*jjmp1*klev,ndex3d)
607c
[766]608cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, zphi, zx_tmp_3d)
609      CALL histwrite_phy(nid_mth,"geop",itau_w,zphi)
[524]610c
[766]611cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, u_seri, zx_tmp_3d)
612      CALL histwrite_phy(nid_mth,"vitu",itau_w,u_seri)
[524]613c
[766]614cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, v_seri, zx_tmp_3d)
615      CALL histwrite_phy(nid_mth,"vitv",itau_w,v_seri)
[524]616c
[766]617cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, omega, zx_tmp_3d)
618      CALL histwrite_phy(nid_mth,"vitw",itau_w,omega)
[524]619c
[766]620cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, pplay, zx_tmp_3d)
621      CALL histwrite_phy(nid_mth,"pres",itau_w,pplay)
[524]622c
[766]623cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, cldfra, zx_tmp_3d)
624      CALL histwrite_phy(nid_mth,"rneb",itau_w,cldfra)
[524]625c
[766]626cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, rnebcon, zx_tmp_3d)
627      CALL histwrite_phy(nid_mth,"rnebcon",itau_w,rnebcon)
[524]628c
[766]629cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, zx_rh, zx_tmp_3d)
630      CALL histwrite_phy(nid_mth,"rhum",itau_w,zx_rh)
631
[644]632      DO k=1, klev
633       DO i=1, klon
634cIM 151004      zx_tmp_fi3d(i,k)=MAX(wo(i,k),1.0e-12)*RG/46.6968
635c    $                    /(paprs(i,k)-paprs(i,k+1))
636c    $                    *(paprs(i,1)/101325.0)
637c        zx_tmp2_fi3d(i,k)=MAX(wo(i,k)*1.0e+6,1.0e-6)*RG/46.6968
638         zx_tmp_fi3d(i,k)=wo(i,k)*RG/46.6968
639     $                    /(paprs(i,k)-paprs(i,k+1))
640     $                    *(paprs(i,1)/101325.0)
641       ENDDO !i
642      ENDDO !k
643c
644c     CALL gr_fi_ecrit(klev,klon,iim,jjmp1, wo, zx_tmp_3d)
645c     CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp2_fi3d,zx_tmp_3d)
[766]646cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
647      CALL histwrite_phy(nid_mth,"ozone",itau_w,zx_tmp_fi3d)
[524]648c
[766]649cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_t, zx_tmp_3d)
650      CALL histwrite_phy(nid_mth,"dtphy",itau_w,d_t)
[524]651c
[766]652cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_qx(:,:,ivap), 
653cym     .                 zx_tmp_3d)
654      CALL histwrite_phy(nid_mth,"dqphy",itau_w, d_qx(:,:,ivap))
655cIM 22.03.04 END
[524]656c
657      ENDIF !lev_histmth.GE.2
658c
659      IF(lev_histmth.GE.3) THEN
660c
661       DO nsrf=1, nbsrf
662c
[888]663        zx_tmp_fi2d(1 : klon) = falb1( 1 : klon, nsrf)
[766]664cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
665        CALL histwrite_phy(nid_mth,"albe_"//clnsurf(nsrf),itau_w,
666     $      zx_tmp_fi2d)
[524]667C
668        zx_tmp_fi2d(1 : klon) = frugs( 1 : klon, nsrf)
[766]669cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
670        CALL histwrite_phy(nid_mth,"rugs_"//clnsurf(nsrf),itau_w,
671     $      zx_tmp_fi2d)
[524]672c
673      zx_tmp_fi2d(1 : klon) = agesno( 1 : klon, nsrf)
[766]674cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, agesno,zx_tmp_2d)
675      CALL histwrite_phy(nid_mth,"ages_"//clnsurf(nsrf),itau_w
676     $    ,zx_tmp_fi2d)
[524]677c
678      ENDDO !nsrf=1, nbsrf
679c
[888]680cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, albsol1,zx_tmp_2d)
681      CALL histwrite_phy(nid_mth,"albs",itau_w,albsol1)
[524]682c
[888]683cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, albsol2,zx_tmp_2d)
684      CALL histwrite_phy(nid_mth,"albslw",itau_w,albsol2)
[524]685c
686      ENDIF !lev_histmth.GE.3
687c
688c
689      IF(lev_histmth.GE.4) THEN
690c
[878]691c  FH Sorties pour la couche limite
692      CALL histwrite_phy(nid_mth,"kz",itau_w,ycoefh)
693      CALL histwrite_phy(nid_mth,"kz_max",itau_w,ycoefh)
694
695      if(iflag_pbl>1) then
696      zx_tmp_fi3d=0.
697      do nsrf=1,nbsrf
698         do k=1,klev
699          zx_tmp_fi3d(:,k)=zx_tmp_fi3d(:,k)
700     ,    +pctsrf(:,nsrf)*pbl_tke(:,k,nsrf)
701         enddo
702      enddo
703      CALL histwrite_phy(nid_mth,"tke",itau_w,zx_tmp_fi3d)
704      CALL histwrite_phy(nid_mth,"tke_max",itau_w,zx_tmp_fi3d)
705      endif
706
707
708
[766]709cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, clwcon0, zx_tmp_3d)
710      CALL histwrite_phy(nid_mth,"clwcon",itau_w,clwcon0)
711
[653]712      IF (iflag_con.GE.3) THEN
713c
[766]714cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, Ma, zx_tmp_3d)
715      CALL histwrite_phy(nid_mth,"Ma",itau_w,Ma)
[524]716c
[766]717cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, upwd, zx_tmp_3d)
718      CALL histwrite_phy(nid_mth,"upwd",itau_w,upwd)
[684]719c
[766]720cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, dnwd, zx_tmp_3d)
721      CALL histwrite_phy(nid_mth,"dnwd",itau_w,dnwd)
[524]722c
[766]723cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, dnwd0, zx_tmp_3d)
724      CALL histwrite_phy(nid_mth,"dnwd0",itau_w,dnwd0)
[524]725c
[653]726      ENDIF !iflag_con.GE.3
[524]727c
[766]728cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_t_dyn, zx_tmp_3d)
729      CALL histwrite_phy(nid_mth,"dtdyn",itau_w,d_t_dyn)
[524]730c
[766]731cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_q_dyn, zx_tmp_3d)
732      CALL histwrite_phy(nid_mth,"dqdyn",itau_w,d_q_dyn)
[524]733c
734cIM: 101003 : K/30min ==> K/s
735      zx_tmp_fi3d(1:klon,1:klev)=d_t_con(1:klon,1:klev)/pdtphys
[766]736cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
737      CALL histwrite_phy(nid_mth,"dtcon",itau_w,zx_tmp_fi3d)
[524]738c
[644]739      zx_tmp_fi3d(1:klon,1:klev)=d_q_con(1:klon,1:klev)/pdtphys
[766]740cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
741      CALL histwrite_phy(nid_mth,"dqcon",itau_w,zx_tmp_fi3d)
[524]742c
743cIM: 101003 : K/30min ==> K/s
744      zx_tmp_fi3d(1:klon,1:klev)=d_t_lsc(1:klon,1:klev)/pdtphys
[766]745cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
746      CALL histwrite_phy(nid_mth,"dtlsc",itau_w,zx_tmp_fi3d)
747cIM: 071003
[524]748cIM: 101003 : K/30min ==> K/s
749      zx_tmp_fi3d(1:klon, 1:klev)=(d_t_lsc(1:klon,1:klev)+
750     .                             d_t_eva(1:klon,1:klev))/pdtphys
[766]751cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, zx_tmp_fi3d, zx_tmp_3d)
752      CALL histwrite_phy(nid_mth,"dtlschr",itau_w,zx_tmp_fi3d)
[524]753c
[644]754      zx_tmp_fi3d(1:klon,1:klev)=d_q_lsc(1:klon,1:klev)/pdtphys
[766]755cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
756      CALL histwrite_phy(nid_mth,"dqlsc",itau_w,zx_tmp_fi3d)
[524]757c
758cIM: 101003 : K/30min ==> K/s
759      zx_tmp_fi3d(1:klon,1:klev)=d_t_vdf(1:klon,1:klev)/pdtphys
[766]760cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
761      CALL histwrite_phy(nid_mth,"dtvdf",itau_w,zx_tmp_fi3d)
[524]762c
[644]763      zx_tmp_fi3d(1:klon,1:klev)=d_q_vdf(1:klon,1:klev)/pdtphys
[766]764cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
765      CALL histwrite_phy(nid_mth,"dqvdf",itau_w,zx_tmp_fi3d)
[524]766c
767cIM: 101003 : K/30min ==> K/s
768      zx_tmp_fi3d(1:klon,1:klev)=d_t_eva(1:klon,1:klev)/pdtphys
[766]769cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
770      CALL histwrite_phy(nid_mth,"dteva",itau_w,zx_tmp_fi3d)
[524]771c
[644]772      zx_tmp_fi3d(1:klon,1:klev)=d_q_eva(1:klon,1:klev)/pdtphys
[766]773cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
774      CALL histwrite_phy(nid_mth,"dqeva",itau_w,zx_tmp_fi3d)
[524]775c
776      zpt_conv = 0.
777      where (ptconv) zpt_conv = 1.
[766]778cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, zpt_conv, zx_tmp_3d)
779      CALL histwrite_phy(nid_mth,"ptconv",itau_w,zpt_conv)
[524]780c
[766]781cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, ratqs, zx_tmp_3d)
782      CALL histwrite_phy(nid_mth,"ratqs",itau_w,ratqs)
[524]783c
784cIM: 101003 : K/30min ==> K/s
[878]785      zx_tmp_fi3d(1:klon,1:klev)=d_t_ajsb(1:klon,1:klev)/pdtphys
[766]786cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
787      CALL histwrite_phy(nid_mth,"dtajs",itau_w,zx_tmp_fi3d)
[524]788c
[878]789      zx_tmp_fi3d(1:klon,1:klev)=d_q_ajsb(1:klon,1:klev)/pdtphys
[766]790cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
791      CALL histwrite_phy(nid_mth,"dqajs",itau_w,zx_tmp_fi3d)
[524]792c
[878]793cIM: 101003 : K/30min ==> K/s
794      zx_tmp_fi3d(1:klon,1:klev)=d_t_ajs(1:klon,1:klev)/pdtphys
795cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
796      CALL histwrite_phy(nid_mth,"dtthe",itau_w,zx_tmp_fi3d)
797c
798      zx_tmp_fi3d(1:klon,1:klev)=d_q_ajs(1:klon,1:klev)/pdtphys
799cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
800      CALL histwrite_phy(nid_mth,"dqthe",itau_w,zx_tmp_fi3d)
801c
[524]802cIM: 101003 : K/day ==> K/s
803      zx_tmp_fi3d(1:klon,1:klev)=heat(1:klon,1:klev)/RDAY
[766]804cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
805      CALL histwrite_phy(nid_mth,"dtswr",itau_w,zx_tmp_fi3d)
[524]806c
807cIM: 101003 : K/day ==> K/s     
808      zx_tmp_fi3d(1:klon,1:klev)=heat0(1:klon,1:klev)/RDAY
[766]809cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
810      CALL histwrite_phy(nid_mth,"dtsw0",itau_w,zx_tmp_fi3d)
[524]811c
812cIM: 101003 : K/day ==> K/s     
813      zx_tmp_fi3d(1:klon,1:klev)=-1.*cool(1:klon,1:klev)/RDAY
[766]814cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
815      CALL histwrite_phy(nid_mth,"dtlwr",itau_w,zx_tmp_fi3d)
[524]816c
817cIM: 101003 : K/day ==> K/s     
818      zx_tmp_fi3d(1:klon,1:klev)=-1.*cool0(1:klon,1:klev)/RDAY
[766]819cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
820      CALL histwrite_phy(nid_mth,"dtlw0",itau_w,zx_tmp_fi3d)
[524]821c
822cIM: 101003 : deja en K/s     
823      zx_tmp_fi3d(1:klon,1:klev)=d_t_ec(1:klon,1:klev)
[766]824cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
825      CALL histwrite_phy(nid_mth,"dtec",itau_w,zx_tmp_fi3d)
[524]826c
[644]827      zx_tmp_fi3d(1:klon,1:klev)=d_u_vdf(1:klon,1:klev)/pdtphys
[766]828cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
829      CALL histwrite_phy(nid_mth,"duvdf",itau_w,zx_tmp_fi3d)
[524]830c
[644]831      zx_tmp_fi3d(1:klon,1:klev)=d_v_vdf(1:klon,1:klev)/pdtphys
[766]832cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
833      CALL histwrite_phy(nid_mth,"dvvdf",itau_w,zx_tmp_fi3d)
[524]834c
835      IF (ok_orodr) THEN
[644]836      zx_tmp_fi3d(1:klon,1:klev)=d_u_oro(1:klon,1:klev)/pdtphys
[766]837cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
838      CALL histwrite_phy(nid_mth,"duoro",itau_w,zx_tmp_fi3d)
[524]839c
[644]840      zx_tmp_fi3d(1:klon,1:klev)=d_v_oro(1:klon,1:klev)/pdtphys
[766]841cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
842      CALL histwrite_phy(nid_mth,"dvoro",itau_w,zx_tmp_fi3d)
[524]843c
844      ENDIF
845C
846      IF (ok_orolf) THEN
[644]847      zx_tmp_fi3d(1:klon,1:klev)=d_u_lif(1:klon,1:klev)/pdtphys
[766]848cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
849      CALL histwrite_phy(nid_mth,"dulif",itau_w,zx_tmp_fi3d)
[524]850c
[644]851      zx_tmp_fi3d(1:klon,1:klev)=d_v_lif(1:klon,1:klev)/pdtphys
[766]852cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
853      CALL histwrite_phy(nid_mth,"dvlif",itau_w,zx_tmp_fi3d)
[524]854      ENDIF
855C
[864]856#if defined(INCA_AER) && defined(CPP_COUPLE)
857      CALL histwrite_phy(nid_mth,"tau",itau_w,cldtau)
858      CALL histwrite_phy(nid_mth,"CCM1",itau_w,ccm(:,:,1))
859      CALL histwrite_phy(nid_mth,"CCM2",itau_w,ccm(:,:,2))
860      CALL histwrite_phy(nid_mth,"taupi",itau_w,cldtaupi)
861      CALL histwrite_phy(nid_mth,"cldemi",itau_w,cldemi)
862      CALL histwrite_phy(nid_mth,"SWTOAAS_ZERO",itau_w,topsw_inca(:,1))
863      CALL histwrite_phy(nid_mth,"SWTOAAS_AER",itau_w,topsw_inca(:,2))
864      CALL histwrite_phy(nid_mth,"SWTOAAS_NAT",itau_w,topsw_inca(:,3))
865      CALL histwrite_phy(nid_mth,"SWTOAAS_AD",itau_w,topswad_inca(:))
866      CALL histwrite_phy(nid_mth,"SWTOAAS_AI",itau_w,topswai_inca(:))
867      CALL histwrite_phy(nid_mth,"SWTOACS_ZERO",itau_w,topsw0_inca(:,1))
868      CALL histwrite_phy(nid_mth,"SWTOACS_AER",itau_w,topsw0_inca(:,2))
869      CALL histwrite_phy(nid_mth,"SWTOACS_AD",itau_w,topswad0_inca(:))
870      CALL histwrite_phy(nid_mth,"SWTOACS_NAT",itau_w,topsw0_inca(:,3))
871#endif
872#ifndef INCA
[644]873      IF (nqmax.GE.3) THEN
[653]874      DO iq=3,nqmax
[766]875cym         CALL gr_fi_ecrit(klev,klon,iim,jjmp1, qx(1,1,iq), zx_tmp_3d)
876         CALL histwrite_phy(nid_mth,tnom(iq),itau_w,qx(:,:,iq))
[644]877      ENDDO
878      ENDIF
[864]879#endif
[524]880c
[644]881      ENDIF !lev_histmth.GE.4
[524]882c
[644]883      ELSE IF(type_run.EQ."AMIP".OR.type_run.EQ."CFMI") THEN
884c
885      IF(lev_histmth.GE.1) THEN
886c
887c Champs 2D:
888c
[766]889cym      CALL gr_fi_ecrit(1,klon,iim,jjmp1,pphis/RG,zx_tmp_2d)
890      CALL histwrite_phy(nid_mth,"phis",itau_w,pphis/RG)
[644]891C
892cIM 310804   CALL gr_fi_ecrit(1,klon,iim,jjmp1,paire,zx_tmp_2d)
[766]893cym      CALL gr_fi_ecrit(1,klon,iim,jjmp1,airephy,zx_tmp_2d)
894      CALL histwrite_phy(nid_mth,"aire",itau_w,airephy)
[644]895c
896      zx_tmp_fi2d(1 : klon) = pctsrf(1 : klon, is_ter)* 100.
[766]897cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1,zx_tmp_fi2d, zx_tmp_2d)
898      CALL histwrite_phy(nid_mth,"pourc_"//clnsurf(is_ter),itau_w,
899     $      zx_tmp_fi2d)
[644]900c
901      zx_tmp_fi2d(1 : klon) = pctsrf(1 : klon, is_ter)
[766]902cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1,zx_tmp_fi2d, zx_tmp_2d)
903      CALL histwrite_phy(nid_mth,"fract_"//clnsurf(is_ter),itau_w,
904     $      zx_tmp_fi2d)
[644]905c
906      zx_tmp_fi2d(1 : klon) = pctsrf(1 : klon, is_lic)* 100.
[766]907cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1,zx_tmp_fi2d, zx_tmp_2d)
908      CALL histwrite_phy(nid_mth,"pourc_"//clnsurf(is_lic),itau_w,
909     $      zx_tmp_fi2d)
[644]910c
911      zx_tmp_fi2d(1 : klon) = pctsrf(1 : klon, is_lic)
[766]912cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1,zx_tmp_fi2d, zx_tmp_2d)
913      CALL histwrite_phy(nid_mth,"fract_"//clnsurf(is_lic),itau_w,
914     $      zx_tmp_fi2d)
[644]915c
916      zx_tmp_fi2d(1 : klon) = pctsrf(1 : klon, is_sic)* 100.
[766]917cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1,zx_tmp_fi2d,zx_tmp_2d)
918      CALL histwrite_phy(nid_mth,"pourc_"//clnsurf(is_sic),itau_w,
919     $      zx_tmp_fi2d)
[644]920c
921      zx_tmp_fi2d(1 : klon) = pctsrf(1 : klon, is_sic)
[766]922cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1,zx_tmp_fi2d,zx_tmp_2d)
923      CALL histwrite_phy(nid_mth,"fract_"//clnsurf(is_sic),itau_w,
924     $      zx_tmp_fi2d)
[644]925c
[766]926cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zxfluxlat,zx_tmp_2d)
927      CALL histwrite_phy(nid_mth,"flat",itau_w,zxfluxlat)
[644]928c
929      zx_tmp_fi2d(1 : klon) = topsw(1:klon)-toplw(1:klon)
[766]930cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
931      CALL histwrite_phy(nid_mth,"bilTOA",itau_w,zx_tmp_fi2d)
[644]932c
933c     IF(itap.EQ.ecrit_mth) THEN
934c       DO i=1, klon
935c         IF(nday_clr(i).GT.0.) THEN
936c          tops01(i)=tops01(i)/nday_clr(i)
937c         ELSE
938c          tops01(i)=1.e+20
939c         ENDIF
940c       ENDDO
941c       CALL gr_fi_ecrit(1, klon,iim,jjmp1, tops01,zx_tmp_2d)
[766]942c       CALL histwrite_phy(nid_mth,"tops01",itau_w,zx_tmp_2d,
[644]943c    .       iim*jjmp1,ndex2d)
944c     ENDIF !itap.EQ.ecrit_mth
945c
946c220404 BEG
947c
948c temperature tendency due to total diabatic heating
949       DO l=1, klev
950       DO i=1, klon
951       d_t(i,l) = (t_seri(i,l)-t(i,l))/dtime
952       ENDDO !i
953       ENDDO !l
954c
[766]955cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_t,zx_tmp_3d)
956      CALL histwrite_phy(nid_mth,"dtdia",itau_w,d_t)
[644]957c
958c temperature tendency due to SW radiation
959       DO l=1, klev
960       DO i=1, klon
961       zx_tmp_fi3d(i,l)=heat(i,l)/RDAY
962       ENDDO !i
963       ENDDO !l
964c
[766]965cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, zx_tmp_fi3d,zx_tmp_3d)
966      CALL histwrite_phy(nid_mth,"dtsw",itau_w,zx_tmp_fi3d)
[644]967c
968c temperature tendency due to LW radiation
969       DO l=1, klev
970       DO i=1, klon
971        zx_tmp_fi3d(i,l)=-1*cool(i,l)/RDAY
972       ENDDO !i
973       ENDDO !l
974c
[766]975cym      CALL gr_fi_ecrit(klev, klon,iim,jjmp1, zx_tmp_fi3d,zx_tmp_3d)
976      CALL histwrite_phy(nid_mth,"dtlw",itau_w,zx_tmp_fi3d)
[644]977c
[879]978
[644]979c
980c  temperature tendency due to large scale precipitation
981       DO l=1, klev
982       DO i=1, klon
983       zx_tmp_fi3d(i,l)=d_t_lsc(i,l)/pdtphys
984       ENDDO !i
985       ENDDO !l
986c
[766]987cym      CALL gr_fi_ecrit(klev, klon,iim,jjmp1, zx_tmp_fi3d,zx_tmp_3d)
988      CALL histwrite_phy(nid_mth,"dtlsc",itau_w,zx_tmp_fi3d)
[644]989c
990c  total moisture tendency due to diabatic processes
991       DO l=1, klev
992       DO i=1, klon
993        d_qx(i,l,ivap) = ( q_seri(i,l) - qx(i,l,ivap) ) / dtime
994        zx_tmp_fi3d(i,l)=d_qx(i,l,ivap)
995       ENDDO !i
996       ENDDO !l
997c
[766]998cym      CALL gr_fi_ecrit(klev, klon,iim,jjmp1, zx_tmp_fi3d,zx_tmp_3d)
999      CALL histwrite_phy(nid_mth,"dqdia",itau_w,zx_tmp_fi3d)
[644]1000c
1001cBEG 210404 BEG
1002c
1003      IF(ok_orodr.AND.ok_orolf) THEN
1004      DO k = 1, klev
1005      DO i = 1, klon
1006        d_u_oli(i,k) = (d_u_oro(i,k) + d_u_lif(i,k))/pdtphys
1007        d_v_oli(i,k) = (d_v_oro(i,k) + d_v_lif(i,k))/pdtphys
1008      ENDDO
1009      ENDDO
1010      ENDIF !(ok_orodr.AND.ok_orolf) THEN
1011c
[766]1012cym      CALL gr_fi_ecrit(klev, klon,iim,jjmp1,d_u_oli,zx_tmp_3d)
1013      CALL histwrite_phy(nid_mth,"duoli",itau_w,d_u_oli)
[644]1014c
[766]1015cym      CALL gr_fi_ecrit(klev, klon,iim,jjmp1,d_v_oli,zx_tmp_3d)
1016      CALL histwrite_phy(nid_mth,"dvoli",itau_w,d_v_oli)
[644]1017c
1018      zx_tmp_fi3d(1:klon,1:klev)=d_u_con(1:klon,1:klev)/pdtphys
[766]1019cym      CALL gr_fi_ecrit(klev, klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
1020      CALL histwrite_phy(nid_mth,"ducon",itau_w,zx_tmp_fi3d)
[644]1021c
1022      zx_tmp_fi3d(1:klon,1:klev)=d_v_con(1:klon,1:klev)/pdtphys
[766]1023cym      CALL gr_fi_ecrit(klev, klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
1024      CALL histwrite_phy(nid_mth,"dvcon",itau_w,zx_tmp_fi3d)
[644]1025c
[766]1026cym      CALL gr_fi_ecrit(klev, klon,iim,jjmp1,d_u,zx_tmp_3d)
1027      CALL histwrite_phy(nid_mth,"dutot",itau_w,d_u)
[644]1028c
[766]1029cym      CALL gr_fi_ecrit(klev, klon,iim,jjmp1,d_v,zx_tmp_3d)
1030      CALL histwrite_phy(nid_mth,"dvtot",itau_w,d_v)
[644]1031
1032cEND 210404 END
1033c
1034c cldtrue
1035c     CALL gr_fi_ecrit(klev, klon,iim,jjmp1,cldtrue,zx_tmp_3d)
[766]1036c     CALL histwrite_phy(nid_mth,"cldtrue",itau_w,zx_tmp_3d,
[644]1037c    $       iim*jjmp1*klev,ndex3d)
1038c
1039c     CALL gr_fi_ecrit(klev, klon,iim,jjmp1,cldTOA,zx_tmp_3d)
[766]1040c     CALL histwrite_phy(nid_mth,"cldTOA",itau_w,zx_tmp_3d,
[644]1041c    $       iim*jjmp1*klev,ndex3d)
1042c
1043c     CALL gr_fi_ecrit(klev, klon,iim,jjmp1,cldSFC,zx_tmp_3d)
[766]1044c     CALL histwrite_phy(nid_mth,"cldSFC",itau_w,zx_tmp_3d,
[644]1045c    $       iim*jjmp1*klev,ndex3d)
1046c
1047      DO i=1, klon
1048cIM 151004    zx_tmp_fi2d(i)=GWDtaux1(i,1)-GWDtaux0(i,1)
1049       zx_tmp_fi2d(i)=zustrdr(i)+zustrli(i)
1050      ENDDO
[766]1051cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1,zx_tmp_fi2d,zx_tmp_2d)
1052      CALL histwrite_phy(nid_mth,"GWDtaux",itau_w,zx_tmp_fi2d)
[644]1053c
1054      DO i=1, klon
1055cIM 151004    zx_tmp_fi2d(i)=GWDtauy1(i,1)-GWDtauy0(i,1)
1056       zx_tmp_fi2d(i)=zvstrdr(i)+zvstrli(i)
1057      ENDDO
[766]1058cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1,zx_tmp_fi2d,zx_tmp_2d)
1059      CALL histwrite_phy(nid_mth,"GWDtauy",itau_w,zx_tmp_fi2d)
[644]1060c
1061c220404 END
1062cAMIP2 END
1063c
[766]1064cym     CALL gr_fi_ecrit(1, klon,iim,jjmp1, slp,zx_tmp_2d)
1065      CALL histwrite_phy(nid_mth,"slp",itau_w,slp)
[644]1066
[766]1067cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zxtsol,zx_tmp_2d)
1068      CALL histwrite_phy(nid_mth,"tsol",itau_w,zxtsol)
[644]1069c
[766]1070cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zt2m,zx_tmp_2d)
1071      CALL histwrite_phy(nid_mth,"t2m",itau_w,zt2m)
[644]1072c
1073c ENSEMBLES BEG
[766]1074cym      CALL gr_fi_ecrit(1,klon,iim,jjmp1,zt2m,zx_tmp_2d)
[879]1075c     CALL histwrite_phy(nid_mth,"t2m_min",itau_w,zt2m)
[644]1076c
[766]1077cym     CALL gr_fi_ecrit(1,klon,iim,jjmp1,zt2m,zx_tmp_2d)
[879]1078c     CALL histwrite_phy(nid_mth,"t2m_max",itau_w,zt2m)
[644]1079c
1080c     CALL gr_fi_ecrit(1,klon,iim,jjmp1,ftsoil(:,1,is_ter),zx_tmp_2d)
1081c     CALL gr_fi_ecrit(1,klon,iim,jjmp1,ftsol(:,is_ter),zx_tmp_2d)
1082c     CALL gr_fi_ecrit(1,klon,iim,jjmp1,ztsol,zx_tmp_2d)
[766]1083c     CALL histwrite_phy(nid_mth,"tsoil",itau_w,zx_tmp_2d,
[644]1084c    .               iim*jjmp1,ndex2d)
1085c
1086      DO i=1, klon
1087       zx_tmp_fi2d(i)=SQRT(zu10m(i)*zu10m(i)+zv10m(i)*zv10m(i))
1088      ENDDO
[766]1089cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
1090      CALL histwrite_phy(nid_mth,"wind10m",itau_w,zx_tmp_fi2d)
[644]1091c
1092      DO i = 1, klon
1093         zx_tmp_fi2d(i) = pctsrf(i,is_sic)
1094      ENDDO
[766]1095cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
1096      CALL histwrite_phy(nid_mth,"sicf",itau_w,zx_tmp_fi2d)
[644]1097c
1098c     CALL gr_fi_ecrit(klev,klon,iim,jjmp1, t_seri, zx_tmp_3d)
[766]1099c     CALL histwrite_phy(nid_mth,"temp",itau_w,zx_tmp_3d,
[644]1100c    .                                   iim*jjmp1*klev,ndex3d)
1101c
1102c ENSEMBLES END
1103c
[766]1104cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zq2m,zx_tmp_2d)
1105      CALL histwrite_phy(nid_mth,"q2m",itau_w,zq2m)
[644]1106c
[766]1107cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zu10m,zx_tmp_2d)
1108      CALL histwrite_phy(nid_mth,"u10m",itau_w,zu10m)
[644]1109C
[766]1110cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zv10m,zx_tmp_2d)
1111      CALL histwrite_phy(nid_mth,"v10m",itau_w,zv10m)
[644]1112C
1113      DO i = 1, klon
1114         zx_tmp_fi2d(i) = paprs(i,1)
1115      ENDDO
[766]1116cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
1117      CALL histwrite_phy(nid_mth,"psol",itau_w,zx_tmp_fi2d)
[644]1118c
[766]1119cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zxqsurf,zx_tmp_2d)
1120      CALL histwrite_phy(nid_mth,"qsurf",itau_w,zxqsurf)
[644]1121c
1122      if (.not. ok_veget) then
[766]1123cym          CALL gr_fi_ecrit(1, klon,iim,jjmp1, qsol,zx_tmp_2d)
1124          CALL histwrite_phy(nid_mth,"qsol",itau_w,qsol)
[644]1125      endif
1126c
1127      DO i = 1, klon
1128         zx_tmp_fi2d(i) = rain_fall(i) + snow_fall(i)
1129      ENDDO
[766]1130cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
1131      CALL histwrite_phy(nid_mth,"precip",itau_w,zx_tmp_fi2d)
[644]1132c
[766]1133cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, nday_rain,zx_tmp_2d)
[879]1134c     CALL histwrite_phy(nid_mth,"ndayrain",itau_w,nday_rain)
[644]1135c
1136      DO i = 1, klon
1137         zx_tmp_fi2d(i) = rain_lsc(i) + snow_lsc(i)
1138      ENDDO
[766]1139cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
1140      CALL histwrite_phy(nid_mth,"plul",itau_w,zx_tmp_fi2d)
[644]1141c
1142      DO i = 1, klon
1143         zx_tmp_fi2d(i) = rain_con(i) + snow_con(i)
1144      ENDDO
[766]1145cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
1146      CALL histwrite_phy(nid_mth,"pluc",itau_w,zx_tmp_fi2d)
[644]1147c
[766]1148cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, snow_fall,zx_tmp_2d)
1149      CALL histwrite_phy(nid_mth,"snowf",itau_w,snow_fall)
[644]1150c
1151c     CALL gr_fi_ecrit(1, klon,iim,jjmp1, zsnow_mass,zx_tmp_2d)
[766]1152c     CALL histwrite_phy(nid_mth,"snow_mass",itau_w,zx_tmp_2d,iim*jjmp1,
[644]1153c    .               ndex2d)
1154c
[766]1155cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, evap,zx_tmp_2d)
1156      CALL histwrite_phy(nid_mth,"evap",itau_w,evap)
[644]1157c
[766]1158cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, topsw,zx_tmp_2d)
1159      CALL histwrite_phy(nid_mth,"tops",itau_w,topsw)
[644]1160c
[766]1161cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, topsw0,zx_tmp_2d)
1162      CALL histwrite_phy(nid_mth,"tops0",itau_w,topsw0)
[644]1163c
[766]1164cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, toplw,zx_tmp_2d)
1165      CALL histwrite_phy(nid_mth,"topl",itau_w,toplw)
[644]1166c
[766]1167cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, toplw0,zx_tmp_2d)
1168      CALL histwrite_phy(nid_mth,"topl0",itau_w,toplw0)
[644]1169c
1170      zx_tmp_fi2d(1 : klon) = swup ( 1 : klon, klevp1 )
[766]1171cym      CALL gr_fi_ecrit(1,klon,iim,jjmp1,zx_tmp_fi2d,zx_tmp_2d)
1172      CALL histwrite_phy(nid_mth, "SWupTOA",itau_w,zx_tmp_fi2d)
[644]1173c
1174c
1175      zx_tmp_fi2d(1 : klon) = swup0 ( 1 : klon, klevp1 )
[766]1176cym      CALL gr_fi_ecrit(1,klon,iim,jjmp1,zx_tmp_fi2d,zx_tmp_2d)
1177      CALL histwrite_phy(nid_mth, "SWupTOAclr",itau_w,zx_tmp_fi2d)
[644]1178c
1179      zx_tmp_fi2d(1 : klon) = swdn ( 1 : klon, klevp1 )
[766]1180cym      CALL gr_fi_ecrit(1,klon,iim,jjmp1,zx_tmp_fi2d,zx_tmp_2d)
1181      CALL histwrite_phy(nid_mth, "SWdnTOA",itau_w,zx_tmp_fi2d)
[644]1182c
1183      zx_tmp_fi2d(1 : klon) = swdn0 ( 1 : klon, klevp1 )
[766]1184cym      CALL gr_fi_ecrit(1,klon,iim,jjmp1,zx_tmp_fi2d,zx_tmp_2d)
1185      CALL histwrite_phy(nid_mth, "SWdnTOAclr",itau_w,zx_tmp_fi2d)
[644]1186c
[766]1187cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, SWup200,zx_tmp_2d)
1188      CALL histwrite_phy(nid_mth,"SWup200",itau_w,SWup200)
[644]1189c
[766]1190cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, SWup200clr,zx_tmp_2d)
1191      CALL histwrite_phy(nid_mth,"SWup200clr",itau_w,SWup200clr)
[644]1192c
[766]1193cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, SWdn200,zx_tmp_2d)
1194      CALL histwrite_phy(nid_mth,"SWdn200",itau_w,SWdn200)
[644]1195c
[766]1196cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, SWdn200clr,zx_tmp_2d)
1197      CALL histwrite_phy(nid_mth,"SWdn200clr",itau_w,SWdn200clr)
[644]1198c
[766]1199cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, LWup200,zx_tmp_2d)
1200      CALL histwrite_phy(nid_mth,"LWup200",itau_w,LWup200)
[644]1201c
[766]1202cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, LWup200clr,zx_tmp_2d)
1203      CALL histwrite_phy(nid_mth,"LWup200clr",itau_w,LWup200clr)
[644]1204c
1205      zx_tmp_fi2d(1:klon)=-1*LWdn200(1:klon)
[766]1206cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
1207      CALL histwrite_phy(nid_mth,"LWdn200",itau_w,zx_tmp_fi2d)
[644]1208c
1209      zx_tmp_fi2d(1:klon)=-1*LWdn200clr(1:klon)
[766]1210cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
1211      CALL histwrite_phy(nid_mth,"LWdn200clr",itau_w,zx_tmp_fi2d)
[644]1212c
1213c200 END
[766]1214cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, solsw,zx_tmp_2d)
1215      CALL histwrite_phy(nid_mth,"sols",itau_w,solsw)
[644]1216c
[766]1217cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, solsw0,zx_tmp_2d)
1218      CALL histwrite_phy(nid_mth,"sols0",itau_w,solsw0)
[644]1219c
[766]1220cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, sollw,zx_tmp_2d)
1221      CALL histwrite_phy(nid_mth,"soll",itau_w,sollw)
[644]1222c
[766]1223cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, radsol,zx_tmp_2d)
1224      CALL histwrite_phy(nid_mth,"radsol",itau_w,radsol)
[684]1225c
[766]1226cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, sollw0,zx_tmp_2d)
1227      CALL histwrite_phy(nid_mth,"soll0",itau_w,sollw0)
[644]1228c
1229c      zx_tmp_fi2d(1 : klon) = ZFSUP( 1 : klon, 1)
1230      zx_tmp_fi2d(1 : klon) = swup ( 1 : klon, 1 )
[766]1231cym      CALL gr_fi_ecrit(1,klon,iim,jjmp1,zx_tmp_fi2d,zx_tmp_2d)
1232      CALL histwrite_phy(nid_mth, "SWupSFC",itau_w,zx_tmp_fi2d)
[644]1233c
1234c      zx_tmp_fi2d(1 : klon) = ZFSUP0( 1 : klon, 1)
1235      zx_tmp_fi2d(1 : klon) = swup0 ( 1 : klon, 1 )
[766]1236cym      CALL gr_fi_ecrit(1,klon,iim,jjmp1,zx_tmp_fi2d,zx_tmp_2d)
1237      CALL histwrite_phy(nid_mth, "SWupSFCclr",itau_w,zx_tmp_fi2d)
[644]1238c
1239c      zx_tmp_fi2d(1 : klon) = ZFSDN( 1 : klon, 1)
1240      zx_tmp_fi2d(1 : klon) = swdn ( 1 : klon, 1 )
[766]1241cym      CALL gr_fi_ecrit(1,klon,iim,jjmp1,zx_tmp_fi2d,zx_tmp_2d)
1242      CALL histwrite_phy(nid_mth, "SWdnSFC",itau_w,zx_tmp_fi2d)
[644]1243c
1244c      zx_tmp_fi2d(1 : klon) = ZFSDN0( 1 : klon, 1)
1245      zx_tmp_fi2d(1 : klon) = swdn0 ( 1 : klon, 1 )
[766]1246cym      CALL gr_fi_ecrit(1,klon,iim,jjmp1,zx_tmp_fi2d,zx_tmp_2d)
1247      CALL histwrite_phy(nid_mth, "SWdnSFCclr",itau_w,zx_tmp_fi2d)
[644]1248c
1249cIM 080904   zx_tmp_fi2d(1:klon)=sollw(1:klon)+sollwdown(1:klon)
1250cIM 130904   zx_tmp_fi2d(1:klon)=sollw(1:klon)-sollwdown(1:klon)
1251      zx_tmp_fi2d(1:klon)=sollwdown(1:klon)-sollw(1:klon)
[766]1252cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d, zx_tmp_2d)
1253      CALL histwrite_phy(nid_mth,"LWupSFC",itau_w,zx_tmp_fi2d)
[644]1254c
1255      DO i=1, klon
1256       sollwdownclr(i)=-1.*lwdn0(i,1)
1257      ENDDO !i=1, klon
1258c
1259cIM 080904   zx_tmp_fi2d(1:klon)=sollw0(1:klon)+sollwdownclr(1:klon)
1260cIM 130904   zx_tmp_fi2d(1:klon)=sollw0(1:klon)-sollwdownclr(1:klon)
1261      zx_tmp_fi2d(1:klon)=sollwdownclr(1:klon)-sollw0(1:klon)
[766]1262cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d, zx_tmp_2d)
1263      CALL histwrite_phy(nid_mth,"LWupSFCclr",itau_w,zx_tmp_fi2d)
[644]1264c
[766]1265cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, sollwdown,zx_tmp_2d)
1266      CALL histwrite_phy(nid_mth,"LWdnSFC",itau_w,sollwdown)
[644]1267c
1268c     DO i=1, klon
1269cIM 08004    sollwdownclr(i)=lwdn0(i,1)
1270c      sollwdownclr(i)=-1.*lwdn0(i,1)
1271c     ENDDO !i=1, klon
1272c
[766]1273cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, sollwdownclr,zx_tmp_2d)
1274      CALL histwrite_phy(nid_mth,"LWdnSFCclr",itau_w,sollwdownclr)
[903]1275c effets des aerosols
[644]1276c
[903]1277      IF (ok_ade.OR.ok_aie) THEN
1278      zx_tmp_fi2d(1:klon) = topswai(1:klon) - topswad(1:klon)
1279      CALL histwrite_phy(nid_mth,"topsad",itau_w,zx_tmp_2d)
1280c
1281      zx_tmp_fi2d(1:klon) = solswai(1:klon) - solswad(1:klon)
1282      CALL histwrite_phy(nid_mth,"solsad",itau_w,zx_tmp_2d)
1283c
1284      zx_tmp_fi2d(1:klon) = topsw(1:klon) - topswai(1:klon)
1285      CALL histwrite_phy(nid_mth,"topsai",itau_w,zx_tmp_2d)
1286c
1287      zx_tmp_fi2d(1:klon) = solsw(1:klon) - solswai(1:klon)
1288      CALL histwrite_phy(nid_mth,"solsai",itau_w,zx_tmp_2d)
1289      endif
1290
1291c
[766]1292cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, bils,zx_tmp_2d)
1293      CALL histwrite_phy(nid_mth,"bils",itau_w,bils)
[644]1294c
1295      zx_tmp_fi2d(1:klon)=-1*sens(1:klon)
1296c     CALL gr_fi_ecrit(1, klon,iim,jjmp1, sens,zx_tmp_2d)
[766]1297cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
1298      CALL histwrite_phy(nid_mth,"sens",itau_w,zx_tmp_fi2d)
[644]1299c
[766]1300cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, fder,zx_tmp_2d)
1301      CALL histwrite_phy(nid_mth,"fder",itau_w,fder)
[644]1302c
[903]1303c Effets des aerosols
[644]1304c
[903]1305      IF (ok_ade.OR.ok_aie) THEN
1306        zx_tmp_fi2d(1:klon) = topswai(1:klon) - topswad(1:klon)
1307        CALL histwrite_phy(nid_mth,"topsad",itau_w,zx_tmp_fi2d)
1308c
1309        zx_tmp_fi2d(1:klon) = solswai(1:klon) - solswad(1:klon)
1310        CALL histwrite_phy(nid_mth,"solsad",itau_w,zx_tmp_fi2d)
1311c
1312        zx_tmp_fi2d(1:klon) = topsw(1:klon) - topswai(1:klon)
1313        CALL histwrite_phy(nid_mth,"topsai",itau_w,zx_tmp_fi2d)
1314c
1315        zx_tmp_fi2d(1:klon) = solsw(1:klon) - solswai(1:klon)
1316        CALL histwrite_phy(nid_mth,"solsai",itau_w,zx_tmp_fi2d)
1317      ENDIF
1318c
1319c
[644]1320c      DO i = 1, klon
1321c         zx_tmp_fi2d(i) = fluxu(i,1)
1322c      ENDDO
1323c      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
[766]1324c      CALL histwrite_phy(nid_mth,"frtu",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
[644]1325c
1326c      DO i = 1, klon
1327c         zx_tmp_fi2d(i) = fluxv(i,1)
1328c      ENDDO
1329c      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
[766]1330c      CALL histwrite_phy(nid_mth,"frtv",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d)
[644]1331c
1332c
[766]1333cym       CALL gr_fi_ecrit(1, klon,iim,jjmp1, zxffonte,zx_tmp_2d)
1334       CALL histwrite_phy(nid_mth,"ffonte",itau_w,zxffonte)
[644]1335c
[766]1336cym       CALL gr_fi_ecrit(1, klon,iim,jjmp1, zxfqcalving,zx_tmp_2d)
1337       CALL histwrite_phy(nid_mth,"fqcalving",itau_w,zxfqcalving)
[644]1338c
1339       DO nsrf = 1, nbsrf
1340        zx_tmp_fi2d(1 : klon) = fluxu( 1 : klon, 1, nsrf)
[766]1341cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
1342        CALL histwrite_phy(nid_mth,"taux_"//clnsurf(nsrf),itau_w,
1343     $      zx_tmp_fi2d) 
[644]1344C     
1345        zx_tmp_fi2d(1 : klon) = fluxv( 1 : klon, 1, nsrf)
[766]1346cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
1347        CALL histwrite_phy(nid_mth,"tauy_"//clnsurf(nsrf),itau_w,
1348     $      zx_tmp_fi2d)
[644]1349       ENDDO
1350c
1351        zx_tmp_fi2d(1 : klon) = pctsrf( 1 : klon, is_oce)*100.
[766]1352cym        CALL gr_fi_ecrit(1,klon,iim,jjmp1,zx_tmp_fi2d,zx_tmp_2d)
1353        CALL histwrite_phy(nid_mth,"pourc_"//clnsurf(is_oce),itau_w,
1354     $      zx_tmp_fi2d) 
[644]1355c
1356        zx_tmp_fi2d(1 : klon) = pctsrf( 1 : klon, is_oce)
[766]1357cym        CALL gr_fi_ecrit(1,klon,iim,jjmp1,zx_tmp_fi2d,zx_tmp_2d)
1358        CALL histwrite_phy(nid_mth,"fract_"//clnsurf(is_oce),itau_w,
1359     $      zx_tmp_fi2d) 
[644]1360c
1361      DO nsrf = 1, nbsrf
1362CYYY
1363C
1364        zx_tmp_fi2d(1 : klon) = ftsol( 1 : klon, nsrf)
[766]1365cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
1366        CALL histwrite_phy(nid_mth,"tsol_"//clnsurf(nsrf),itau_w,
1367     $      zx_tmp_fi2d)
[644]1368C
1369        zx_tmp_fi2d(1 : klon) = fluxt( 1 : klon, 1, nsrf)
[766]1370cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
1371        CALL histwrite_phy(nid_mth,"sens_"//clnsurf(nsrf),itau_w,
1372     $      zx_tmp_fi2d)
[644]1373C
1374        zx_tmp_fi2d(1 : klon) = fluxlat( 1 : klon, nsrf)
[766]1375cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
1376        CALL histwrite_phy(nid_mth,"lat_"//clnsurf(nsrf),itau_w,
1377     $      zx_tmp_fi2d) 
[644]1378C
1379        zx_tmp_fi2d(1 : klon) = fsollw( 1 : klon, nsrf)
[766]1380cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
1381        CALL histwrite_phy(nid_mth,"flw_"//clnsurf(nsrf),itau_w,
1382     $      zx_tmp_fi2d)
[644]1383c
1384        zx_tmp_fi2d(1 : klon) = fsolsw( 1 : klon, nsrf)
[766]1385cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
1386        CALL histwrite_phy(nid_mth,"fsw_"//clnsurf(nsrf),itau_w,
1387     $      zx_tmp_fi2d)
[644]1388C
1389        zx_tmp_fi2d(1 : klon) = wfbils( 1 : klon, nsrf)
[766]1390cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
1391        CALL histwrite_phy(nid_mth,"wbils_"//clnsurf(nsrf),itau_w,
1392     $      zx_tmp_fi2d)
[644]1393C
[684]1394        zx_tmp_fi2d(1 : klon) = wfbilo( 1 : klon, nsrf)
[766]1395cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
1396        CALL histwrite_phy(nid_mth,"wbilo_"//clnsurf(nsrf),itau_w,
1397     $      zx_tmp_fi2d)
[684]1398C
[644]1399       IF(1.EQ.0) THEN
1400C
1401        zx_tmp_fi2d(1:klon) = fevap(1:klon,nsrf)*pctsrf(1:klon,nsrf)
[766]1402cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
1403        CALL histwrite_phy(nid_mth,"evapour_"//clnsurf(nsrf),itau_w,
1404     $      zx_tmp_fi2d)
[644]1405C
1406        zx_tmp_fi2d(1:klon) = (rain_fall(1:klon) + snow_fall(1:klon))
1407     $                        *pctsrf(1:klon,nsrf)
[766]1408cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
1409        CALL histwrite_phy(nid_mth,"prepour_"//clnsurf(nsrf),itau_w,
1410     $      zx_tmp_fi2d)
[644]1411C
1412       ENDIF !(1.EQ.0) THEN
1413C
1414      END DO 
1415c
[766]1416cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, cdragm,zx_tmp_2d)
1417      CALL histwrite_phy(nid_mth,"cdrm",itau_w,cdragm)
[644]1418c
[766]1419cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, cdragh,zx_tmp_2d)
1420      CALL histwrite_phy(nid_mth,"cdrh",itau_w,cdragh)
[644]1421c
[766]1422cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, cldl,zx_tmp_2d)
1423      CALL histwrite_phy(nid_mth,"cldl",itau_w,cldl)
[644]1424c
[766]1425cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, cldm,zx_tmp_2d)
1426      CALL histwrite_phy(nid_mth,"cldm",itau_w,cldm)
[644]1427c
[766]1428cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, cldh,zx_tmp_2d)
1429      CALL histwrite_phy(nid_mth,"cldh",itau_w,cldh)
[644]1430c
[766]1431cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, cldt*100.,zx_tmp_2d)
1432      CALL histwrite_phy(nid_mth,"cldt",itau_w,cldt*100.)
[644]1433c
[766]1434cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, cldq,zx_tmp_2d)
1435      CALL histwrite_phy(nid_mth,"cldq",itau_w,cldq)
[644]1436c
1437      zx_tmp_fi2d(1:klon) = flwp(1:klon)
[766]1438cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
1439      CALL histwrite_phy(nid_mth,"lwp",itau_w,zx_tmp_fi2d)
[644]1440c
1441      zx_tmp_fi2d(1:klon) = fiwp(1:klon)
[766]1442cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
1443      CALL histwrite_phy(nid_mth,"iwp",itau_w,zx_tmp_fi2d)
[644]1444c
[766]1445cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, ue,zx_tmp_2d)
1446      CALL histwrite_phy(nid_mth,"ue",itau_w,ue)
[644]1447c
[766]1448cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, ve,zx_tmp_2d)
1449      CALL histwrite_phy(nid_mth,"ve",itau_w,ve)
[644]1450c
[766]1451cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, uq,zx_tmp_2d)
1452      CALL histwrite_phy(nid_mth,"uq",itau_w,uq)
[644]1453c
[766]1454cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, vq,zx_tmp_2d)
1455      CALL histwrite_phy(nid_mth,"vq",itau_w,vq)
[644]1456cKE43
1457      IF (iflag_con.GE.3) THEN ! sb
1458c
[766]1459cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, cape,zx_tmp_2d)
1460      CALL histwrite_phy(nid_mth,"cape",itau_w,cape)
[644]1461c
[766]1462cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1,pbase,zx_tmp_2d)
1463      CALL histwrite_phy(nid_mth,"pbase",itau_w,pbase)
[644]1464c
[766]1465cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1,ema_pct,zx_tmp_2d)
1466      CALL histwrite_phy(nid_mth,"ptop",itau_w,ema_pct)
[644]1467c
[766]1468cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1,ema_cbmf,zx_tmp_2d)
1469      CALL histwrite_phy(nid_mth,"fbase",itau_w,ema_cbmf)
[644]1470c
1471c34EK
1472c
[766]1473cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, prw,zx_tmp_2d)
1474      CALL histwrite_phy(nid_mth,"prw",itau_w,prw)
[644]1475c
1476      ENDIF !iflag_con.GE.3
1477c
1478cIM cf. AM 081204 BEG
1479cHBTM2
1480c
1481c
[766]1482cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, s_pblh,zx_tmp_2d)
1483      CALL histwrite_phy(nid_mth,"s_pblh",itau_w,s_pblh)
[644]1484c
[766]1485cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, s_pblt,zx_tmp_2d)
1486      CALL histwrite_phy(nid_mth,"s_pblt",itau_w,s_pblt)
[644]1487c
[766]1488cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, s_lcl,zx_tmp_2d)
1489      CALL histwrite_phy(nid_mth,"s_lcl",itau_w,s_lcl)
[644]1490c
[766]1491cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, s_capCL,zx_tmp_2d)
1492      CALL histwrite_phy(nid_mth,"s_capCL",itau_w,s_capCL)
[644]1493c
[766]1494cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, s_oliqCL,zx_tmp_2d)
1495      CALL histwrite_phy(nid_mth,"s_oliqCL",itau_w,s_oliqCL)
[644]1496c
[766]1497cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, s_cteiCL,zx_tmp_2d)
1498      CALL histwrite_phy(nid_mth,"s_cteiCL",itau_w,s_cteiCL)
[644]1499c
[766]1500cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, s_therm,zx_tmp_2d)
1501      CALL histwrite_phy(nid_mth,"s_therm",itau_w,s_therm)
[644]1502c
[766]1503cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, s_trmb1,zx_tmp_2d)
1504      CALL histwrite_phy(nid_mth,"s_trmb1",itau_w,s_trmb1)
[644]1505c
[766]1506cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, s_trmb2,zx_tmp_2d)
1507      CALL histwrite_phy(nid_mth,"s_trmb2",itau_w,s_trmb2)
[644]1508c
[766]1509cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, s_trmb3,zx_tmp_2d)
1510      CALL histwrite_phy(nid_mth,"s_trmb3",itau_w,s_trmb3)
[644]1511c
1512cIM cf. AM 081204 END
1513c
1514c  Champs interpolles sur des niveaux de pression
1515c     DO k=1, nlevENS
1516      DO k=1, nlevSTD
1517c
1518c        bb=clevSTD(k)
1519c
1520c        IF(k.GE.2) THEN
1521         IF(k.GE.2.AND.k.LE.12) bb2=clevSTD(k)
1522         IF(k.GE.13.AND.k.LE.17) bb3=clevSTD(k)
1523c         aa=clevSTD(k)
1524c         bb=aa(1:lnblnk1(aa))
1525c        ENDIF
1526c
1527       IF(bb2.EQ."850".OR.bb2.EQ."700"
1528     $   .OR.bb2.EQ."500".OR.bb2.EQ."200") THEN
1529c
[766]1530cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1,usumSTD(:,k,2),zx_tmp_2d)
1531        CALL histwrite_phy(nid_mth,"u"//bb2,itau_w,usumSTD(:,k,2))
[644]1532c
[766]1533cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1,vsumSTD(:,k,2),zx_tmp_2d)
1534        CALL histwrite_phy(nid_mth,"v"//bb2,itau_w,vsumSTD(:,k,2))
[644]1535c
[766]1536cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1,wsumSTD(:,k,2),zx_tmp_2d)
1537      CALL histwrite_phy(nid_mth,"w"//bb2,itau_w,wsumSTD(:,k,2))
[644]1538c
[766]1539cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1,phisumSTD(:,k,2),zx_tmp_2d)
1540      CALL histwrite_phy(nid_mth,"phi"//bb2,itau_w,phisumSTD(:,k,2))
[644]1541c
1542      ENDIF !(bb2.EQ."850".OR.bb2.EQ."700"
1543      ENDDO !nlevSTD
1544c
1545      DO i=1, klon
1546       IF (pctsrf(i,is_oce).GT.epsfra) THEN
1547        zx_tmp_fi2d(i) = fluxo(i)
1548       ELSE
[684]1549        zx_tmp_fi2d(i) = 0.
[644]1550       ENDIF
1551      ENDDO
1552c
[766]1553cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
1554      CALL histwrite_phy(nid_mth,"fluxo",itau_w,zx_tmp_fi2d)
[644]1555c
1556      DO i=1, klon
1557       IF (pctsrf(i,is_sic).GT.epsfra) THEN
1558        zx_tmp_fi2d(i) = fluxg(i)
1559       ELSE
[684]1560        zx_tmp_fi2d(i) = 0.
[644]1561       ENDIF
1562      ENDDO
1563c
[766]1564cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
1565      CALL histwrite_phy(nid_mth,"fluxg",itau_w,zx_tmp_fi2d)
[644]1566c
[684]1567      DO i=1, klon
1568       IF (pctsrf(i,is_oce).GT.epsfra.OR.
1569     .     pctsrf(i,is_sic).GT.epsfra) THEN
1570        zx_tmp_fi2d(i) = (ftsol(i, is_oce) * pctsrf(i,is_oce)+ 
1571     .                   ftsol(i, is_sic) * pctsrf(i,is_sic))/
1572     .                   (pctsrf(i,is_oce)+pctsrf(i,is_sic))
1573       ELSE
1574        zx_tmp_fi2d(i) = 273.15
1575       ENDIF
1576      ENDDO
1577c
[766]1578cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
1579      CALL histwrite_phy(nid_mth,"t_oce_sic",itau_w,zx_tmp_fi2d)
[684]1580c
[644]1581      IF (OCEAN.EQ.'force ') THEN
1582c
1583      DO i=1, klon
1584      IF((pctsrf(i,is_oce).GT.epsfra).OR.
1585     .   (pctsrf(i,is_sic).GT.epsfra)) THEN
1586       zx_tmp_fi2d(i) = (radsol(i) + fluxo(i))*pctsrf(i,is_oce)+
1587     .                  fluxg(i)*pctsrf(i,is_sic)
1588      ELSE
1589       zx_tmp_fi2d(i) = 1.E+20
1590      ENDIF
1591      ENDDO
[766]1592cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
1593      CALL histwrite_phy(nid_mth,"lmt_bils",itau_w,
1594     .     zx_tmp_fi2d)
[644]1595c
1596      ELSE IF (OCEAN.EQ.'slab  ') THEN
1597c
1598c
1599      DO i=1, klon
1600      IF((pctsrf(i,is_oce).GT.epsfra).OR.
1601     .   (pctsrf(i,is_sic).GT.epsfra)) THEN
1602       zx_tmp_fi2d(i) = (radsol(i) + fluxo(i))*pctsrf(i,is_oce)+
1603     .                  fluxg(i)*pctsrf(i,is_sic)
1604      ELSE
1605       zx_tmp_fi2d(i) = 1.E+20
1606      ENDIF
1607      ENDDO
[766]1608cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
1609      CALL histwrite_phy(nid_mth,"slab_bils",itau_w,
1610     .     zx_tmp_fi2d)
[644]1611c
1612      DO i=1, klon
1613       IF(pctsrf(i,is_oce).GT.epsfra.OR.
1614     $    pctsrf(i,is_sic).GT.epsfra) THEN
1615        zx_tmp_fi2d(i)=tslab(i)
1616       ELSE
1617        zx_tmp_fi2d(i) = 1.E+20
1618       ENDIF
1619      ENDDO !i=1, klon
[766]1620cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
1621      CALL histwrite_phy(nid_mth,"tslab",itau_w,zx_tmp_fi2d)
[644]1622c
[766]1623cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, seaice,zx_tmp_2d)
1624      CALL histwrite_phy(nid_mth,"seaice",itau_w,seaice)
[644]1625c
[766]1626cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, seaice/1000.,zx_tmp_2d)
1627      CALL histwrite_phy(nid_mth,"siceh",itau_w,seaice/1000.)
[644]1628c
1629      ENDIF !OCEAN.EQ.force/slab
1630c
1631      ENDIF !lev_histmth.GE.1
1632c
1633      IF(lev_histmth.GE.2) THEN
1634c
1635c Champs 3D:
1636C
1637c
[766]1638cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, flwc,zx_tmp_3d)
1639      CALL histwrite_phy(nid_mth,"lwcon",itau_w,flwc)
[644]1640c
[766]1641cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, fiwc,zx_tmp_3d)
1642      CALL histwrite_phy(nid_mth,"iwcon",itau_w,fiwc)
[644]1643c
1644c#ifdef histmthNMC
1645c#include "write_histmthNMC.h"
1646c#endif
1647c
[766]1648cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, qx(1,1,ivap), zx_tmp_3d)
1649      CALL histwrite_phy(nid_mth,"ovap",itau_w, qx(:,:,ivap))
[524]1650c
[644]1651c     zx_tmp_fi3d(1:klon,1:klev)=qx(1:klon,1:klev,ivap)/
1652c    .                         (1-qx(1:klon,1:klev,ivap))
1653c     CALL gr_fi_ecrit(klev,klon,iim,jjmp1, zx_tmp_fi3d, zx_tmp_3d)
[766]1654c     CALL histwrite_phy(nid_mth,"wvap",itau_w,zx_tmp_3d,
[644]1655c    .                                   iim*jjmp1*klev,ndex3d)
1656c
[766]1657cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, zphi, zx_tmp_3d)
1658      CALL histwrite_phy(nid_mth,"geop",itau_w,zphi)
[524]1659c
[766]1660cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, u_seri, zx_tmp_3d)
1661      CALL histwrite_phy(nid_mth,"vitu",itau_w,u_seri)
[524]1662c
[766]1663cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, v_seri, zx_tmp_3d)
1664      CALL histwrite_phy(nid_mth,"vitv",itau_w,v_seri)
[644]1665c
[766]1666cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, omega, zx_tmp_3d)
1667      CALL histwrite_phy(nid_mth,"vitw",itau_w,omega)
[644]1668c
[766]1669cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, pplay, zx_tmp_3d)
1670      CALL histwrite_phy(nid_mth,"pres",itau_w,pplay)
[644]1671c
[766]1672cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, cldfra*100., zx_tmp_3d)
1673      CALL histwrite_phy(nid_mth,"rneb",itau_w,cldfra*100.)
[644]1674c
[766]1675cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, rnebcon, zx_tmp_3d)
1676      CALL histwrite_phy(nid_mth,"rnebcon",itau_w,rnebcon)
[644]1677c
[766]1678cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, zx_rh, zx_tmp_3d)
1679      CALL histwrite_phy(nid_mth,"rhum",itau_w,zx_rh)
[644]1680c
1681      DO k=1, klev
1682       DO i=1, klon
1683cIM 151004        zx_tmp_fi3d(i,k)=MAX(wo(i,k),1.0e-12)*RG/46.6968
1684c    $                    /(paprs(i,k)-paprs(i,k+1))
1685c    $                    *(paprs(i,1)/101325.0)
1686c        zx_tmp2_fi3d(i,k)=MAX(wo(i,k)*1.0e+6,1.0e-6)*RG/46.6968
1687         zx_tmp_fi3d(i,k)=wo(i,k)*RG/46.6968
1688     $                    /(paprs(i,k)-paprs(i,k+1))
1689     $                    *(paprs(i,1)/101325.0)
1690       ENDDO !i
1691      ENDDO !k
1692c
1693c     CALL gr_fi_ecrit(klev,klon,iim,jjmp1, wo, zx_tmp_3d)
1694c     CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp2_fi3d,zx_tmp_3d)
[766]1695cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
1696      CALL histwrite_phy(nid_mth,"ozone",itau_w,zx_tmp_fi3d)
[644]1697c
[766]1698cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_t, zx_tmp_3d)
1699      CALL histwrite_phy(nid_mth,"dtphy",itau_w,d_t)
[644]1700c
[766]1701cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_qx(:,:,ivap),zx_tmp_3d)
1702      CALL histwrite_phy(nid_mth,"dqphy",itau_w,d_qx(:,:,ivap))
[644]1703c
1704      ENDIF !lev_histmth.GE.2
1705c
1706      IF(lev_histmth.GE.3) THEN
1707c
1708       DO nsrf=1, nbsrf
1709c
[888]1710        zx_tmp_fi2d(1 : klon) = falb1( 1 : klon, nsrf)
[766]1711cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
1712        CALL histwrite_phy(nid_mth,"albe_"//clnsurf(nsrf),itau_w,
1713     $      zx_tmp_fi2d)
[644]1714C
1715        zx_tmp_fi2d(1 : klon) = frugs( 1 : klon, nsrf)
[766]1716cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
1717        CALL histwrite_phy(nid_mth,"rugs_"//clnsurf(nsrf),itau_w,
1718     $      zx_tmp_fi2d)
[644]1719c
1720      zx_tmp_fi2d(1 : klon) = agesno( 1 : klon, nsrf)
[766]1721cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, agesno,zx_tmp_2d)
1722      CALL histwrite_phy(nid_mth,"ages_"//clnsurf(nsrf),itau_w
1723     $    ,agesno)
[644]1724c
1725      ENDDO !nsrf=1, nbsrf
1726c
[888]1727cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, albsol1,zx_tmp_2d)
1728      CALL histwrite_phy(nid_mth,"albs",itau_w,albsol1)
[644]1729c
[888]1730cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, albsol2,zx_tmp_2d)
1731      CALL histwrite_phy(nid_mth,"albslw",itau_w,albsol2)
[644]1732c
1733      ENDIF !lev_histmth.GE.3
1734c
1735c
1736      IF(lev_histmth.GE.4) THEN
1737c
[878]1738c  FH Sorties pour la couche limite
1739      CALL histwrite_phy(nid_mth,"kz",itau_w,ycoefh)
1740      CALL histwrite_phy(nid_mth,"kz_max",itau_w,ycoefh)
1741
1742      if(iflag_pbl>1) then
1743      zx_tmp_fi3d=0.
1744      do nsrf=1,nbsrf
1745         do k=1,klev
1746          zx_tmp_fi3d(:,k)=zx_tmp_fi3d(:,k)
1747     ,    +pctsrf(:,nsrf)*pbl_tke(:,k,nsrf)
1748         enddo
1749      enddo
1750      CALL histwrite_phy(nid_mth,"tke",itau_w,zx_tmp_fi3d)
1751      CALL histwrite_phy(nid_mth,"tke_max",itau_w,zx_tmp_fi3d)
1752      endif
1753
1754
1755
[766]1756cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, clwcon0, zx_tmp_3d)
1757      CALL histwrite_phy(nid_mth,"clwcon",itau_w,clwcon0)
[644]1758c
[653]1759      IF (iflag_con.GE.3) THEN
1760c
[766]1761cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, Ma, zx_tmp_3d)
1762      CALL histwrite_phy(nid_mth,"Ma",itau_w,Ma)
[644]1763c
[766]1764cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, upwd, zx_tmp_3d)
1765      CALL histwrite_phy(nid_mth,"upwd",itau_w,upwd)
[644]1766c
[766]1767cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, dnwd, zx_tmp_3d)
1768      CALL histwrite_phy(nid_mth,"dnwd",itau_w,dnwd)
[644]1769c
[766]1770cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, dnwd0, zx_tmp_3d)
1771      CALL histwrite_phy(nid_mth,"dnwd0",itau_w,dnwd0)
[644]1772c
[653]1773      ENDIF !iflag_con.GE.3
[644]1774c
[766]1775cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_t_dyn, zx_tmp_3d)
1776      CALL histwrite_phy(nid_mth,"dtdyn",itau_w,d_t_dyn)
[644]1777c
[766]1778cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_q_dyn, zx_tmp_3d)
1779      CALL histwrite_phy(nid_mth,"dqdyn",itau_w,d_q_dyn)
[644]1780c
1781cIM: 101003 : K/30min ==> K/s
1782c
1783      zx_tmp_fi3d(1:klon,1:klev)=d_q_con(1:klon,1:klev)/pdtphys
[766]1784cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
1785      CALL histwrite_phy(nid_mth,"dqcon",itau_w,zx_tmp_fi3d)
[644]1786c
1787cIM: 101003 : K/30min ==> K/s
1788      zx_tmp_fi3d(1:klon, 1:klev)=(d_t_lsc(1:klon,1:klev)+
1789     .                             d_t_eva(1:klon,1:klev))/pdtphys
[766]1790cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, zx_tmp_fi3d, zx_tmp_3d)
1791      CALL histwrite_phy(nid_mth,"dtlschr",itau_w,zx_tmp_fi3d)
[644]1792c
1793      zx_tmp_fi3d(1:klon,1:klev)=d_q_lsc(1:klon,1:klev)/pdtphys
[766]1794cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
1795      CALL histwrite_phy(nid_mth,"dqlsc",itau_w,zx_tmp_fi3d)
[644]1796c
1797cIM: 101003 : K/30min ==> K/s
1798      zx_tmp_fi3d(1:klon,1:klev)=d_t_vdf(1:klon,1:klev)/pdtphys
[766]1799cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
1800      CALL histwrite_phy(nid_mth,"dtvdf",itau_w,zx_tmp_fi3d)
[644]1801c
1802      zx_tmp_fi3d(1:klon,1:klev)=d_q_vdf(1:klon,1:klev)/pdtphys
[766]1803cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
1804      CALL histwrite_phy(nid_mth,"dqvdf",itau_w,zx_tmp_fi3d)
[644]1805c
1806cIM: 101003 : K/30min ==> K/s
1807      zx_tmp_fi3d(1:klon,1:klev)=d_t_eva(1:klon,1:klev)/pdtphys
[766]1808cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
1809      CALL histwrite_phy(nid_mth,"dteva",itau_w,zx_tmp_fi3d)
[644]1810c
1811      zx_tmp_fi3d(1:klon,1:klev)=d_q_eva(1:klon,1:klev)/pdtphys
[766]1812cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
1813      CALL histwrite_phy(nid_mth,"dqeva",itau_w,zx_tmp_fi3d)
[644]1814c
1815      zpt_conv = 0.
1816      where (ptconv) zpt_conv = 1.
[766]1817cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, zpt_conv, zx_tmp_3d)
1818      CALL histwrite_phy(nid_mth,"ptconv",itau_w,zpt_conv)
[644]1819c
[766]1820cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1, ratqs, zx_tmp_3d)
1821      CALL histwrite_phy(nid_mth,"ratqs",itau_w,ratqs)
[878]1822cIM: 101003 : K/30min ==> K/s
1823      zx_tmp_fi3d(1:klon,1:klev)=d_t_ajsb(1:klon,1:klev)/pdtphys
1824cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
1825      CALL histwrite_phy(nid_mth,"dtajs",itau_w,zx_tmp_fi3d)
[644]1826c
[878]1827      zx_tmp_fi3d(1:klon,1:klev)=d_q_ajsb(1:klon,1:klev)/pdtphys
[766]1828cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
1829      CALL histwrite_phy(nid_mth,"dqajs",itau_w,zx_tmp_fi3d)
[644]1830c
[878]1831cIM: 101003 : K/30min ==> K/s
1832c
1833      zx_tmp_fi3d(1:klon,1:klev)=d_q_ajs(1:klon,1:klev)/pdtphys
1834cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
1835      CALL histwrite_phy(nid_mth,"dqthe",itau_w,zx_tmp_fi3d)
1836c
1837c
[644]1838cIM: 101003 : K/day ==> K/s
1839      zx_tmp_fi3d(1:klon,1:klev)=heat(1:klon,1:klev)/RDAY
[766]1840cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
1841      CALL histwrite_phy(nid_mth,"dtswr",itau_w,zx_tmp_fi3d)
[644]1842c
1843cIM: 101003 : K/day ==> K/s     
1844      zx_tmp_fi3d(1:klon,1:klev)=heat0(1:klon,1:klev)/RDAY
[766]1845cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
1846      CALL histwrite_phy(nid_mth,"dtsw0",itau_w,zx_tmp_fi3d)
[644]1847c
1848cIM: 101003 : K/day ==> K/s     
1849      zx_tmp_fi3d(1:klon,1:klev)=-1.*cool(1:klon,1:klev)/RDAY
[766]1850cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
1851      CALL histwrite_phy(nid_mth,"dtlwr",itau_w,zx_tmp_fi3d)
[644]1852c
1853cIM: 101003 : K/day ==> K/s     
1854      zx_tmp_fi3d(1:klon,1:klev)=-1.*cool0(1:klon,1:klev)/RDAY
[766]1855cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
1856      CALL histwrite_phy(nid_mth,"dtlw0",itau_w,zx_tmp_fi3d)
[644]1857c
1858cIM: 101003 : deja en K/s     
1859      zx_tmp_fi3d(1:klon,1:klev)=d_t_ec(1:klon,1:klev)
[766]1860cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
1861      CALL histwrite_phy(nid_mth,"dtec",itau_w,zx_tmp_fi3d)
[644]1862c
1863      zx_tmp_fi3d(1:klon,1:klev)=d_u_vdf(1:klon,1:klev)/pdtphys
[766]1864cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
1865      CALL histwrite_phy(nid_mth,"duvdf",itau_w,zx_tmp_fi3d)
[644]1866c
1867      zx_tmp_fi3d(1:klon,1:klev)=d_v_vdf(1:klon,1:klev)/pdtphys
[766]1868cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
1869      CALL histwrite_phy(nid_mth,"dvvdf",itau_w,zx_tmp_fi3d)
[644]1870c
1871      IF (ok_orodr) THEN
1872      zx_tmp_fi3d(1:klon,1:klev)=d_u_oro(1:klon,1:klev)/pdtphys
[766]1873cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
1874      CALL histwrite_phy(nid_mth,"duoro",itau_w,zx_tmp_fi3d)
[644]1875c
1876      zx_tmp_fi3d(1:klon,1:klev)=d_v_oro(1:klon,1:klev)/pdtphys
[766]1877cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
1878      CALL histwrite_phy(nid_mth,"dvoro",itau_w,zx_tmp_fi3d)
[644]1879c
1880      ENDIF
1881C
1882      IF (ok_orolf) THEN
1883      zx_tmp_fi3d(1:klon,1:klev)=d_u_lif(1:klon,1:klev)/pdtphys
[766]1884cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
1885      CALL histwrite_phy(nid_mth,"dulif",itau_w,zx_tmp_fi3d)
[644]1886c
1887      zx_tmp_fi3d(1:klon,1:klev)=d_v_lif(1:klon,1:klev)/pdtphys
[766]1888cym      CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d)
1889      CALL histwrite_phy(nid_mth,"dvlif",itau_w,zx_tmp_fi3d)
[644]1890      ENDIF
1891C
[864]1892#if defined(INCA_AER) && defined(CPP_COUPLE)
1893      CALL histwrite_phy(nid_mth,"tau",itau_w,cldtau)
1894      CALL histwrite_phy(nid_mth,"CCM1",itau_w,ccm(:,:,1))
1895      CALL histwrite_phy(nid_mth,"CCM2",itau_w,ccm(:,:,2))
1896      CALL histwrite_phy(nid_mth,"taupi",itau_w,cldtaupi)
1897      CALL histwrite_phy(nid_mth,"cldemi",itau_w,cldemi)
1898      CALL histwrite_phy(nid_mth,"SWTOAAS_ZERO",itau_w,topsw_inca(:,1))
1899      CALL histwrite_phy(nid_mth,"SWTOAAS_AER",itau_w,topsw_inca(:,2))
1900      CALL histwrite_phy(nid_mth,"SWTOAAS_NAT",itau_w,topsw_inca(:,3))
1901      CALL histwrite_phy(nid_mth,"SWTOAAS_AD",itau_w,topswad_inca(:))
1902      CALL histwrite_phy(nid_mth,"SWTOAAS_AI",itau_w,topswai_inca(:))
1903      CALL histwrite_phy(nid_mth,"SWTOACS_ZERO",itau_w,topsw0_inca(:,1))
1904      CALL histwrite_phy(nid_mth,"SWTOACS_AER",itau_w,topsw0_inca(:,2))
1905      CALL histwrite_phy(nid_mth,"SWTOACS_AD",itau_w,topswad0_inca(:))
1906      CALL histwrite_phy(nid_mth,"SWTOACS_NAT",itau_w,topsw0_inca(:,3))
1907#endif
1908#ifndef INCA
[524]1909      IF (nqmax.GE.3) THEN
[653]1910      DO iq=3,nqmax
[766]1911cym         CALL gr_fi_ecrit(klev,klon,iim,jjmp1, qx(1,1,iq), zx_tmp_3d)
1912         CALL histwrite_phy(nid_mth,tnom(iq),itau_w,qx(:,:,iq))
[524]1913      ENDDO
1914      ENDIF
[864]1915#endif
[524]1916c
1917      ENDIF !lev_histmth.GE.4
1918c
[644]1919      ENDIF !(type_run.EQ."AMIP")
1920c
[524]1921      if (ok_sync) then
[766]1922c$OMP MASTER
[524]1923        call histsync(nid_mth)
[766]1924c$OMP END MASTER
[524]1925      endif
[644]1926c
1927      ENDIF !ok_mensuel
Note: See TracBrowser for help on using the repository browser.