- 积分
- 10656
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2013-10-10
- 最后登录
- 1970-1-1
|
发表于 2015-4-23 19:08:50
|
显示全部楼层
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"
begin
;************************************************
; Specify geographical region and time span (year-month start and end
;************************************************
latS = -90
latN = 90
lonL = -180
lonR = 180
;
;************************************************
; Read from netCDF file: variable is type short...unpack
;************************************************
diri = "E:/data/"
fili = "HadISST_sst.nc"
f = addfile(diri+fili,"r")
x = short2flt( f->sst(1,{latS:latN},{lonL:lonR}) )
x =lonFlip(x)
printVarSummary(x) ; [time| 720]x[lat| 91]x[lon| 180]
x@lat2d = conform(x, f->latitude, 0) ; 2D coordinate arrays
x@lon2d = conform(x, f->longitude, 1)
latMin = -20
latMax = 60
lonMin = 110
lonMax = 270
x = where((x@lat2d.ge.latMin .and. x@lat2d.le.latMax .and. \
x@lon2d.ge.lonMin .and. x@lon2d.le.lonMax), x, x@_FillValue)
wks = gsn_open_wks("png","E:/ENSO/20150423/01")
colors=read_colormap_file("BlWhRe")
res = True
res@gsnMaximize = False ; make large
res@cnFillOn = True ; turn on color
res@cnLinesOn = False ; turn off contour lines
res@cnLineLabelsOn = False ; turn off contour line labels
;;res@cnFillMode = "RasterFill"
; res@mpFillOn = False ; turn off default background gray
res@mpCenterLonF =180
res@mpMinLatF=-90
res@mpMaxLatF=90
res@mpMinLonF=0
res@mpMaxLonF=360
res@gsnLeftString=""
res@gsnRightString=""
resep=res
resep@tiMainString = "CP La Nina"
resep@cnLevelSelectionMode = "ManualLevels" ; set manual contour levels
resep@cnMinLevelValF = -2 ; set min contour level
resep@cnMaxLevelValF = 2 ; set max contour level
resep@cnLevelSpacingF = 0.2 ; set contour interval
resep@cnFillPalette =colors(18:82,:)
; resep@gsnCenterString =yearep(i)-1+"/"+yearep(i)
plot = gsn_csm_contour_map_ce(wks,x,resep)
end |
|
|