Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

declare type of array in ncap2 script?

Help
John
2014-01-24
2014-01-24
  • John
    John
    2014-01-24

    In my script for ncap2, I create a new array using the existing precipitation variable as a template:

    *pr_ttl = array(0, 1, pr);
    

    Since 'pr' is a float variable, I expected pr_ttl to be the same type, but it comes out as int. I thought assigning it float values might force it to be float:

    *pr_ttl = array(0, 1, pr);
    pr_ttl = 0.0f;
    

    But that didn't work either. Is there a way to explicitly tell NCO to make it a float variable? I combed through ncap2 documentation and did not see anything...

    Thanks!

     
  • Charlie Zender
    Charlie Zender
    2014-01-24

    Hoping Henry can help answer this question...
    cz

     
  • John
    John
    2014-01-24

    I just realized I misunderstood the array() syntax. It appears that the first two arguments dictate what type of array to create. I did

    pr_ttl = array(0.0f, 1.0f, pr);

    and that created a float array.

    Sorry to take up your time!