- 积分
- 434
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-2-13
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
本帖最后由 天边的那边 于 2014-9-9 17:40 编辑
我想把数据写成nc格式的,不知道怎么写,向大家请教。这个是参照ncl手册写,出错了,不知道问题在哪begin
f=addfile("wrfinput_d01","r")
xlon =f->XLONG(0,:,:)
xlat = f->XLAT(0,:,:)
ff=asciiread("SEVP_CLI_CHN_PRE_DAY_GRID_0.25-20140826.asc",-1,"float")
x2=onedtond(ff(6:),(/144,256/))
x2@_FillValue = -999.00
nx=256
ny=144
rlat=new(ny,"float")
rlon=new(nx,"float")
rlon(0)=72.125
rlat(0)=18.125
do i=0,nx-1
rlon(i)=72.125+i*0.25
end do
do j=0,ny-1
rlat(j)=18.125+j*0.25
end do
x2!0="rlat"
x2!1="rlon"
x2&rlat=rlat(:)
x2&rlon=rlon(:)
wrf_tem=rgrid2rcm(x2&rlat,x2&rlon,x2,lat,lon,0)
rain=addfile("raintest.nc","c")
fileAtt = True
fileAtt@title = "raintogrid"
fileAtt@Conventions = "None"
fileAtt@creation_date = systemfunc("date")
fileattdef(rain,fileAtt)
dimNames = (/"time","lat","lon"/)
dimSizes = (/-1,ny,nx/)
dimUnlim = (/True,False,False/)
filedimdef(rain,dimNames,dimSizes,dimUnlim)
filevardef(rain,"time",typeof(time),getvardims(time))
filevardef(rain,"lat",typeof(lat),"lat")
filevardef(rain,"lon","float","lon")
filevardef(rain,"TMP",typeof(T),getvardims(T))
filevarattdef(rain,"time",time)
filevarattdef(rain,"lat",xlat)
filevarattdef(rain,"lon",xlon)
filevarattdef(rain,"TMP",T)
setfileoption(rain,"SuppressDefineMode",False)
rain->time = (/time/)
rain->wrf_tem = wrf_tem
rain->xlat = xlat
rain->xlon = xlon
print(wrf_tem)
end
这是ncl脚本,load部分没有给出
|
|