PnetCDF Fortran Binding Issues

Jianwei Li jianwei at cheetah.cpdc.ece.nwu.edu
Fri Aug 8 08:39:32 CDT 2003


It's great that the conversion was applied automatically!
The Fortran binding updates look perfect except that the
indices/coordinates need to substract 1 from the Fortran
indices/coordinates to get the C ones, while counts and
strides don't. So in the put/get_var1, put/get_vara, and
put/get_vars binding, I think the code segment

    if (ln > 0) {
        int li;
        l3 = (size_t *)malloc( ln * sizeof(size_t) );
        for (li=0; li<ln; li++)
            l3[li] = v3[ln-1-li];
    }

need to be changed to:

    if (ln > 0) {
        int li;
        l3 = (size_t *)malloc( ln * sizeof(size_t) );
        for (li=0; li<ln; li++)
            l3[li] = v3[ln-1-li]-1;
    }

as I indicated in my previous emails.

Great! I think it's almost done!
I'll test run it sometime later today.

Jianwei

On Fri, 8 Aug 2003, William Gropp wrote:

> At 01:00 PM 8/7/2003 -0500, Jianwei Li wrote:
>
> >Bill,
> >
> >I've identified those functions & arguments that need such F-C conversion
> >in the attached txt file. They are C functions that the Fortran binding
> >functions are calling, and F-C conversion should be done before calling
> >the C interface functions.
>
> Ok, I've made a pass at these.  Since the bindings are generated
> automatically, it was fairly easy to apply these uniformly.  I've checked
> in my updates, and the current code compiles.  I haven't tried linking it.
>
> Bill
>




More information about the parallel-netcdf mailing list