- 积分
- 1246
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2012-5-25
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
- load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
- load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
- begin
- f = addfile("个人路径/20210725.nc","r")
- pv=short2flt(f->pv) ;era5产品读取需要short2flt函数
- w=short2flt(f->w)
- pv=pv(:,:,::-1,:)
- w=w(:,:,::-1,:)
- wks = gsn_open_wks("png","profile")
- gsn_define_colormap(wks,"MPL_RdBu")
- time = f->time
- time2 = time+8
- copy_VarMeta(time, time2)
- chn_data = cd_calendar(time2,0) ;era5产品的时间以秒计算,所以要换算
- year = tointeger(chn_data(:,0))
- month = tointeger(chn_data(:,1))
- day = tointeger(chn_data(:,2))
- hour = tointeger(chn_data(:,3))
- minute = tointeger(chn_data(:,4))
- ;chn_date = sprinti("%0.4i-", year)+sprinti("%0.2i-", month)+sprinti("%0.2i_", day)+sprinti("%0.2i", hour)
- chn_date = sprinti("%0.2i", day)+sprinti("%0.2i", hour)
- chn = tointeger(chn_date)
- ;print(chn_date)
- lon = f->longitude
- lat = f->latitude
- lat = lat(::-1)
- lev = f->level
- downlat = 29.996 ;设置起始点经纬度
- downlon = 122.223
- toplat = 39.098
- toplon = 119.210
- npts = 40
- dist = gc_latlon(downlat,downlon,toplat,toplon,npts,2) ;插值起止点间的40个点位的经纬度
- lat_new = dist@gclat
- copy_VarAtts(lat,lat_new)
- lon_new = dist@gclon
- w_new = linint2_points(lon, lat, w, False, lon_new, lat_new, 0) ;将要绘制的变量进行插值
- pv_new = linint2_points(lon, lat, pv, False, lon_new, lat_new, 0)
- pv_new = smth9(pv_new,0.5,-0.25,False) ;平滑
- w_profil =w_new(1,:,:)
- w_profil!0 ="level"
- w_profil!1 = "grid"
- w_profil&level = lev
- w_profil&grid = lat_new
- pv_profil =pv_new(1,:,:)*1000000
- pv_profil!0 ="level"
- pv_profil!1 = "grid"
- pv_profil&level = lev
- pv_profil&grid = lat_new
- printVarSummary(pv)
- ;print(pv)
- res=True
- res@gsnFrame=False
- res@gsnDraw=False
- res@gsnLeftString = " "
- res@gsnRightString = " "
- res@tmXBMode = "Automatic"
- res@tmXBMaxTicks = 8
- res@pmTickMarkDisplayMode = "Always"
- res@gsnAddCyclic = False
- res@tmXTOn = False
- resw=res
- resw@cnLinesOn = False
- resw@cnFillOn = True
- resw@cnLevelSelectionMode = "ManualLevels"
- resw@cnMaxLevelValF = 3
- resw@cnMinLevelValF = -3
- resw@gsnAddCyclic = False
- resw@cnInfoLabelOn = False
- plota = gsn_csm_pres_hgt(wks,w_profil(10:,:),resw)
- resp =res
- resp@cnFillOn = False
- resp@cnLinesOn = True
- resp@cnInfoLabelOn = False
- resp@cnLineLabelsOn = False
- resp@cnMonoLineThickness = False
- resp@cnLineThicknesses = (/1,3/)
- resp@cnLevelSelectionMode = "ExplicitLevels"
- resp@cnLevels = (/2, 0.5/)
- plotb = gsn_csm_pres_hgt(wks,pv_profil(10:,:),resp)
- overlay(plota,plotb) ;叠加
- draw(wks)
- frame(wks)
- end
复制代码
|
-
|