Re: Question for Users: Interactive Mode

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue Dec 21 2010 - 11:13:47 MST

NCL's interactive environment is not as friendly as IDL, Matlab
or ferret. (Don't know about GrADS.) This was not a high priority
in the initial design. The NCL developers have on their
'list of things to do' a request to improve NCL's interactive capabilities.

That said ...

You can load contributed.ncl as many time as you like.
Each function/procedure is (by rule) preceded by an 'undef'.
For example

undef("foo")
function foo(...)

Hence, you could do

%> ncl <return>
ncl> load ".../contributed.ncl"
ncl> load ".../contributed.ncl"
ncl> load ".../contributed.ncl"

and you would get no messages. Each load just eliminates
any previous references and redefines the function.

he following could be useful.

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

%> ncl <return> go into interactive mode

ncl> ....
ncl> ....
ncl> loadscript("test.ncl")
ncl> ...

----
Some possible interactive improvements:
   - Better debugging capabilities
   - Online help for functions (right now we just have list_procfuncs)
(see NCL-163)
   - Command line completion
   - Better error handling
   - A "clear" command to clear the interactive window
   - Function for retrieving the list of variables (there's a procedure)
On 12/21/10 10:57 AM, Rob Nicholas wrote:
> Carl,
>
> I use NCL in interactive mode on a regular basis -- mostly for
> debugging methods for scripts that I'm writing but sometimes just for
> quick calculations, simple plots, or mucking around with NetCDF files.
>   The interface definitely has limitations (it would be nice to have
> better command line completion and a built-in documentation) but the
> ease of dealing with NetCDF files makes it my first choice over Matlab
> or Octave in many circumstances.
>
> I'm not sure what you mean about not being able to load
> "contributed.ncl" more than once -- are you getting some kind of
> error?  I haven't encountered any problems with the latest version
> (5.2.1).
>
> ~Rob
>
_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Dec 21 11:13:57 2010

This archive was generated by hypermail 2.1.8 : Wed Dec 22 2010 - 16:10:23 MST