- 积分
- 179
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2011-7-4
- 最后登录
- 1970-1-1
|
发表于 2013-7-24 17:49:57
|
显示全部楼层
好的,下面是代码哈
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"
load "$NCARG_ROOT/lib/ncarg/nclscripts/cnmap/cnmap.ncl"
begin
lines = asciiread("/public/users/chjchen/wrf/ncl/data/obs/13071808.000",-1,"string")
;read from line 11(means: 11+1)
station = stringtofloat(str_get_field(lines(14::),1," "))
lon = stringtofloat(str_get_field(lines(14::),2," "))
lat = stringtofloat(str_get_field(lines(14::),3," "))
height = stringtofloat(str_get_field(lines(14::),4," "))
R = stringtofloat(str_get_field(lines(14::),5," "))
;cj print(R)
olon = new(351,"float");
olat = new(201,"float");
data1 = new((/201,351/),"float")
do i=0,350
olon(i) = 70.0+0.2*(i)
end do
do l=0,200
olat(l) = 15.0+0.2*(l)
end do
olon!0 = "lon"
olon@long_name = "lon"
olon@units = "degrees-east"
olon&lon = olon
olat!0 = "lat"
olat@long_name = "lat"
olat@units = "degrees_north"
olat&lat = olat
R@_FillValue = 9999.0
; rscan = (/10,7,4,2,1/)
; rscan = (/5,4,3,2,1,0.5/)
rscan = (/3,2,1,0.5,0.25/)
data1 = obj_anal_ic_deprecated(lon,lat,R,olon,olat,rscan,True)
wks_type = "x11"
wks = gsn_open_wks(wks_type,13071808.000)
gsn_define_colormap(wks,"precip4_11lev")
; gsn_draw_colormap(wks)
res = True
res@gsnAddCyclic = False
res@mpDataSetName = "Earth..4"
res@mpDataBaseVersion = "MediumRes"
res@mpOutlineOn = True
res@mpOutlineSpecifiers = (/"China:states","Taiwan"/)
res@mpMinLatF = 17 ; Asia limits
res@mpMaxLatF = 53
res@mpMinLonF = 75
res@mpMaxLonF = 135
res@mpGeophysicalLineThicknessF= 1.
res@mpNationalLineThicknessF= 1.
res@mpProjection = "LambertConformal" ;兰伯特投影
res@mpLambertMeridianF = 105
res@mpLimitMode = "LatLon"
res@mpLambertParallel1F = 29
res@mpLambertParallel2F = 29
res@mpAreaMaskingOn = True
res@mpMaskAreaSpecifiers = (/"China:states","Taiwan"/)
res@mpOceanFillColor = 0
res@mpInlandWaterFillColor = 0
res@cnLevelSelectionMode = "ExplicitLevels"
res@cnLevels = (/0.1, 10.0, 25., 50.0, 100.0 ,250.0/)
res@lbLabelBarOn = True
res@lbLabelStrings = (/"0.1","10","25","50","100","250"/)
res@lbOrientation = "vertical" ; vertical label bar
res@tiMainFont = "helvetica"
res@tiMainOffsetYF = 0.02 ;set place for main title along Y,offset
res@tiMainFontHeightF = 0.02 ;set main title font size
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
cnres = True
cnres@china = True
cnres@river = True
cnres@province = True
cnres@nanhai = True
cnres@diqu = False
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
plot = gsn_csm_contour_map(wks,data1,res)
plot = gsn_csm_contour_map(wks,data1,cnres)
draw(plot)
frame(wks)
end
|
|