- 积分
- 3144
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2015-7-14
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
;----------------------------------------------------------------------
; vector_2.ncl
;
; Concepts illustrated:
; - Overlaying line contours, vectors, and filled contours on a map
; - Manually attaching lat/lon coordinate arrays to a variable
; - Changing the length of the smallest vector as a fraction of the reference vector
; - Drawing curly vectors
; - Setting the color for vectors
; - Moving the vector reference annotation to the top right of the plot
; - Making the labelbar be vertical
; - Increasing the thickness of vectors
;----------------------------------------------------------------------
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 "/home/wangl/public/cnmap/cnmap.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"
begin
;---Open netCDF file begin
raintot = conform_dims((/440,700/), 0.0 , -1)
do i = 0818,0823
name=i
if(isfilepresent("/home/wangl/pkn/station/SEVP_CLI_CHN_MERGE_CMP_PRE_HOUR_GRID_0.10-201607"+name+".grd.nc")) then
a=addfile("/home/wangl/pkn/station/SEVP_CLI_CHN_MERGE_CMP_PRE_HOUR_GRID_0.10-201607"+name+".grd.nc","r")
; Read in Sea Surface Temperature Anomalies
; Read in U and V at 1000 mb [subscript 0]
; Determine the subscripts corresponding to Jan 88
;
h = f->HGT_GDS1_ISBL
u = f->U_GRD_GDS1_ISBL
v = f->V_GRD_GDS1_ISBL
lat = f->g1_lat_0
lon = f->g1_lon_1
lev=f->lv_ISBL2
speed = sqrt(u^2+v^2)
speed@long_name = "Wind Speed"
speed!1 = "lat"
speed!2 = "lon"
speed&lat= lat
speed&lon= lon
ind_uv=19
print(lev(ind_uv))
end if
end do
;---Create plot
wks = gsn_open_wks("pdf","1712_circulation_500")
gsn_define_colormap (wks,"precip3_16lev")
res = True ; plot mods desired
res@cnFillOn = True ; turn on color for contours
res@cnLinesOn = False ; turn off contour lines
res@cnLineLabelsOn = False ; turn off contour line labels
res@gsnScalarContour = True ; contours desired
res@gsnAddCyclic = False
res@mpFillOn = False
;res@mpLandFillColor = "gray" ; set land to be gray
res@mpMinLonF = min(min(lon)) ; select a subregion
res@mpMaxLonF = max(max(lon))
res@mpMinLatF = min(min(lat))
res@mpMaxLatF = max(max(lat))
res@lbOrientation = "Vertical" ; vertical label bar
res@pmLabelBarOrthogonalPosF = -0.01 ; move label bar closer
; note, when doing a subregion, NCL determines the range of the data from
; the full domain. If you wish to just consider the domain you are plotting,
; you must manually set those levels.
res@cnLevelSelectionMode = "ManualLevels" ; set manual contour levels
res@cnMinLevelValF = 10.0 ; set min contour level
res@cnMaxLevelValF = 30 ; set max contour level
res@cnLevelSpacingF = 2. ; set contour spacing
; res@tiMainString = "Sea Surface Temperatures and 1000 mb Winds"
res@vcRefMagnitudeF = 20.0 ; define vector ref mag
res@vcRefLengthF = 0.045 ; define length of vec ref
res@vcRefAnnoOrthogonalPosF = -1.0 ; move ref vector
res@vcRefAnnoArrowLineColor = "black" ; change ref vector color
res@vcGlyphStyle = "LineArrow" ; turn on curley vectors
res@vcLineArrowColor = "black" ; change vector color
res@vcLineArrowThicknessF = 1.5 ; change vector thickness
res@vcVectorDrawOrder = "PostDraw" ; draw vectors last
res@gsnLeftString = ""
res@gsnDraw = False ; turn off draw and frame
res@gsnFrame = False ; b/c this is an overlay plot
printVarSummary(u)
printVarSummary(v)
plot=gsn_csm_vector_scalar_map_ce(wks,u(ind_uv,::10,::10),v(ind_uv,::10,::10),speed(ind_uv,:,:),res)
;---Add contours of wind speed to plot
delete(res)
res = True
res@gsnDraw = False
res@gsnFrame = False
res@gsnAddCyclic = False
res@gsnLeftString = ""
res@gsnRightString = ""
res@gsnCenterString = ""
res@cnLineThicknessF = 3.0
res@cnInfoLabelOrthogonalPosF = 0.15 ; move info label down
cplot = gsn_csm_contour(wks,h(ind_uv,:,:),res)
overlay(plot,cplot)
;draw(plot)
;frame(wks)
;###### ADD MAP OF CHINA #############
cnres = True
cnres@china = True ;draw china map or not
cnres@river = True ;draw changjiang&huanghe or not
cnres@province = True ;draw province boundary or not
cnres@nanhai = True ;draw nanhai or not
cnres@diqu = True ;draw diqujie or not
plot = add_china_map(wks,map,cnres)
;************************************************************************************
draw(map)
frame(wks)
end
;**************************************************************************************
以上是我的脚本,希望能帮忙看看是什么语法错误,谢谢
|
|