- 积分
 - 576
 
	- 贡献
 -  
 
	- 精华
 
	- 在线时间
 -  小时
 
	- 注册时间
 - 2022-1-21
 
	- 最后登录
 - 1970-1-1
 
 
 
 
 
 
 | 
	
 
GrADS
| 系统平台: | 
  | 
 
| 问题截图: | 
   | 
 
| 问题概况: | 
NCL官网上mjoclivar_7对uwnd作图时出现错误,想请教大佬如何解决  | 
 
| 我看过提问的智慧: | 
看过  | 
 
| 自己思考时长(天): | 
4  | 
 
 
 
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册 
 
 
 
x
 
mjoclivar例子7对1979-2020年uwnd作图时出现错误:Number of dimensions in parameter (0) of (mjo_spectra) is (4), (3) dimensions were expected  
请教各位大佬这是什么原因呢 
程序脚本如下: 
; 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"     
; 
; These files still have to be loaded manually 
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/shea_util.ncl" 
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/diagnostics_cam.ncl"     
 
begin 
                           ; time window  
  twStrt = 19790101         
  twLast = 20201231 
 
; diri   = "/Users/shea/Data/AMWG/" 
 
  diri   = "/home/u/"            ; new input directory 
 
 ;vName  = "U_anom"        ; name of variable on the file 
 ;fili   = "uwnd.day.850.anomalies.1980-2005.nc" 
 
  vName  = "uwnd"      ; name of variable on the file 
  fili   = "uwnd.850.1979-2020.nc" 
  f      = addfile(diri+fili, "r")   
 
  nameRegion = (/ "IO" , "WP" /) 
  latS       = (/ -10. , -20.  /)        
  latN       = (/   5. ,  -5.  /) 
  lonL       = (/  75. , 160.  /) 
  lonR       = (/ 100. , 185.  /) 
 
  nRegion = dimsizes(nameRegion) 
  nBounds = dimsizes(latS) 
 
  if (nRegion.ne.nBounds) then 
      print("mjo_spectra: nRegion and nBounds do not match") 
      print("             nRegion="+nRegion ) 
      print("             nBounds="+nBounds ) 
      exit 
  end if 
 
  pltDir  = "./"                     ; plot directory 
  pltType = "png"                    ; send graphics to PNG file      
  pltName = "mjoclivar" 
 
;************************************************************ 
; time indices corresponding to the desired time window 
;************************************************************ 
 
  date  = cd_calendar(f->time, -2)   ; entire file 
  iStrt = ind(date.eq.twStrt)        ; desired dates 
  iLast = ind(date.eq.twLast) 
  delete(date) 
 
;************************************************************ 
; Read user specified period 
;************************************************************ 
 
  if (getfilevartypes(f,vName) .eq. "short") then 
      X = short2flt( f->uwnd(iStrt:iLast,:,:) ) ; all data in window 
  else 
      X = f->uwnd(iStrt:iLast,:,:,:)  
  end if 
  printVarSummary( X ) 
  printMinMax(X, True) 
 
  time  = X&time                     ; clarity 
  date  = cd_calendar( time , -2 )   ; yyyymmdd 
 
  lat   = f->lat 
  wgty  = cos(0.01745329*lat)       ; MJO CLivar specify cos(lat) 
  copy_VarCoords(lat, wgty) 
 
;************************************************************ 
; driver to calculate and plot the spectra 
;************************************************************ 
 
  optMJO= True 
;;optMJO@spcConLim = (/ 0.10, 0.90/) 
  mjo_spectra (X, date, wgty, latS, latN, lonL, lonR, nameRegion \ 
              ,pltDir, pltType, pltName, optMJO) 
 
end 
 
 
 
 |   
- 
 
 
 
- 
 
 
 
 
 
 
 
 |