回复: 回复: [ncl-talk] write_table function error

From: 楼曦 <524712476_at_nyahnyahspammersnyahnyah>
Date: Mon Oct 14 2013 - 09:33:00 MDT

hello,I 've tried ,it seems the function "write_table" do not work on my computer:
  
  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.
ncl 0> a = (/111, 222, 333, 444/)
ncl 1> write_table("list.txt", "w", [/a/], "%d")
fatal:syntax error: line 1 before or near \n
write_table("list.txt", "w", [/a/], "%d")
-----------------------------------------^
 fatal:syntax error: possibly an undefined procedure
ncl 2>

  

 

 ------------------ 原始邮件 ------------------
  发件人: "Mary Haley";<haley@ucar.edu>;
 发送时间: 2013年10月14日(星期一) 晚上11:10
 收件人: ""楼曦" <524712476@qq.com>;"<>;
 抄送: "ncl-talk Talk"<ncl-talk@ucar.edu>;
 主题: Re: 回复: [ncl-talk] write_table function error

 

[When you respond to me, please also include ncl-talk@ucar.edu]

Perhaps you have multiple versions of NCL installed on your system, but you are still pointing to an older version?

Please try this simple test program, and send me all the output, including the version number that NCL echoes when you first run it.

First, type:

ncl

You are now in "interactive" NCL. Type the following three lines exactly as they appear here:

a = (/111, 222, 333, 444/)
write_table("list.txt", "w", [/a/], "%d")
quit


Now type:

cat list.txt

I tried the above with NCL V6.1.0, and it works just fine:

% ncl
 Copyright (C) 1995-2012 - All Rights Reserved
 University Corporation for Atmospheric Research
 NCAR Command Language Version 6.1.0
 The use of this software is governed by a License Agreement.
 See http://www.ncl.ucar.edu/ for more details.
ncl 0> a = (/111, 222, 333, 444/)
ncl 1> write_table("list.txt", "w", [/a/], "%d")
ncl 2> quit
% cat list.txt
111
222
333
444


On Oct 14, 2013, at 9:02 AM, "楼曦" <524712476@qq.com> wrote:

> thank you for your reply, and I also noticed ,but my NCL version is NCL version 6.1.0.There should have other mistakes and I continued to look for mistakes...
>
> ------------------ 原始邮件 ------------------
> 发件人: "Mary Haley";<haley@ucar.edu>;
> 发送时间: 2013年10月14日(星期一) 晚上10:52
> 收件人: "楼曦"<524712476@qq.com>;
> 抄送: "ncl-talk"<ncl-talk@ucar.edu>;
> 主题: Re: [ncl-talk] write_table function error
>
> Hello,
>
> The error is telling you that this is "possibly an undefined procedure". It sounds like you have an older version of NCL that doesn't have this procedure.
>
> If you look at the documentation for write_table:
>
> http://www.ncl.ucar.edu/Document/Functions/Built-in/write_table.shtml
>
> You will see that it was added to NCL version 6.1.0.
>
> You can check your version of NCL with:
>
> ncl -V
>
> If it says "6.0.0" or "5.1.2" or something earlier, then you will need to upgrade your version of NCL.
>
> http://www.ncl.ucar.edu/Download/
>
> --Mary
>
> On Oct 14, 2013, at 8:08 AM, 楼曦 <524712476@qq.com> wrote:
>
> > hello,
> > I'm trying to use 'write_table' function to write variables to a file, but i always get errors like this:
> >
> > fatal:syntax error: line 23 in file writetable.ncl before or near \n
> > write_table("list.txt", "w", hlist, "%s")
> > ------------------------------------------^
> > fatal:syntax error: possibly an undefined procedure
> > fatal:syntax error: line 24 in file writetable.ncl before or near \n
> > write_table("list.txt", "a", alist, "%d,%16.2f,%s,%d,%ld")
> > -----------------------------------------------------------^
> > fatal:syntax error: possibly an undefined procedure
> > fatal:syntax error: line 25 in file writetable.ncl before or near \n
> > write_table("list.txt", "a", flist, "%s ")
> > -------------------------------------------^
> > fatal:syntax error: possibly an undefined procedure
> > fatal:Syntax Error in block, block not executed
> > fatal:error at line 27 in file writetable.ncl
> >
> > These errors appers after i tested the 'Example1' in
> > http://www.ncl.ucar.edu/Document/Functions/Built-in/write_table.shtml
> > can you help me figure the problem out?
> > thanks!
> > _______________________________________________
> > ncl-talk mailing list
> > List instructions, subscriber options, unsubscribe:
> > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
> .

.

4
Received on Mon Oct 14 09:34:27 2013

This archive was generated by hypermail 2.1.8 : Tue Oct 22 2013 - 10:35:27 MDT