- 积分
- 3625
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-11-7
- 最后登录
- 1970-1-1
![未绑定新浪微博用户 新浪微博达人勋](source/plugin/sina_login/img/gray.png)
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
用FNL资料画海平面气压,出来和实况相差很远。但让同事用PYTHON画的又与实况一样。请问是我的脚本哪里有问题啊?
; These files are loaded by default in NCL V6.2.0 and newer
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
begin
;在“ ”中输入数据所在地址
g = addfile("e:/data/baoyu/fnl_20240229_12_00.grib2","r")
shp_filename = "gis/guangdong/guangdong.shp"
;设置高度
nlev=1000
;读取数据
lon0 = g->lon_0
lat0 = g->lat_0
pres = g->PRMSL_P0_L101_GLL0(::,::)
press = pres/100
u = g->UGRD_P0_L103_GLL0({10},::4,::4)
v = g->VGRD_P0_L103_GLL0({10},::4,::4)
;lon0 = g->longitude
;lat0 = g->latitude
;pres = g->msl(0,:,:)
;press = pres/100
;u = g->u10(0,:,:)
; v = g->v10(0,:,:)
;读取时间
time = pres@initial_time
;yyyymmddhh = cd_calendar(time, 3)
DATE = grib_stime2itime (time)
;print (yyymmmdddhh)
;>---------------------------------------<
;>---------------------------------------<
; 设置图片格式和文件名
;>---------------------------------------<
wks = gsn_open_wks("png","Sea-level Pressure")
res = True
res@gsnDraw = False
res@gsnFrame = False
res@gsnLeftString = ""
res@gsnRightString = ""
;>---------------------------------------<
;>---------------------------------------<
; 等值线设置
;>---------------------------------------<
cnres = res
;cnres@cnSmoothingOn = True ;
;cnres@cnSmoothingDistanceF = 0.001
cnres@cnLevelSelectionMode = "ManualLevels"
cnres@cnMinLevelValF = 870.0
cnres@cnMaxLevelValF = 1080.0
cnres@cnLevelSpacingF = 2.5
cnres@cnInfoLabelOn = False
cnres@cnLineLabelsOn = True
cnres@cnLineLabelFontHeightF = 0.01
cnres@cnLineThicknessF = 2.0
cnres@cnLineLabelInterval = 2
cnres@cnLineColor = "red"
cnres@cnHighLabelsOn = True
cnres@cnHighLabelString = "H"
cnres@cnHighLabelFontColor = "BLUE"
cnres@cnLowLabelsOn = True
cnres@cnLowLabelString = "D"
cnres@cnLowLabelFontColor = "RED"
;>---------------------------------------<
;>---------------------------------------<
; 标题设置
;>---------------------------------------<
cnres@tiMainOn = False
cnres@gsnLeftString = "Sea-level Pressure"
;cnres@gsnRightString = DATE
;>---------------------------------------<
;>---------------------------------------<
; 风向杆设置
;>---------------------------------------<
u = u*2.5
v = v*2.5
vcres = res
vcres@gsnAddCyclic = False
vcres@vcRefMagnitudeF = 50. ;调整箭头大小?
vcres@vcRefLengthF = 0.02
vcres@vcGlyphStyle = "WindBarb"
vcres@vcMinDistanceF =1
vcres@vcRefAnnoOn = False
vcres@vcWindBarbLineThicknessF = 1.5
vcres@vcMinMagnitudeF = 0.01
vcres@vcWindBarbTickLengthF = 0.5
vcres@vcWindBarbLineThicknessF = 3
vcres@vcWindBarbTickSpacingF = 0
vcres@vcWindBarbColor = "BLUE"
;>---------------------------------------<
; 地图设置
;>---------------------------------------<
mpres = res
mpres@mpFillOn = False
mpres@mpMinLatF = 10.
mpres@mpMaxLatF = 70.
mpres@mpMinLonF = 80.
mpres@mpMaxLonF = 150.
mpres@mpDataBaseVersion = "MediumRes"
mpres@mpDataSetName = "Earth..4"
mpres@mpOutlineSpecifiers = (/"China:states"/)
mpres@pmTickMarkDisplayMode = "Always"
mpres@tmXBMajorLengthF = 0.005
;mpres@mpProjection = "LambertConformal" ;兰伯特投影
;mpres@mpLambertMeridianF = 110.0
;mpres@mpLambertParallel1F = .001 ;Default: .001 ;可以自己改一改,看看投影有什么不同,挺有趣的
;mpres@mpLambertParallel2F = 89.999 ;Default: 89.999
mapplot = gsn_csm_map(wks, mpres)
cnplot = gsn_csm_contour(wks, press, cnres)
vcplot = gsn_csm_vector(wks, u, v, vcres)
;>---------------------------------------<
;>---------------------------------------<
;>---------------------------------------<
; 广东地区
;>---------------------------------------<
;lnres = True
;lnres@gsLineColor = "black"
;lnres@gsLineThicknessF = 2.0
;line_mask = gsn_add_shapefile_polylines(wks, cnplot, shp_filename, lnres)
overlay(mapplot, cnplot)
overlay(mapplot, vcplot)
draw(mapplot)
frame(wks)
end
PYTHON
NCL海平面气压场
实况海平面气压场
|
|