[ncl-talk] Problem in coordinate extent reading by NCL
Karin Meier-Fleischer
meier-fleischer at dkrz.de
Mon Jul 1 03:09:58 MDT 2019
Hi Atul,
your data has pr_wtr(time,lat,lon).
The plot line has to be change to something like
* plot = gsn_csm_time_lat(wks,ad(:,:,{30}), res )
*-Karin
Am 01.07.19 um 10:04 schrieb Atul Saini via ncl-talk:
> Hello NCL Talk,
> I am trying to plot the figure 'Time vs
> Longitude' , but there is some problem with NCL while plotting and its
> says-
>
> "fatal:Number of subscripts do not match number of dimensions of
> variable,(2) Subscripts used, (3) Subscripts expected
> fatal:["Execute.c":8638]:Execute: Error occurred at or near line 31
> *
> *
> *Please help to resolve the issue, I am attaching the script and data
> file herewith this mail.*
> *
> *
> *Script-*
> *
> *
> *;*********************************************
> ; time_lat_2.ncl
> ;*********************************************
> ;
> ; These files are loaded by default in NCL V6.2.0 and newer
> ; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> ; load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
>
>
> begin
> f = addfile ("1951_2017_masked.nc <http://1951_2017_masked.nc>" ,
> "r"); add file
> ad = f->pr_wtr
> ;*************************
> ; plotting parameters
> ;*************************
> wks = gsn_open_wks ("png", "time_lat" ) ; send graphics to PNG file
>
>
> res = True ; plot mods desired
> res at tiMainString = "color example" ; title
> res at tmXBLabelStride = 2 ; tick mark label stride
> res at tiYAxisString = "time" ; y axis title
>
> res at cnFillOn = True ; color on
> res at cnFillMode = "CellFill"
> res at lbLabelStride = 2 ; every other label
> res at lbOrientation = "Vertical" ; vertical label bar
> res at cnLinesOn = False ; turn off contour lines
> res at cnFillPalette = "ViBlGrWhYeOrRe" ; set color map
> res at cnLevelSpacingF = 5 ; contour spacing
>
> plot = gsn_csm_time_lat(wks,ad(:,{30}), res )
>
> end*
>
> Regards,
>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190701/52a6513f/attachment-0001.html>
More information about the ncl-talk
mailing list