! ! $Header: /home/cvsroot/LMDZ4/libf/phylmd/write_histmth.h,v 1.2 2005/03/09 12:30:16 fairhead Exp $ ! IF (ok_mensuel) THEN c ndex2d = 0 ndex3d = 0 zx_tmp_2d = 0. zx_tmp_3d = 0. zx_tmp_fi2d=0. zx_tmp_fi3d=0. zsto = dtime zout = dtime * ecrit_mth itau_w = itau_phy + itap c c------------------------------------------------------- IF(lev_histmth.GE.1) THEN c ccccccccccccc 2D fields, basics c i = NINT(zout/zsto) CALL gr_fi_ecrit(1,klon,iim,jjmp1,pphis,zx_tmp_2d) CALL histwrite(nid_mth,"phis",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d) C i = NINT(zout/zsto) CALL gr_fi_ecrit(1,klon,iim,jjmp1,airephy,zx_tmp_2d) CALL histwrite(nid_mth,"aire",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d) c CALL gr_fi_ecrit(1, klon,iim,jjmp1, ftsol,zx_tmp_2d) CALL histwrite(nid_mth,"tsol",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d) c DO i = 1, klon zx_tmp_fi2d(i) = paprs(i,1) ENDDO CALL gr_fi_ecrit(1, klon,iim,jjmp1, zx_tmp_fi2d,zx_tmp_2d) CALL histwrite(nid_mth,"psol",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d) c c CALL gr_fi_ecrit(1, klon,iim,jjmp1, ue,zx_tmp_2d) c CALL histwrite(nid_mth,"ue",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d) c c CALL gr_fi_ecrit(1, klon,iim,jjmp1, ve,zx_tmp_2d) c VENUS: regardee a l'envers!!!!!!!!!!!!!!! c zx_tmp_2d=-1.*zx_tmp_2d c CALL histwrite(nid_mth,"ve",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d) c CALL gr_fi_ecrit(1, klon,iim,jjmp1, cdragh,zx_tmp_2d) CALL histwrite(nid_mth,"cdragh",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d) c CALL gr_fi_ecrit(1, klon,iim,jjmp1, cdragm,zx_tmp_2d) CALL histwrite(nid_mth,"cdragm",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d) c ENDIF !lev_histmth.GE.1 c c------------------------------------------------------- IF(lev_histmth.GE.2) THEN c ccccccccccccc 3D fields, basics c CALL gr_fi_ecrit(klev,klon,iim,jjmp1, t_seri, zx_tmp_3d) CALL histwrite(nid_mth,"temp",itau_w,zx_tmp_3d, . iim*jjmp1*klev,ndex3d) c CALL gr_fi_ecrit(klev,klon,iim,jjmp1, pplay, zx_tmp_3d) CALL histwrite(nid_mth,"pres",itau_w,zx_tmp_3d, . iim*jjmp1*klev,ndex3d) c CALL gr_fi_ecrit(klev,klon,iim,jjmp1, zphi, zx_tmp_3d) CALL histwrite(nid_mth,"geop",itau_w,zx_tmp_3d, . iim*jjmp1*klev,ndex3d) c CALL gr_fi_ecrit(klev,klon,iim,jjmp1, u_seri, zx_tmp_3d) CALL histwrite(nid_mth,"vitu",itau_w,zx_tmp_3d, . iim*jjmp1*klev,ndex3d) c CALL gr_fi_ecrit(klev,klon,iim,jjmp1, v_seri, zx_tmp_3d) c VENUS: regardee a l'envers!!!!!!!!!!!!!!! zx_tmp_3d=-1.*zx_tmp_3d CALL histwrite(nid_mth,"vitv",itau_w,zx_tmp_3d, . iim*jjmp1*klev,ndex3d) c CALL gr_fi_ecrit(klev,klon,iim,jjmp1, omega, zx_tmp_3d) CALL histwrite(nid_mth,"vitw",itau_w,zx_tmp_3d, . iim*jjmp1*klev,ndex3d) c c en (m/s)/s CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_u_dyn, zx_tmp_3d) CALL histwrite(nid_mth,"dudyn",itau_w,zx_tmp_3d, . iim*jjmp1*klev,ndex3d) c c en (m/s)/s CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_u_vdf, zx_tmp_3d) CALL histwrite(nid_mth,"duvdf",itau_w,zx_tmp_3d, . iim*jjmp1*klev,ndex3d) c c CALL gr_fi_ecrit(klev,klon,iim,jjmp1, mang, zx_tmp_3d) c CALL histwrite(nid_mth,"mang",itau_w,zx_tmp_3d, c . iim*jjmp1*klev,ndex3d) c CALL gr_fi_ecrit(klev,klon,iim,jjmp1, ycoefh, zx_tmp_3d) CALL histwrite(nid_mth,"Kz",itau_w,zx_tmp_3d, . iim*jjmp1*klev,ndex3d) c c plusieurs traceurs IF (iflag_trac.eq.1) THEN DO iq=1,nqmax IF (iq.LE.99) THEN CALL gr_fi_ecrit(klev,klon,iim,jjmp1, qx(1,1,iq), zx_tmp_3d) WRITE(str2,'(i2.2)') iq CALL histwrite(nid_mth,tname(iq),itau_w,zx_tmp_3d, . iim*jjmp1*klev,ndex3d) ELSE PRINT*, "Trop de traceurs" CALL abort ENDIF ENDDO ENDIF c CALL gr_fi_ecrit(1, klon,iim,jjmp1, topsw,zx_tmp_2d) CALL histwrite(nid_mth,"tops",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d) c ENDIF !lev_histmth.GE.2 c c------------------------------------------------------- IF(lev_histmth.GE.3) THEN c cccccccccccccccccc Radiative transfer c c 2D c CALL gr_fi_ecrit(1, klon,iim,jjmp1, toplw,zx_tmp_2d) CALL histwrite(nid_mth,"topl",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d) c CALL gr_fi_ecrit(1, klon,iim,jjmp1, solsw,zx_tmp_2d) CALL histwrite(nid_mth,"sols",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d) c CALL gr_fi_ecrit(1, klon,iim,jjmp1, sollw,zx_tmp_2d) CALL histwrite(nid_mth,"soll",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d) c c 3D c zx_tmp_fi3d(1:klon,1:klev)=swnet(1:klon,1:klev) CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) CALL histwrite(nid_mth,"SWnet",itau_w,zx_tmp_3d, . iim*jjmp1*klev,ndex3d) c zx_tmp_fi3d(1:klon,1:klev)=lwnet(1:klon,1:klev) CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) CALL histwrite(nid_mth,"LWnet",itau_w,zx_tmp_3d, . iim*jjmp1*klev,ndex3d) c zx_tmp_fi3d(1:klon,1:klev)=fluxt(1:klon,1:klev) CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) CALL histwrite(nid_mth,"fluxvdf",itau_w,zx_tmp_3d, . iim*jjmp1*klev,ndex3d) c zx_tmp_fi3d(1:klon,1:klev)=flux_dyn(1:klon,1:klev) CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) CALL histwrite(nid_mth,"fluxdyn",itau_w,zx_tmp_3d, . iim*jjmp1*klev,ndex3d) c zx_tmp_fi3d(1:klon,1:klev)=flux_ajs(1:klon,1:klev) CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) CALL histwrite(nid_mth,"fluxajs",itau_w,zx_tmp_3d, . iim*jjmp1*klev,ndex3d) c c zx_tmp_fi3d(1:klon,1:klev)=flux_ec(1:klon,1:klev) c CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) c CALL histwrite(nid_mth,"fluxec",itau_w,zx_tmp_3d, c . iim*jjmp1*klev,ndex3d) c ENDIF !lev_histmth.GE.3 c c------------------------------------------------------- IF(lev_histmth.GE.4) THEN c c en K/s CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_t_dyn, zx_tmp_3d) CALL histwrite(nid_mth,"dtdyn",itau_w,zx_tmp_3d, . iim*jjmp1*klev,ndex3d) c c en K/s c CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_t, zx_tmp_3d) c CALL histwrite(nid_mth,"dtphy",itau_w,zx_tmp_3d, c . iim*jjmp1*klev,ndex3d) c c en K/s CALL gr_fi_ecrit(klev,klon,iim,jjmp1,d_t_vdf,zx_tmp_3d) CALL histwrite(nid_mth,"dtvdf",itau_w,zx_tmp_3d, . iim*jjmp1*klev,ndex3d) c c en K/s CALL gr_fi_ecrit(klev,klon,iim,jjmp1,d_t_ajs,zx_tmp_3d) CALL histwrite(nid_mth,"dtajs",itau_w,zx_tmp_3d, . iim*jjmp1*klev,ndex3d) c c K/day ==> K/s zx_tmp_fi3d(1:klon,1:klev)=heat(1:klon,1:klev)/RDAY CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) CALL histwrite(nid_mth,"dtswr",itau_w,zx_tmp_3d, . iim*jjmp1*klev,ndex3d) c c K/day ==> K/s zx_tmp_fi3d(1:klon,1:klev)=-1.*cool(1:klon,1:klev)/RDAY CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) CALL histwrite(nid_mth,"dtlwr",itau_w,zx_tmp_3d, . iim*jjmp1*klev,ndex3d) c en K/s c zx_tmp_fi3d(1:klon,1:klev)=d_t_ec(1:klon,1:klev) c CALL gr_fi_ecrit(klev,klon,iim,jjmp1,zx_tmp_fi3d,zx_tmp_3d) c CALL histwrite(nid_mth,"dtec",itau_w,zx_tmp_3d, c . iim*jjmp1*klev,ndex3d) c c en (m/s)/s CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_u_ajs, zx_tmp_3d) CALL histwrite(nid_mth,"duajs",itau_w,zx_tmp_3d, . iim*jjmp1*klev,ndex3d) c c en (m/s)/s CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_u_oro, zx_tmp_3d) CALL histwrite(nid_mth,"dugwo",itau_w,zx_tmp_3d, . iim*jjmp1*klev,ndex3d) c c en (m/s)/s CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_u_hin, zx_tmp_3d) CALL histwrite(nid_mth,"dugwno",itau_w,zx_tmp_3d, . iim*jjmp1*klev,ndex3d) c c en (m/s)/s c CALL gr_fi_ecrit(klev,klon,iim,jjmp1, d_v_vdf, zx_tmp_3d) c VENUS: regardee a l'envers!!!!!!!!!!!!!!! c zx_tmp_3d=-1.*zx_tmp_3d c CALL histwrite(nid_mth,"dvvdf",itau_w,zx_tmp_3d, c . iim*jjmp1*klev,ndex3d) c ENDIF !lev_histmth.GE.4 c c------------------------------------------------------- IF(lev_histmth.GE.5) THEN c c c CALL gr_fi_ecrit(1, klon,iim,jjmp1, fluxu , zx_tmp_2d) c CALL histwrite(nid_mth,"taux_",itau_w, c $ zx_tmp_2d,iim*jjmp1,ndex2d) c c CALL gr_fi_ecrit(1, klon,iim,jjmp1, fluxv , zx_tmp_2d) c CALL histwrite(nid_mth,"tauy_",itau_w, c $ zx_tmp_2d,iim*jjmp1,ndex2d) c c CALL gr_fi_ecrit(1, klon,iim,jjmp1, cdragm,zx_tmp_2d) c CALL histwrite(nid_mth,"cdrm",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d) c c CALL gr_fi_ecrit(1, klon,iim,jjmp1, cdragh,zx_tmp_2d) c CALL histwrite(nid_mth,"cdrh",itau_w,zx_tmp_2d,iim*jjmp1,ndex2d) c ENDIF !lev_histmth.GE.5 c------------------------------------------------------- c if (ok_sync) then call histsync(nid_mth) endif ENDIF