- 积分
- 2952
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-5-5
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
如题,想用NCL画海温梯度,但是出来的图是错的,求各位大神指点迷津~~~
程序如下:
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/csm/skewt_func.ncl"
;load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/wind_rose.ncl"
begin
fi = addfile("/home/hp/wq/HadISST_sst.nc","r")
sst = fi->sst
SST = sst(1608,:,:)
lat = fi->latitude
lat@units ="degrees_north"
lon = fi->longitude
lon@units ="degrees_east"
lats=-89.5
latn=89.5
nnlat= floattointeger((latn-lats)/2)
lonw=-179.5
lone=179.5
nnlon = floattointeger((lone-lonw)/2)
dTdX=SST
dTdY=SST
dlon = (lon(2)-lon(1))*0.0174533 ; convert to radians
dlat=(lat(2)-lat(1))*0.0174533
do nl=0,nnlat-1 ; loop over each latitude
dX = 6378388.*cos(0.0174533*lat(nl))*dlon ; constant at this latitude
dTdX(nl:nl,:)= center_finite_diff_n (SST(nl:nl,:),dX,True,0,1)
end do
do nY=0,nnlon-1
dY=doubletofloat(6378388.*dlat)
dTdY(nY:nY,:)=center_finite_diff_n (SST(nY:nY,:),dY,True,0,1)
end do
g=sqrt(dtdx^2+dtdy^2)*100000
g@lat = lat
g@lon = lon
wks = gsn_open_wks("x11" ,"SST")
gsn_define_colormap(wks,"WhBlGrYeRe")
;SST= smth9_Wrap(smth9_Wrap(smth9_Wrap(SST, -0.00001, -0.00001, True),-0.00001,-0.00001, True),-0.00001,-0.00001, True)
res = True
res@mpFillOn = True
res@cnFillOn = True
;res@cnFillMode = "RasterFill"
;res@mpMinLatF = 30
;res@mpMaxLatF = 50
;res@mpMinLonF = 125
;res@mpMaxLonF = 148
res@cnLinesOn = False
res@cnLineLabelsOn = False
res@cnLevelSelectionMode = "ManualLevels"
res@cnMinLevelValF = 0
res@cnMaxLevelValF = 1.5
res@cnLevelSpacingF = 0.05
res@gsnSpreadColors = True
res@lbLabelBarOn = True
res@lbLabelAutoStride = True
res@lbBoxLinesOn = False
res@cnRasterSmoothingOn = True
;res@cnSmoothingDistanceF = 0.00000000002
;res@cnSmoothingTensionF = 0.0000000001
;wrf_smooth_2d (SST,0.999)
plot = gsn_csm_contour_map(wks,g(::-1,:),res)
end
file:///C:/Users/hp/Documents/Tencent%20Files/361644950/Image/C2C/%7DJZ1TZ(U993YU]8(MIX9%7B_V.png 画出来的图是这样的。。。。用的是Hadley海温资料
|
|