[gradsusr] UDF in open grads 2

Arlindo da Silva arlindo.dasilva at gmail.com
Thu Dec 1 17:01:36 EST 2011


Henrique,

  This is a proposed API which has not been released. Your best bet is to
download the opengrads sources and look at all the examples under
extensions/. Start with the "hello, world" example under hello/. You can
write extensions (UDFs or UDCs) in C, Fortran or even gs scripts.

  Keep in mind that COLA does not endorse my approach for UDFs, so this
feature my never be officially supported by them. This is the reason why I
have not promoted the use of the opengrads extension framework by the grads
community at large.

 Let me know if you have questions.

    Arlindo

Sent from my iPhone

On Dec 1, 2011, at 1:12 PM, "Henrique M. J. Barbosa - IFUSP" <
hbarbosa at if.usp.br> wrote:

Dear Arlino and all,

I am trying to write my own UDF for using in open grads 2.0.1. However, the
instructions here:

<
http://opengrads.org/wiki/index.php?title=User_Defined_Extensions_in_GrADS_v2.0
>

tell that I should write something like:

#include "gex.h"
int f_hello (void *gex, int argc, char **argv) {
  int rc, i;
  var_t *var;
  /* Evaluate the input expression */
  if ( argc !=1 ) return 1;
  rc = gex_eval(gex,argv[1],var);
(... etc...)

But when I try to compile the example, gcc complains that var_t is
undefined. I already searched the whole opengrads2 source code. The only
definition I could found was inside grads.h, where there is an element of
"struct gavar" which is called "var_t". I also searcher for function
gex_eval() but could not find it anywhere.

Any ideas?
Are users supposed to create UDF with this new semantics??
Or should we stick with grads v1.9 way???

Thanks,
Henrique


-- 
----------------------------------------------------------------
Prof. Henrique M.J. Barbosa          Phone:+[55] (11) 3091 6647
Ed. Basilio Jafet, Sala 100           Cell:+[55] (11) 8380 8001
Dep. de Fisica Aplicada                FAX:+[55] (11) 3091 6749
Instituto de Fisica - USP
Rua do Matao, Travessa R, 187        Skype: hmjbarbosa
05508-900, Sao Paulo, SP, Brazil       msn: hmjbarbosa at yahoo.com
http://www.fap.if.usp.br/~hbarbosa   e-mail: hbarbosa at if.usp.br

_______________________________________________
gradsusr mailing list
gradsusr at gradsusr.org
http://gradsusr.org/mailman/listinfo/gradsusr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://gradsusr.org/pipermail/gradsusr/attachments/20111201/61a09533/attachment-0003.html 


More information about the gradsusr mailing list