Re: gsn_text

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Mon, 28 Aug 2006 12:41:22 -0600 (MDT)

> I get the following error when I am using the gsn_text function. I could not
>figure out why this message comes..
>
>warning:Argument 2 of the current function or procedure was coerced to the
>appropriate type and thus will not change if the function or procedure modifies
>its value
>fatal:Attribute assignment type mismatch
>
>I have also attached my ncl code file.

procedure gsn_text (
                wks [1] : graphic, ; argument 0
                plot [1] : graphic, ; argument 1
                text : string, ; argument 2
                x : numeric,
                y : numeric,
                res [1] : logical
        )

The argument "text" is argument 2.
It is prototyped as "string".

Your argument 'rcf' is type float.

NCL is creating a temporary string variable
which is passed to the procedure.

If u want to avoid this use something like:

    sprintf("%5.2f", rcf)

    gsn_text(wks,plot,sprintf("%5.2f", rcf),xmax,ymax-50,tres)
    
    or
    
    rstr = sprintf("%5.2f", rcf)
    gsn_text(wks,plot,rstr,xmax,ymax-50,tres)
Please see:

http://www.ncl.ucar.edu/Support/talk_archives/2006/0825.html
and a slight correction
http://www.ncl.ucar.edu/Support/talk_archives/2006/0826.html

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Aug 28 2006 - 12:41:22 MDT

This archive was generated by hypermail 2.2.0 : Wed Aug 30 2006 - 07:43:22 MDT