[ncl-talk] Regarding to the example 5 of the WRAPIT page

Ng, Kelvin Sai-cheong kscng at connect.hku.hk
Thu Aug 18 17:58:34 MDT 2016


I see.  Thank you Dennis.

Kelvin

On Thu, Aug 18, 2016 at 8:51 PM, Dennis Shea <shea at ucar.edu> wrote:

> The following statement is incorrect.
>
> ===
> But both NCL and FORTRAN have the array convention of
> (number of rows, number of columns)
> ===
>
> fortran is column major
> NCL (think C) is row major.
>
> ====
> NCL/Fortramn argument passing
>
> [1]
> Arrays need no reordering. The 'rule' is: fastest varying dimension in  on
> language maps into the fastest varying dimension in the otherv language. In
> NCL, the rightmost dimension is the fastest varying dimension. In Fortran,
> the leftmost dimension is the fastest varying.
>
>                NCL                                  Fortran
>         x(time,lev,lat,lon)  <=map=>  x(lon,lat,lev,time)
> [2] Think of an array as being a long 1D list in memory
>
>      NCL: x(N,M)       Fortran(M,N)  where M=3, N=2
>
>                      memory
> x(0,0)     =>    7.23     <=     x(1,1)
> x(0,1)     =>   -12.5     <=     x(2,1)
> x(0,2)     =>      0.3      <=     x(3,1)
>
> x(1,0)     =>   323.1    <=     x(1,2)
> x(1,1)     =>  -234.6    <=     x(2,2)
> x(1,2)    =>    200.1    <=     x(3,2)
>
>
> On Thu, Aug 18, 2016 at 1:49 AM, Ng, Kelvin Sai-cheong <
> kscng at connect.hku.hk> wrote:
>
>> Hi,
>>
>> I am just wondering why does the dimension of the input array in NCL
>> (i.e. fxy) has dimension of (n,m), whereas the array in the FORTRAN
>> function (i.e. FXY) has dimension of (m,n)?
>>
>> But both NCL and FORTRAN have the array convention of
>> (number of rows, number of columns).
>>
>> Link: http://www.ncl.ucar.edu/Document/Tools/WRAPIT.shtml#Example_5
>>
>> Many thanks,
>>
>> Kelvin
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160819/91df928b/attachment.html 


More information about the ncl-talk mailing list