source: LMDZ4/trunk/libf/phylmd/write_histhf.h @ 1085

Last change on this file since 1085 was 996, checked in by lsce, 16 years ago
  • Modifications liées au calcul des nouveau sous-fractions
  • Nettoyage de ocean slab : il reste uniquement la version avec glace de mer forcé
  • Nouveaux variables pour distiguer la version et type d'ocean : type_ocean=force/slab/couple, version_ocean=opa8/nemo pour couplé ou version_ocean=sicOBS pour slab

JG

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 11.1 KB
RevLine 
[524]1!
2! $Header$
3!
4      if (ok_hf) then
5
6c
7      ndex2d = 0
8      ndex3d = 0
9c
10      itau_w = itau_phy + itap
11c
[644]12      IF(type_run.EQ."CLIM".OR.type_run.EQ."ENSP") THEN
13c
[524]14      IF(lev_histhf.GE.1) THEN
15c
[766]16cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, paire_ter, zx_tmp_2d)
17      CALL histwrite_phy(nid_hf,"aireTER",itau_w,paire_ter)
[524]18c
19      DO i=1, klon
20       zx_tmp_fi2d(i)=pctsrf(i,is_ter)+pctsrf(i,is_lic)
21      ENDDO
22c
[766]23cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d, zx_tmp_2d)
24      CALL histwrite_phy(nid_hf,"contfracATM",itau_w,zx_tmp_fi2d)
[524]25c
[996]26cym      CALL gr_fi_ecrit(1,klon,iim,jjmp1,pctsrf(:,is_ter),zx_tmp_2d)
[766]27      CALL histwrite_phy(nid_hf,"contfracOR",itau_w,
[996]28     .                   pctsrf(:,is_ter))
[524]29c
[766]30cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zt2m,zx_tmp_2d)
31      CALL histwrite_phy(nid_hf,"t2m",itau_w,zt2m)
[524]32c
[766]33cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zq2m,zx_tmp_2d)
34      CALL histwrite_phy(nid_hf,"q2m",itau_w,zq2m)
[524]35c
36      DO i = 1, klon
37         zx_tmp_fi2d(i) = paprs(i,1)
38      ENDDO
[766]39cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
40      CALL histwrite_phy(nid_hf,"psol",itau_w,zx_tmp_fi2d)
[524]41c
42      DO i = 1, klon
43         zx_tmp_fi2d(i) = rain_fall(i) + snow_fall(i)
44      ENDDO
[766]45cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
46      CALL histwrite_phy(nid_hf,"precip",itau_w,zx_tmp_fi2d)
[524]47c
48c ENSEMBLES BEG
[766]49cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zxtsol,zx_tmp_2d)
50      CALL histwrite_phy(nid_hf,"tsol",itau_w,zxtsol)
[524]51c
[766]52cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, slp,zx_tmp_2d)
53      CALL histwrite_phy(nid_hf,"slp",itau_w,slp)
[524]54c
[766]55cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zu10m,zx_tmp_2d)
56      CALL histwrite_phy(nid_hf,"u10m",itau_w,zu10m)
[644]57c
[766]58cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zv10m,zx_tmp_2d)
59      CALL histwrite_phy(nid_hf,"v10m",itau_w,zv10m)
[524]60c
61      DO i=1, klon
62       zx_tmp_fi2d(i)=SQRT(zu10m(i)*zu10m(i)+zv10m(i)*zv10m(i))
63      ENDDO
[766]64cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
65      CALL histwrite_phy(nid_hf,"wind10m",itau_w,zx_tmp_fi2d)
[524]66c
[644]67      DO k=1, nlevSTD
68c
69c        bb=clevSTD(k)
70c
71c        IF(k.GE.2) THEN
72         IF(k.GE.2.AND.k.LE.12) bb2=clevSTD(k)
73         IF(k.GE.13.AND.k.LE.17) bb3=clevSTD(k)
74c         aa=clevSTD(k)
75c         bb=aa(1:lnblnk1(aa))
76c        ENDIF
77c
78      IF(bb2.EQ."500") THEN
79c
[766]80cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, philevSTD(:,k),zx_tmp_2d)
81      CALL histwrite_phy(nid_hf,"phi"//bb2,itau_w, philevSTD(:,k))
[644]82      ENDIF !bb2.EQ."500"
[524]83      ENDDO
84c
85      ENDIF !lev_histhf.GE.1
86c
87      IF(lev_histhf.GE.2) THEN
88c
[644]89cIM 140904 BEG
90      DO i = 1, klon
91         zx_tmp_fi2d(i) = cldt(i)*100.
92      ENDDO
93cIM 140904 END
94cIM 140904   CALL gr_fi_ecrit(1, klon,iim,jjmp1, cldt,zx_tmp_2d)
[766]95cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1,zx_tmp_fi2d,zx_tmp_2d)
96      CALL histwrite_phy(nid_hf,"cldt",itau_w,zx_tmp_fi2d)
[524]97c
98      zx_tmp_fi2d(1 : klon) = fsolsw( 1 : klon, is_ter)
[766]99cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
100      CALL histwrite_phy(nid_hf,"SWnetOR",itau_w, zx_tmp_fi2d)
[591]101c
[888]102      zx_tmp_fi2d(1:klon) = solsw(1:klon)/(1.-albsol1(1:klon))
[766]103cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d, zx_tmp_2d)
104      CALL histwrite_phy(nid_hf,"SWdownOR",itau_w, zx_tmp_fi2d)
[524]105c
[766]106cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, sollwdown,zx_tmp_2d)
107      CALL histwrite_phy(nid_hf,"LWdownOR",itau_w,sollwdown) 
[524]108c
109c
110      ENDIF !lev_histhf.GE.2
111c
112      IF(lev_histhf.GE.3) THEN
113c
[644]114      DO k=1, nlevSTD
[524]115c
[644]116c        bb=clevSTD(k)
[524]117c
[644]118c        IF(k.GE.2) THEN
119         IF(k.GE.2.AND.k.LE.12) bb2=clevSTD(k)
120         IF(k.GE.13.AND.k.LE.17) bb3=clevSTD(k)
121c         aa=clevSTD(k)
122c         bb=aa(1:lnblnk1(aa))
123c        ENDIF
124c
125      IF(bb2.EQ."850".OR.bb2.EQ."700".OR.
126     $   bb2.EQ."500".OR.bb2.EQ."200") THEN
127c
[766]128cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, tlevSTD(:,k),zx_tmp_2d)
129      CALL histwrite_phy(nid_hf,"t"//bb2,itau_w, tlevSTD(:,k))
[524]130c
[644]131      IF(bb2.NE."500") THEN !bb2.NE."500"
132c
[766]133cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1,philevSTD(:,k),zx_tmp_2d)
134      CALL histwrite_phy(nid_hf,"phi"//bb2,itau_w,philevSTD(:,k))
[644]135      ENDIF !bb2.NE."500"
[524]136c
[766]137cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, qlevSTD(:,k),zx_tmp_2d)
138      CALL histwrite_phy(nid_hf,"q"//bb2,itau_w, qlevSTD(:,k))
[524]139c
[766]140cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, ulevSTD(:,k),zx_tmp_2d)
141      CALL histwrite_phy(nid_hf,"u"//bb2,itau_w,ulevSTD(:,k))
[524]142c
[766]143cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, vlevSTD(:,k),zx_tmp_2d)
144      CALL histwrite_phy(nid_hf,"v"//bb2,itau_w, vlevSTD(:,k))
[524]145c
[644]146      ENDIF !bb2.EQ."850".OR.bb2.EQ."700"
[524]147      ENDDO !nlevENS
148c
149      IF(1.EQ.0) THEN
[766]150cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, cdragm,zx_tmp_2d)
151      CALL histwrite_phy(nid_hf,"cdrm",itau_w,cdragm)
[524]152c
[766]153cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, cdragh,zx_tmp_2d)
154      CALL histwrite_phy(nid_hf,"cdrh",itau_w,cdragh)
[524]155      ENDIF !(1.EQ.0) THEN
156c
[591]157      ENDIF !lev_histhf.GE.3
158c
159      IF(lev_histhf.GE.4) THEN
160c
[644]161#undef histhf3d
[591]162#define histhf3d
163#ifdef histhf3d
164#include "write_histhf3d.h"
165#endif
166c
167      ENDIF !lev_histhf.GE.4
168c
[644]169      ELSE IF(type_run.EQ."AMIP".OR.type_run.EQ."CFMI") THEN
170c
171      IF(lev_histhf.GE.1) THEN
172c
173      DO k=1, nlevSTD
174c        bb=clevSTD(k)
175c
176c        IF(k.GE.2) THEN
177         IF(k.GE.2.AND.k.LE.12) bb2=clevSTD(k)
178         IF(k.GE.13.AND.k.LE.17) bb3=clevSTD(k)
179c         aa=clevSTD(k)
180c         bb=aa(1:lnblnk1(aa))
181c        ENDIF
182c
183        IF(bb2.EQ."850".or.bb2.EQ."200") THEN
184c
[766]185cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1, ulevSTD(:,k),zx_tmp_2d)
186        CALL histwrite_phy(nid_hf,"u"//bb2,itau_w,ulevSTD(:,k))
[644]187c
[766]188cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1, vlevSTD(:,k),zx_tmp_2d)
189        CALL histwrite_phy(nid_hf,"v"//bb2,itau_w,vlevSTD(:,k))
[644]190c
191        ENDIF !bb2.EQ."850".or.bb2.EQ."200"
192c
193      ENDDO !nlevSTD
194c
[766]195cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, toplw,zx_tmp_2d)
196      CALL histwrite_phy(nid_hf,"topl",itau_w,toplw)
[644]197c
198      DO i = 1, klon
199         zx_tmp_fi2d(i) = rain_fall(i) + snow_fall(i)
200      ENDDO
[766]201cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
202      CALL histwrite_phy(nid_hf,"precip",itau_w,zx_tmp_fi2d)
[644]203c
[766]204cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, slp,zx_tmp_2d)
205      CALL histwrite_phy(nid_hf,"slp",itau_w,slp)
[644]206c
207cIM 280504 BEG
208      ENDIF !(lev_histhf.GE.1) THEN
209c
210      IF(lev_histhf.GE.2) THEN
211c
212       DO k=1, nlevSTD
213c
214c        bb=clevSTD(k)
215c
216c        IF(k.GE.2) THEN
217         IF(k.GE.2.AND.k.LE.12) bb2=clevSTD(k)
218         IF(k.GE.13.AND.k.LE.17) bb3=clevSTD(k)
219c         aa=clevSTD(k)
220c         bb=aa(1:lnblnk1(aa))
221c        ENDIF
222c
223        IF(bb2.EQ."850".or.bb2.EQ."500") THEN
224c
[766]225cym         CALL gr_fi_ecrit(1, klon,iim,jjmp1, tlevSTD(:,k),zx_tmp_2d)
226         CALL histwrite_phy(nid_hf,"t"//bb2,itau_w,tlevSTD(:,k))
[644]227c
[766]228cym         CALL gr_fi_ecrit(1, klon,iim,jjmp1, qlevSTD(:,k),zx_tmp_2d)
229         CALL histwrite_phy(nid_hf,"q"//bb2,itau_w, qlevSTD(:,k))
[644]230c
231        ENDIF !bb2.EQ."850".or.bb2.EQ."500"
232c
233        IF(bb2.EQ."500") THEN
234c
[766]235cym         CALL gr_fi_ecrit(1, klon,iim,jjmp1, philevSTD(:,k),zx_tmp_2d)
236         CALL histwrite_phy(nid_hf,"phi"//bb2,itau_w, philevSTD(:,k))
[644]237c
[766]238cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1, wlevSTD(:,k),zx_tmp_2d)
239        CALL histwrite_phy(nid_hf,"w"//bb2,itau_w, wlevSTD(:,k))
[644]240c
241        ENDIF !bb2.EQ."500"
242c
243        IF(bb3.EQ."50") THEN
244c
[766]245cym         CALL gr_fi_ecrit(1, klon,iim,jjmp1, tlevSTD(:,k),zx_tmp_2d)
246         CALL histwrite_phy(nid_hf,"t"//bb3,itau_w, tlevSTD(:,k))
[644]247c
[766]248cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1, ulevSTD(:,k),zx_tmp_2d)
249        CALL histwrite_phy(nid_hf,"u"//bb3,itau_w, ulevSTD(:,k))
[644]250c
[766]251cym        CALL gr_fi_ecrit(1, klon,iim,jjmp1, vlevSTD(:,k),zx_tmp_2d)
252        CALL histwrite_phy(nid_hf,"v"//bb3,itau_w, vlevSTD(:,k))
[644]253c
254        ENDIF !bb3.EQ."50"
255c
256       ENDDO !k=1, nlevSTD
257c
[766]258cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zu10m,zx_tmp_2d)
259      CALL histwrite_phy(nid_hf,"u10m",itau_w,zu10m)
[644]260c
[766]261cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zv10m,zx_tmp_2d)
262      CALL histwrite_phy(nid_hf,"v10m",itau_w,zv10m)
[644]263c
[766]264cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zt2m,zx_tmp_2d)
265      CALL histwrite_phy(nid_hf,"t2m",itau_w, zt2m)
[644]266c
[766]267cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zq2m,zx_tmp_2d)
268      CALL histwrite_phy(nid_hf,"q2m",itau_w,zq2m)
[644]269c
270      DO i = 1, klon
271         zx_tmp_fi2d(i) = paprs(i,1)
272      ENDDO
[766]273cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
274      CALL histwrite_phy(nid_hf,"psol",itau_w,zx_tmp_fi2d)
[644]275c
276cIM 140904 BEG
277      DO i = 1, klon
278         zx_tmp_fi2d(i) = cldt(i)*100.
279      ENDDO
280cIM 140904 END
281cIM 140904   CALL gr_fi_ecrit(1, klon,iim,jjmp1, cldt,zx_tmp_2d)
[766]282cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1,zx_tmp_fi2d,zx_tmp_2d)
283      CALL histwrite_phy(nid_hf,"cldt",itau_w,zx_tmp_fi2d)
[644]284c
285      zx_tmp_fi2d(1 : klon) = zxfluxu(1 : klon, 1)
[766]286cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
287      CALL histwrite_phy(nid_hf,"taux",itau_w,zx_tmp_fi2d)
[644]288C
289      zx_tmp_fi2d(1 : klon) = zxfluxv(1 : klon, 1)
[766]290cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d , zx_tmp_2d)
291      CALL histwrite_phy(nid_hf,"tauy",itau_w,zx_tmp_fi2d)
[644]292c
[766]293cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, prw,zx_tmp_2d)
294      CALL histwrite_phy(nid_hf,"prw",itau_w,prw)
[644]295c
296      zx_tmp_fi2d(1:klon)=-1*sens(1:klon)
[766]297cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d)
298      CALL histwrite_phy(nid_hf,"sens",itau_w,zx_tmp_fi2d)
[644]299c
[766]300cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zxfluxlat,zx_tmp_2d)
301      CALL histwrite_phy(nid_hf,"flat",itau_w,zxfluxlat)
[644]302c
303c     CALL gr_fi_ecrit(1, klon,iim,jjmp1, zsnow_mass,zx_tmp_2d)
[766]304c     CALL histwrite_phy(nid_hf,"snow_mass",itau_w,zsnow_mass)
[644]305c
306      zx_tmp_fi2d(1 : klon) = swdn ( 1 : klon, 1 )
[766]307cym      CALL gr_fi_ecrit(1,klon,iim,jjmp1,zx_tmp_fi2d,zx_tmp_2d)
308      CALL histwrite_phy(nid_hf, "SWdnSFC",itau_w,zx_tmp_fi2d)
[644]309c
310      zx_tmp_fi2d(1 : klon) = swup ( 1 : klon, 1 )
[766]311cym      CALL gr_fi_ecrit(1,klon,iim,jjmp1,zx_tmp_fi2d,zx_tmp_2d)
312      CALL histwrite_phy(nid_hf, "SWupSFC",itau_w,zx_tmp_fi2d)
[644]313c
[766]314cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, sollwdown,zx_tmp_2d)
315      CALL histwrite_phy(nid_hf,"LWdnSFC",itau_w,sollwdown)
[644]316c
317cIM 090904   zx_tmp_fi2d(1:klon)=sollw(1:klon)+sollwdown(1:klon)
318cIM 130904   zx_tmp_fi2d(1:klon)=sollw(1:klon)-sollwdown(1:klon)
319      zx_tmp_fi2d(1:klon)=sollwdown(1:klon)-sollw(1:klon)
[766]320cym      CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d, zx_tmp_2d)
321      CALL histwrite_phy(nid_hf,"LWupSFC",itau_w,zx_tmp_fi2d)                   
[644]322c
323      zx_tmp_fi2d(1 : klon) = swdn ( 1 : klon, klevp1 )
[766]324cym      CALL gr_fi_ecrit(1,klon,iim,jjmp1,zx_tmp_fi2d,zx_tmp_2d)
325      CALL histwrite_phy(nid_hf, "SWdnTOA",itau_w,zx_tmp_fi2d)
[644]326c
327      zx_tmp_fi2d(1 : klon) = swup ( 1 : klon, klevp1 )
[766]328cym      CALL gr_fi_ecrit(1,klon,iim,jjmp1,zx_tmp_fi2d,zx_tmp_2d)
329      CALL histwrite_phy(nid_hf, "SWupTOA",itau_w,zx_tmp_fi2d)
[644]330c
[776]331      IF (is_sequential) THEN
[766]332cym      CALL gr_fi_ecrit(nbteta,klon,iim,jjmp1,PVteta,zx_tmp_3dte)
[644]333      DO k=1, nbteta
[782]334       zx_tmp_fi2d(1:klon) = PVteta(1:klon,k)
[766]335       CALL histwrite_phy(nid_hf,"PV"//ctetaSTD(k),
[782]336     .      itau_w,zx_tmp_fi2d)
[644]337      ENDDO !k=1, nbteta
[766]338      ENDIF
[644]339c
340c
341c planetary boundary layer height
342c
343c     ENDIF !1.EQ.0
344c
345      ENDIF !(lev_histhf.GE.2) THEN
346cIM 280504 END
347c
348      ENDIF !type_run
349c
350      IF (ok_sync) THEN
[766]351c$OMP MASTER
[591]352        call histsync(nid_hf)
[766]353c$OMP END MASTER
[644]354      ENDIF
[591]355
[644]356      ENDIF
Note: See TracBrowser for help on using the repository browser.