Dear all,<br><br> When I tried to calculate the frequency wavenumber spectra by using the below script I am getting the following errors.<br><br>fatal:Dimension size mismatch, dimension (1) of left hand side reference does not have the same size as the right hand side reference after subscripting.<br>
fatal:Execute: Error occurred at or near line 229 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/diagnostics_cam.ncl<br><br>fatal:Execute: Error occurred at or near line 2910 in file $NCARG_ROOT/lib/ncarg/nclscripts/csm/diagnostics_cam.ncl<br>
<br>fatal:Execute: Error occurred at or near line 60 in file mjoclivar_10.ncl<br><br>Any help would be appreciated,<br>Thanking you<br><br><br><br>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"<br>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"<br>
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"<br>load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/diagnostics_cam.ncl"<br><br>;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<br>begin<br>
; time window<br><br> twStrt = 20020102<br> twLast = 20341231<br><br> diri = "/home/sebi/convert/"<br><br> vName = "daily_preci" ; name of variable on the file<br>
fili = "<a href="http://daily_preci.nc">daily_preci.nc</a>"<br> f = addfile(diri+fili, "r")<br><br> pltDir = "./"<br> pltType = "pdf"<br> pltName = "t61_wave_freq"<br>
<br>;************************************************************<br>; time indices corresponding to the desired time window<br>;************************************************************<br><br> date = f->time<br>
iStrt = ind(date.eq.twStrt) ; desired dates<br> iLast = ind(date.eq.twLast)<br> delete(date)<br><br>;************************************************************<br>; Read user specified period<br>;************************************************************<br>
<br> if (getfilevartypes(f,vName) .eq. "short") then<br> X = short2flt( f->$vName$(iStrt:iLast,{-10:40},{50:150}) ) ; all data in window<br> else<br> X = f->$vName$(iStrt:iLast,{-10:40},{50:150})<br>
end if<br> printVarSummary( X )<br> printMinMax(X, True)<br><br> time = X&time ; clarity<br>; date = ut_calendar( time , -2 ) ; yyyymmdd<br> date=time<br>;************************************************************<br>
x = dim_avg_Wrap( X(time|:,lon|:,lat|:) ) ; (time,lon)<br>;************************************************************<br>; calculate and plot the spectra<br>;************************************************************<br>
optWavFrq = False<br> optPlot = TrueoptPlot@smth9 = False<br><br> nameSeason = (/"winter" , "summer"/)<br><br> do ns=0,dimsizes(nameSeason)-1<br> wf = mjo_wavenum_freq_season (x, date,nameSeason(ns), optWavFrq)<br>
optPlot@tiMainString ="Wave no:- Freq: spectra: "+ nameSeason(ns)+": "+twStrt+"-"+twLast<br> mjo_wavenum_freq_season_plot (wf, nameSeason(ns), pltDir, pltType, pltName, optPlot)<br> end do<br>
<br>end<br><br><br clear="all"><br> <br><br>