Re: NCL user defined procedures in NCL scripting language

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Tue Oct 11 2011 - 11:04:14 MDT

To add to Ugo's information, I looked around for an actual example.

See:

http://www.ncl.ucar.edu/Applications/Scripts/ice_4.ncl

This has several functions, and a main code that follows.

Note that we recommend that you use "local" to define any variables
that are local to a function, but this is not required.

However, if you have a variable in your main code with the same name
as a variable in a local function, you should
use "local" if you don't want these values propagated outside your
function.

--Mary

On Oct 11, 2011, at 10:53 AM, ugo merlini wrote:

> Hi,
>
> I just write a function
>
> begin ; begin function
> undef("New_function") ; function name
> function New_function(variable:variable type) ;where "variable" is
> the variable I want to import from the main code and variable type
> is type of variable I import (string, integer, ecc)
>
> function code
>
> return(variable); variable to send to main code
>
> end; end function
>
> begin ; start main code
>
>
> to call the function
>
> function_result = (New_function(variable)) ; where variable is the
> variable to pass to the function and function_result in the variable
> passed from the function to main code
>
> end; end main code
>
> hopes can help
>
> Ugo
>
>
>
>
>
> Date: Tue, 11 Oct 2011 17:43:10 +0200
> From: gking@fc.ul.pt
> To: ncl-talk@ucar.edu
> Subject: NCL user defined procedures in NCL scripting
> language
>
> Dear All,
>
> I am trying to write my own NCL procedures in the NCL scripting
> language. The manuals are rather terse and I would like to study
> some simple examples. However, I have not been able to locate
> anything on the NCL website or talk archives.
>
> Is there an undocumented location where such example scripts can be
> found??
>
> Thanks,
> greg king
> _______________________________________________ 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

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Oct 11 11:04:21 2011

This archive was generated by hypermail 2.1.8 : Wed Oct 12 2011 - 15:59:45 MDT