登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
这个总结的前提是:我对HYSPLIT和MeteoInfo一窍不通,所以完全按照气象家园的帖子去操作,可是又发现有些讲解并不清楚,讨论结果跟HYSPLIT官网中的操作过程又略有不同,然而我也没有任何人可以给予程序或者指导,于是就写下来摸索得到的我运作的流程。
(1) 安装HYSPLIT及相关组件: 按照官网的流程安装,因为害怕装不对,我都装在C盘了。 在打开HYSPLIT软件的时候,选择应用程序,用C:\tcl\bin\wish86t.exe才可以打开 (2) 安装MeteoInfo 因为官网打不开,下载MeteoInfo是在QQ群里面下载的,QQ群号为361327727:解压后即可以使用 下载后根据气象家园的帖子: 打开MeteoInfoLab,然后把脚本粘贴到第一个格子里面去,然后点击最上面的小三角,运行。路径不可以包含中文。 将wrfout转换为arl格式的py程序如下: #-------------------------------------------------------- # Author: Yaqiang Wang # Date: 2015-12-2 # Purpose: Convert WRF out netCDF data to ARL data # Note: Sample #----------------------------------------------------------- #---- Set data folder datadir = 'E:/' #---- Set output data file outfn = os.path.join(datadir, 'test_wrfout1.arl') if os.path.exists(outfn): os.remove(outfn) #---- Read a netCDF data file infn = os.path.join(datadir, 'd0120161216.nc') print infn inf = addfile(infn) print 'NetCDF file has been opened...' #---- Set output ARL data file arlf = addfile(outfn, 'c', dtype='arl') #---- Set variable and level list wvar2d = ['HGT','PSFC','PBLH','UST','SWDOWN','HFX','LH','T2','U10','V10','RAINNC'] wvar3d = ['P','T','U','V','W','QVAPOR'] avar2d =['SHGT','PRSS','PBLH','USTR','DSWF','SHTF','LHTF','T02M','U10M','V10M','TPPA'] avar3d = ['PRES','TEMP','UWND','VWND','WWND','SPHU'] wv = inf['P'] nx = wv.dimlen(wv.ndim - 1) ny = wv.dimlen(wv.ndim - 2) levels = wv.dimvalue(wv.ndim - 3) nz = len(levels) arlf.setlevels(levels) arlf.set2dvar(avar2d) for l in levels: arlf.set3dvar(avar3d) #---- Constant for poisson's equation cp = 1004.0 # J/kg/K; specific heat grav = 9.81 # m/s**2; gravity rdry = 287.04 # J/kg/K; gas constant rovcp = rdry / cp # constant for poisson's equation #---- Write ARL data file arlf.setx(wv.dimvalue(wv.ndim - 1)) arlf.sety(wv.dimvalue(wv.ndim - 2)) tNum = inf.timenum() fhour = 0 for t in range(0, tNum): print 'Timeindex: ' + str(t) atime =inf.gettime(t) printatime.strftime('%Y-%m-%d %H:00') dhead =arlf.getdatahead(inf.proj, 'AWRF', 1, fhour) #Pre-writeindex record without checksum - will be over-write latter arlf.writeindexrec(atime, dhead) #Checksum list ksumlist = [] # Write 2dvariables ksums = [] foravname,wvname in zip(avar2d, wvar2d): #printavname + ' ' + wvname gdata =inf[wvname][t,:,:] if avname== 'PRSS': gdata =gdata * 0.01 elif avname== 'TPPA': gdata =gdata * 0.001 ksum =arlf.writedatarec(atime, 0, avname, fhour, 99, gdata) ksums.append(ksum) ksumlist.append(ksums) # Write 3dvariables for lidx inrange(0, nz): ksums = [] #print lidx pp =inf['P'][t,lidx,:,:] pb =inf['PB'][t,lidx,:,:] pres = pp +pb uwnd =inf['U'][t,lidx,:,:] vwnd =inf['V'][t,lidx,:,:] temp =inf['T'][t,lidx,:,:] #potentialto ambient temperature temp =(temp + 300.) * (pres / 100000.) ** rovcp sphu = inf['QVAPOR'][t,lidx,:,:] wwnd =inf['W'][t,lidx+1,:,:] #convertvertical velocity from m/s to hPa/s using omega = -W g rho wwnd =-wwnd * grav * pres * 0.01 / (rdry * temp * (1.0 + 0.6077 * sphu)) pres = pres* 0.01 ksum = arlf.writedatarec(atime, lidx +1, 'PRES', fhour, 99, pres) ksums.append(ksum) ksum =arlf.writedatarec(atime, lidx + 1, 'TEMP', fhour, 99, temp) ksums.append(ksum) ksum =arlf.writedatarec(atime, lidx + 1, 'UWND', fhour, 99, uwnd[:,:nx]) ksums.append(ksum) ksum =arlf.writedatarec(atime, lidx + 1, 'VWND', fhour, 99, vwnd[:ny,:]) ksums.append(ksum) ksum =arlf.writedatarec(atime, lidx + 1, 'WWND', fhour, 99, wwnd) ksums.append(ksum) ksum =arlf.writedatarec(atime, lidx + 1, 'SPHU', fhour, 99, sphu) ksums.append(ksum) ksumlist.append(ksums) #Re-write indexrecord with checksum arlf.writeindexrec(atime, dhead, ksumlist) fhour += 6 arlf.close() print 'Finished!' (3) HYSPLIT运行 在Trajectory中选择Setup run,Add meteorologyfiles中选择导出的arl文件即可
如果有人不嫌弃我白痴,我就继续把后面的学习过程也写下去。
|