Re: dimension reordering with WRAPIT

From: Dennis Shea (shea AT ucar.edu)
Date: Thu Aug 11 2005 - 07:36:36 MDT

  • Next message: jerry: "About masking using RANGS_GSHHS database."

    > Thank you Dennis,
    >
    > my main foul up was forgetting to add the extra 1 onto the dim ref values
    > when in fortran. But I still have some questions:
    >
    > I have this 428,614 array. When I read this array in from the grib file, it
    > stays in this form (428,614). Then when I pass it to fortran through WRAPIT,
    > I'm required to put it in the form (614,428).
       ^^^^^^^^^^^^^ no , see below ^^^^^^^^^^^^^^
    >
    > This seems the opposite to your explanation.
    > As the array goes (fast,slow) while in ncl,

    No. NCL [slow,fast]

    > then when I call the fortran subroutine it flips it to > (slow,fast).

      fortran [fast,slow]

    ---
    Note  .... the is *no* "flip" involved. Absolutely nothing happens
    to the array. Again ***NOTHING*** is done to the array. There is
    *no* copy or reorder occuring. It is just a different way of
    speciifying how the language accesses its contents.
    

    ..... row-major vs column-major ......

    In memory a 3-element array is stored contigously as

    NCL(C) fortran 0 1 1 2 2 3

    a 2x3 [NCL] array <==> 3x2 [fortran] is also stored as 6 elements in contiguous memory. NCL[C] and fortran just happen to use different ways [rwo-major] versus [column-major] to specify the data.

    ------NCL[C]---- --fortran--- element 0 (0,0) <===> (1,1) element 1 1 (0,1) <===> (2,1) 2 2 (0,2) <===> (3,1) 3 3 (1,0) <===> (1,2) 4 4 (1,1) <===> (2,2) 5 5 (1,2) <===> (3,2) 6

    At the risk of being repetitive .... *nothing* happens to the data in memory ... just different ways of accessing the data.

    _______________________________________________ ncl-talk mailing list ncl-talk@ucar.edu http://mailman.ucar.edu/mailman/listinfo/ncl-talk



    This archive was generated by hypermail 2b29 : Thu Aug 11 2005 - 07:47:51 MDT