Re: write_table error

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Thu Oct 18 2012 - 11:50:50 MDT

In order to use write_table, the third argument must be a List type, not a variable type, as stated in the write_table documentation:

http://www.ncl.ucar.edu/Document/Functions/Built-in/write_table.shtml

I suppose at some point the function could be updated to allow variables, but for now, use a List.

So, change this:

> 11 write_table("test3.txt", "w", a,"%10.3")

to:

> 11 write_table("test3.txt", "w", [/a/],"%10.3")

--Mary

On Oct 16, 2012, at 10:53 AM, H.Dang wrote:

> Hi dear all,
>
> I'm testing write_table, but it doesn't work for me. Following is the error message:
>
> Copyright (C) 1995-2012 - All Rights Reserved
> University Corporation for Atmospheric Research
> NCAR Command Language Version 6.1.0-beta
> The use of this software is governed by a License Agreement.
> See http://www.ncl.ucar.edu/ for more details.
> fatal:syntax error: line 9 in file test.ncl before or near \n
> write_table("test1.txt", "w", c,"%d")
> -------------------------------------^
>
> fatal:syntax error: possibly an undefined procedure
> fatal:syntax error: line 10 in file test.ncl before or near \n
> write_table("test2.txt", "w", c,"%10.3")
> ----------------------------------------^
>
> fatal:syntax error: possibly an undefined procedure
> fatal:syntax error: line 11 in file test.ncl before or near \n
> write_table("test3.txt", "w", a,"%10.3")
> ----------------------------------------^
>
> fatal:syntax error: possibly an undefined procedure
> fatal:Syntax Error in block, block not executed
> fatal:error at line 13 in file test.ncl
>
>
> My code is:
>
> 1 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
> 2 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
> 3 load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> 4 begin
> 5
> 6 a = (/3,2,1/)
> 7 c = [/a/]
> 8
> 9 write_table("test1.txt", "w", c,"%d")
> 10 write_table("test2.txt", "w", c,"%10.3")
> 11 write_table("test3.txt", "w", a,"%10.3")
> 12
> 13 end
>
>
> Could you please find the mistake in my simple code? Thanks a lot!
>
> Hongyan
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Oct 18 11:51:03 2012

This archive was generated by hypermail 2.1.8 : Tue Oct 23 2012 - 11:10:04 MDT