if statement in grads

Arlindo da Silva arlindo.dasilva at GMAIL.COM
Mon Mar 16 21:06:34 EDT 2009


On Fri, Mar 13, 2009 at 5:22 AM, Bernd Becker
<bernd.becker at metoffice.gov.uk> wrote:
> This will slow your code down dramatically!
>
> May I suggest to work with
> maskout and set const to define 0/1 pointer fields
> where the if conditions hold true and
> use the pointer (global) fields to
> do
> what ever is done inside the if statement.
>
> This can be incredibly fast, compared to dealing
> with grid point values individually.
>

Also, the if() extension in libbjt provides very nice semantics for
this kind of operation:

http://opengrads.org/doc/udxt/libbjt/libbjt.html#if_expr1_op_expr2_true_expr_false_expr_


         Arlindo

--
Arlindo da Silva
dasilva at alum.mit.edu



More information about the gradsusr mailing list