立即注册 登录
气象家园 返回首页

李小毛123的个人空间 http://bbs.06climate.com/?80661 [收藏] [复制] [分享] [RSS]

留言板

facelist doodle涂鸦板

您需要登录后才可以留言 登录 | 立即注册


熙熙攘攘 2017-9-13 16:43
太长了,我直接改了。
熙熙攘攘 2017-9-13 16:42
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"

begin

latB=0
latT=50
lonL=120
lonR=240

season = "DJF"
      
f = addfile("/disk_raid5/pub/ws/HadISST/HadISST_sst.nc","r")         

time=f->time

yrstart=1961
yrlast=2011
YYYY=cd_calendar(time,-1)/100     ;遇到所有的时间都要转换吗

iYYYY=ind(YYYY.ge.yrstart .and. YYYY.le.yrlast);提取1952年到2014年的海


sst=f->sst(iYYYY,{latB:latT},:)
printVarSummary(sst)

SST = month_to_season(sst, season)

  gradLatLon  = grad_latlon_cfd (SST, SST&latitude, SST&longitude, True, False)

                              
  SST_grad_lat  = gradLatLon[0]    ; for clarity; explicitly extract variables from returned 'list'
  SST_grad_lon  = gradLatLon[1]

; replace the generic attributes with more specific attributes

  SST_grad_lon@long_name = "longitudinal gradient"
  SST_grad_lat@long_name = "latitudinal gradient"
  if (isatt(SST,"units")) then
      SST_grad_lat@units = SST@units+"/m"
  else
      SST_grad_lat@units = "C/km"
  end if

  grad_lat = dim_avg_n_Wrap(  SST_grad_lat, 0)
  grad_lon = dim_avg_n_Wrap(  SST_grad_lon, 0)

  d1=sqrt(  grad_lat^2+grad_lon^2)
copy_VarCoords(grad_lon,d1)


d1  = lonFlip( d1 )
printVarSummary(d1)

wks=gsn_open_wks("pdf","td333")
gsn_define_colormap(wks,"WhiteYellowOrangeRed")
res3=True
res3@cnFillOn=True
res3@gsnAddCyclic=False
res3@mpMinLonF=120
res3@mpMaxLonF=240
res3@mpMinLatF=latB
res3@mpMaxLatF=latT
res3@cnLinesOn=False
res3@tmXTOn=False
res3@tmYROn=False
res3@lbLabelBarOn=True
res3@mpCenterLonF=165
res3@cnLineLabelsOn=False
;res3@cnLevelSelectionMode="ManualLevels"
;res3@cnMaxLevelValF=0.0006
;res3@cnMinLevelValF=0

printMinMax(d1({latB:latT},{lonL:lonR}), 1)
;symMinMaxPlt(d1({latB:latT},{lonL:lonR}), 16, False, res3)
plot=gsn_csm_contour_map(wks,  d1({latB:latT},{lonL:lonR}),res3)

end

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

返回顶部