<div dir="ltr">Hello, <div><br></div><div>I am fairly new to NCL. I am using ncl version 6.1.2. I am trying to create a Press/Hgt vs Lat plot using gsn_csm_pres_hgt and it's throwing me the following error</div><div><font face="monospace, monospace"><b><br></b></font></div><div><div><font face="monospace, monospace"><b>(0) gsn_csm_pres_hgt: Fatal: The first dimension of the input data must</b></font></div><div><font face="monospace, monospace"><b>(0) have a coordinate variable called 'lev.'</b></font></div><div><font face="monospace, monospace"><b>(0) Cannot create plot.</b></font></div><div><font face="monospace, monospace"><b>fatal:Illegal right-hand side type for assignment</b></font></div><div><font face="monospace, monospace"><b>fatal:["Execute.c":8128]:Execute: Error occurred at or near line 118 in file check_Verticle.ncl</b></font></div><div><br></div><div>I have checked the earlier talk on the similar error " <a href="http://www.ncl.ucar.edu/Support/talk_archives/2009/1887.html">http://www.ncl.ucar.edu/Support/talk_archives/2009/1887.html</a> " </div><div>I tried to fix the error but still the code is producng the same error. </div><div><br></div><div>Here is the code that i have used. </div><div><br></div><div><div><i><font face="monospace, monospace">; **************************************</font></i></div><div><i><font face="monospace, monospace">; Load Packages</font></i></div><div><i><font face="monospace, monospace">; **************************************</font></i></div><div><i><font face="monospace, monospace">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl" </font></i></div><div><i><font face="monospace, monospace">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"</font></i></div><div><i><font face="monospace, monospace">load "$NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl"</font></i></div><div><i><font face="monospace, monospace">load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"</font></i></div><div><i><font face="monospace, monospace"><br></font></i></div><div><i><font face="monospace, monospace">; **************************************</font></i></div><div><i><font face="monospace, monospace">; Read File</font></i></div><div><i><font face="monospace, monospace">; **************************************</font></i></div><div><i><font face="monospace, monospace">a = addfile("<a href="http://wrfout_d01.nc">wrfout_d01.nc</a>", "r")<br></font></i></div></div><div><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div dir="ltr"><div><i><font face="monospace, monospace"><br></font></i></div><div><div><i><font face="monospace, monospace">; **************************************</font></i></div><div><i><font face="monospace, monospace">; Read Variable</font></i></div><div><i><font face="monospace, monospace">; **************************************</font></i></div><div><i><font face="monospace, monospace">theta = a->T<br></font></i></div><div><i><font face="monospace, monospace">perturbP = a->P</font></i></div><div><i><font face="monospace, monospace">baseStateP = a->PB</font></i></div><div><i><font face="monospace, monospace"><br></font></i></div><div><div><i><font face="monospace, monospace">; **************************************</font></i></div><div><i><font face="monospace, monospace">; Calculations</font></i></div><div><i><font face="monospace, monospace">; **************************************</font></i></div><div><i><font face="monospace, monospace">P1 = perturbP + baseStateP</font></i></div><div><i><font face="monospace, monospace">theta = theta + 300</font></i></div><div><i><font face="monospace, monospace"><br></font></i></div><div><i><font face="monospace, monospace">TK = wrf_tk(P1,theta)</font></i></div></div><div><i><font face="monospace, monospace"><br></font></i></div><div><div><i><font face="monospace, monospace">; **************************************</font></i></div><div><i><font face="monospace, monospace">; Rename Dimensions of Variable</font></i></div><div><i><font face="monospace, monospace">; **************************************</font></i></div></div><div><div><i><font face="monospace, monospace">TK!0 = "time"</font></i></div><div><i><font face="monospace, monospace">TK!1 = "lev"</font></i></div><div><i><font face="monospace, monospace">TK!2 = "lat"</font></i></div><div><i><font face="monospace, monospace">TK!3 = "lon"</font></i></div></div><div><i><font face="monospace, monospace"><br></font></i></div><div><div><i><font face="monospace, monospace">; **************************************</font></i></div><div><i><font face="monospace, monospace">; reorder the dimensions </font></i></div><div><i><font face="monospace, monospace">; compute average based on dimensions</font></i></div><div><i><font face="monospace, monospace">; **************************************</font></i></div></div><div><i><font face="monospace, monospace">TKreorder = TK(lev|:,lat|:,lon|:,time|:) ; (lev,lat,lon,time)<br></font></i></div><div><i><font face="monospace, monospace">TKtime = dim_avg_Wrap(TKreorder)<span class="" style="white-space:pre">         </span>; (lev,lat,lon)<br></font></i></div><div><i><font face="monospace, monospace">TKtimeAvg = dim_avg_Wrap(TKtime_reorder) ; (lev,lat)<br></font></i></div><div><i><font face="monospace, monospace">printVarSummary(TKtimeAvg)<br></font></i></div><div><i><font face="monospace, monospace"><br></font></i></div><div><div><i><font face="monospace, monospace">; **************************************</font></i></div><div><i><font face="monospace, monospace">; Creat Plot</font></i></div><div><i><font face="monospace, monospace">; **************************************</font></i></div></div><div><div><i><font face="monospace, monospace">wks = gsn_open_wks("png", "PressVsLat_TK")</font></i></div><div><i><font face="monospace, monospace">gsn_define_colormap(wks,"NCV_bright")</font></i></div></div><div><i><font face="monospace, monospace"><br></font></i></div><div><div><i><font face="monospace, monospace">res = True</font></i></div><div><i><font face="monospace, monospace">res@cnFillOn = True</font></i></div><div><i><font face="monospace, monospace">res@lbLabelAutoStride = True</font></i></div></div><div><i><font face="monospace, monospace"><br></font></i></div><div><i><font face="monospace, monospace">plot = gsn_csm_pres_hgt(wks,TKtimeAvg(lev|:,lat|:),res)</font></i><br></div><div>; ==================================================<br></div><div><br></div><div>printVarSummary(TKtimeAvg) gives the following output, which shows the first dimension of the variable to be "lev"</div><div><br></div><div><div> <font face="monospace, monospace">Variable: TKtimeAvg</font></div><div><font face="monospace, monospace"> Type: float</font></div><div><font face="monospace, monospace"> Total Size: 32000 bytes</font></div><div><font face="monospace, monospace"> 8000 values</font></div><div><font face="monospace, monospace"> Number of Dimensions: 2</font></div><div><font face="monospace, monospace"> Dimensions and sizes: [lev | 40] x [lat | 200]</font></div><div><font face="monospace, monospace"> Coordinates:</font></div><div><font face="monospace, monospace"> Number Of Attributes: 3</font></div><div><font face="monospace, monospace"> units : K</font></div><div><font face="monospace, monospace"> description : Temperature</font></div><div><font face="monospace, monospace"> average_op_ncl : dim_avg over dimension(s): lon</font></div></div><div><br></div><div><br></div><div><br></div><div><br></div>Regards,<br>Shreta Ghimire<br><br></div></div></div></div></div>
</div></div>