[ncl-talk] plotting station rainfall

Karin Meier-Fleischer meier-fleischer at dkrz.de
Sat Sep 19 14:05:18 MDT 2015


Hi Geeta,

the error message is telling you what is wrong - type mismatch in gsn_add_polymarker. 

Take a look at the gsn_add_polymarker function page:
http://www.ncl.ucar.edu/Document/Graphics/Interfaces/gsn_add_polymarker.shtml

gsn_add_polymarker wants to have a numeric type for x and y (in your case lon and lat).

function gsn_add_polymarker (
		wks  [1] : graphic,  
		plot [1] : graphic,  
		x    [*] : numeric,  
		y    [*] : numeric,  
		res  [1] : logical   
	)

	return_val <http://www.ncl.ucar.edu/Document/Functions/return_val.shtml> [1] :  graphic
In your script the lat and lon arrays are defined as strings but gsn_add_polymarker 
expects a numeric type. Use tofloat() function for lat and lon conversion.

Bye,
Karin

> Am 19.09.2015 um 21:02 schrieb Geeta Geeta <geetag54 at yahoo.com>:
> 
> dear users.
>  I am trying to plot station data and taking help of the some available scripts. (station_4.ncl)
> 
> I am getting this error
> fatal:Argument type mismatch on argument (2) of (gsn_add_polymarker) can not coerce
> fatal:["Execute.c":8578]:Execute: Error occurred at or near line 62 in file stn-v2.ncl
> 
> I am attaching my script. 
> Kindly suggest what s the problem. 
> 
> when I execute this I get following......
> (4)    77.24
> 
> 
> Variable: hgt
> Type: string
> Total Size: 20 bytes
>             5 values
> Number of Dimensions: 1
> Dimensions and sizes:    [5]
> Coordinates: 
> Number Of Attributes: 1
>   _FillValue :    
> (0)       hgt   
> (1)       919.6 
> (2)       882.2 
> (3)       900   
> (4)       900   
> 
> 
> Variable: rf
> Type: string
> Total Size: 20 bytes
>             5 values
> Number of Dimensions: 1
> Dimensions and sizes:    [5]
> Coordinates: 
> Number Of Attributes: 1
>   _FillValue :    
> (0)    rf
> (1)    5.6
> (2)    67.
> (3)    0.1
> (4)    0.1
> fatal:Argument type mismatch on argument (2) of (gsn_add_polymarker) can not coerce
> fatal:["Execute.c":8578]:Execute: Error occurred at or near line 62 in file stn-v2.ncl
> 
>  
> I am attaching my input file and the script.
>  
> Geeta.
> <stn-v2.ncl><input1.txt>_______________________________________________
> 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/20150919/45a44d0b/attachment.html 


More information about the ncl-talk mailing list