[ncl-talk] Problem in coordinate extent reading by NCL

Karin Meier-Fleischer meier-fleischer at dkrz.de
Mon Jul 1 06:38:30 MDT 2019


The result (error) is not the same, you've got a different error message 
which tells you that your selected longitude value is not in the data file!

    Grid coordinates :
      1 : lonlat          : points=1001 (13x77)
                      lon : 76 to 79 by 0.25 degrees_east
                      lat : 10 to 29 by 0.25 degrees_north

If you use e.g. lon value 76 degrees instead of 30 degrees it will 
produce the attached plot.

  plot = gsn_csm_time_lat(wks,ad(:,:,{76}), res )

It is always good to read the errors and warnings carefully because in 
most cases they tell you what is wrong.

-Karin

Am 01.07.19 um 12:40 schrieb Atul Saini:
> *Please help this is urgent, your support is highly important.*
> *
> *
> Regards,
>
>
>
>
>
> On Mon, Jul 1, 2019 at 2:55 PM Atul Saini <atulsainimail at gmail.com 
> <mailto:atulsainimail at gmail.com>> wrote:
>
>     Hi Karin Sir,
>        I tried it, earlier but result remail same . Please help.
>
>     *plot = gsn_csm_time_lat(wks,ad(:,:,{30}), res ) *
>
>     On Mon, Jul 1, 2019, 14:40 Karin Meier-Fleischer via ncl-talk
>     <ncl-talk at ucar.edu <mailto:ncl-talk at ucar.edu>> wrote:
>
>         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  <mailto:ncl-talk at ucar.edu>
>>         List instructions, subscriber options, unsubscribe:
>>         http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>         _______________________________________________
>         ncl-talk mailing list
>         ncl-talk at ucar.edu <mailto:ncl-talk at ucar.edu>
>         List instructions, subscriber options, unsubscribe:
>         http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>

-- 
Dipl. Geophys. Karin Meier-Fleischer
Visualization, NCL, CDO, PyNGL
Application Support

Deutsches Klimarechenzentrum GmbH (DKRZ)
Bundesstrasse 45a - D20146 Hamburg - Germany

Phone:    +49 (0)40 460094 126
Fax:      +49 (0)40 460094 270
E-Mail:   meier-fleischer at dkrz.de
URL:      www.dkrz.de

Geschäftsführer: Prof. Dr. Thomas Ludwig
Sitz der Gesellschaft: Hamburg
Amtsgericht Hamburg HRB 39784

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190701/f625056d/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: time_lat.png
Type: image/png
Size: 45482 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20190701/f625056d/attachment.png>


More information about the ncl-talk mailing list