You can try this command:
a=stringtointeger(systemfunc("read ifland; echo $ifland"))
It will convey the value in your standard input to the variable "a".
Hope it helpful
Chen
From: gibies george
Sent: Wednesday, June 23, 2010 1:54 PM
To: ncl-talk@ucar.edu
Subject: Re: [ncl-talk] Runtime input to ncl script
Thank you Dave, for your suggestions.
This is helpful and new information for me. But I prefer if there is a way for live interaction between the script and user (like prompt - pull combination does in GrADS). If anybody tried such a way, please let me know.
Thanking you in advance.
On 22 June 2010 03:55, Dave Allured <dave.allured@noaa.gov> wrote:
Gibies George,
Can you use command line parameters? If so, I like NCL command line
arguments for this purpose, e.g.
ncl program.ncl varname=\"precip\" year1=1980 year2=1999 pdf=1
See the examples on this page:
http://www.ncl.ucar.edu/Document/Manuals/Ref_Manual/NclCLO.shtml
Other methods that you can use are environment variables, and short
text configuration files. I think there is a way to use an external
subroutine to read the keyboard, but I do not know how to do that.
Perhaps someone else can tell.
--Dave
NOAA/PSD/CIRES
On 6/21/2010 6:23 AM, gibies george wrote:
> Hello friends,
>
> While writing an ncl script I came through a requirement to read some values
> to the script at run time. Is there a way to do it in ncl script ?
> In grads I used *promt* and *pull* for this purpose. Is there any thing
> similer to that available in NCL script language ?
>
>
> Gibies George,CSIR-RF,
> Climate and Global Modelling Division,
> Indian Institute of Tropical Meteorology,
> Dr. Homi Bhabha Road,
> NCL (P. O.), Pashan,
> Pune 411008, India.
>
> http://sites.google.com/site/gibiesge/
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
--
Gibies George,CSIR-RF,
Climate and Global Modelling Division,
Indian Institute of Tropical Meteorology,
Dr. Homi Bhabha Road,
NCL (P. O.), Pashan,
Pune 411008, India.
http://sites.google.com/site/gibiesge/
Think about the environment. Please don't print this e-mail unless it is necessary.
--------------------------------------------------------------------------------
_______________________________________________
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 Wed Jun 23 01:54:39 2010
This archive was generated by hypermail 2.1.8 : Thu Jun 24 2010 - 14:10:27 MDT