- 积分
- 22
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-12-4
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
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/csm/shea_util.ncl"
;load "$NCARG_ROOT/lib/ncarg/nclscripts/cnmap/cnmap.ncl"
load "$GEODIAG_ROOT/cnmap/cnmap.ncl"
begin
month = (/"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug"/)
f=addfile("air.mon.mean.surf.nc","r")
air = f->air
lat = f->lat
lon = f->lon
missvalue = f->air@_FillValue
nlat = dimsizes(lat)
nlon = dimsizes(lon)
r1= new((/nlat,nlon,8/),float)
r1!0 = "lat"
r1!1 = "lon"
r1&lon = lon
r1&lat = lat
;printVarSummary(r1)
r1@_FillValue = 1e+20
t1= new((/nlat,nlon,8/),float)
t1!0 = "lat"
t1!1 = "lon"
t1&lon = lon
t1&lat = lat
t1@_FillValue = 1e+20
do i=0,7
var=air(948+i:1320+i:12,:,:)
;时间序列路径
N= asciiread("T-30hPa.txt",(/32/),"float")
printVarSummary(N)
;相关-t检验
lt= var(lat|:,lon|:,time|:)
printVarSummary(lt)
r1(:,:,i) = escorc(N,lt)
t1(:,:,i) = r1(:,:,i)* sqrt((32.-2.)/(1-r1(:,:,i)^2))
end do
===============plot=================
wtype="png"
wks = gsn_open_wks(wtype,"air.T30hPa.1979-2010.CN.ncepn")
map=new(8,graphic)
shade = new(8,graphic)
plot = new(8,graphic)
gsn_define_colormap(wks,"bluered")
do i =0,7
res = True
res@gsnMaximize = True
res@gsnDraw = False
res@gsnFrame = False
;>------------------------------------------------------------------------------------------------------------------<
; set for the map
;>------------------------------------------------------------------------------------------------------------------<
mapres = res
mapres@mpMinLatF = 17.
mapres@mpMaxLatF = 55.
mapres@mpMinLonF = 72.
mapres@mpMaxLonF = 136.
mapres@mpFillOn = True
mapres@mpOutlineOn = False ; Use outlines from shapefile
;mapres@cnFillDrawOrder = "PreDraw"
mapres@mpDataBaseVersion = "MediumRes"
mapres@mpDataSetName = "Earth..4"
mapres@mpAreaMaskingOn = True
mapres@mpMaskAreaSpecifiers = (/"China","Taiwan","Disputed area between India and China","India:Arunachal Pradesh"/)
mapres@mpLandFillColor = "white"
mapres@mpInlandWaterFillColor = "white"
mapres@mpOceanFillColor = "white"
mapres@mpOutlineBoundarySets = "NoBoundaries"
mapres@mpProjection = "LambertConformal" ;兰伯特投影
mapres@mpLambertMeridianF = 110.0
mapres@mpLimitMode = "LatLon"
mapres@mpLambertParallel1F = .001 ;Default: .001 ;可以自己改一改,看看投影有什么不同,挺有趣的
mapres@mpLambertParallel2F = 89.999 ;Default: 89.999
mapres@gsnRightString = "95%"
map(i) = gsn_csm_map(wks,mapres)
;--------------画图
shres = res
shres@cnFillOn = True
shres@cnLinesOn = False
shres@cnFillDrawOrder = "Predraw";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;注意要有这个否则等值线会溢出
shres@cnInfoLabelOn = False
shres@cnLevelSelectionMode = "ExplicitLevels"
shres@cnLevels = (/-2.750,-2.048,2.048,2.750/)
shres@cnLineLabelsOn = False ; turn on line labels
shres@cnMonoFillColor = False
shres@cnFillColors = (/2,66,0,189,253/)
shres@lbLabelBarOn = False
shres@gsnLeftString = month(i)
shade(i) = gsn_csm_contour(wks,t1(:,:,i),shres)
cres = res
cres@cnFillOn = False
cres@cnLinesOn = True
cres@cnLineDrawOrder = "Predraw";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;注意要有这个否则等值线会溢出
;cres@cnLevelSelectionMode = "ExplicitLevels"
;cres@cnLevels = (/-2.750,-2.042,-1.,0.,1.,2.042,2.750/)
cres@cnLevelSelectionMode = "ManualLevels"
cres@cnMaxLevelValF = 0.8
cres@cnMinLevelValF = -0.8
cres@cnLineThicknessF = 2.5
cres@cnLineLabelPlacementMode = "constant"
cres@gsnContourNegLineDashPattern = 4
cres@cnLineLabelsOn = False
cres@cnInfoLabelOn = False
cres@lbLabelAutoStride = True
plot(i)= gsn_csm_contour(wks,r1(:,:,i),cres)
;>============================================================<
; add China map
;>------------------------------------------------------------<
cnres = True
cnres@china = True ;draw china map or not
cnres@river = True ;draw changjiang&huanghe or not
cnres@province = False ;draw province boundary or not
cnres@nanhai = True ;draw nanhai or not
cnres@diqu = False ; draw diqujie or not
chinamap = add_china_map(wks,map(i),cnres)
;>============================================================<
overlay(map(i),shade(i))
overlay(map(i),plot(i))
end do
resP = True ; modify the panel plot
resP@gsnPanelLabelBar = True ; add common colorbar
resP@lbLabelFontHeightF = 0.007
resP@lbBoxLinesOn =False
gsn_panel(wks,map,(/4,2/),resP) ; now draw as one plot
frame(wks)
end
|
-
|