Re: [netcdfgroup] Fwd: reading compound type variable with vlen member

  • To: John Caron <jcaron1129@xxxxxxxxx>
  • Subject: Re: [netcdfgroup] Fwd: reading compound type variable with vlen member
  • From: Edward Hartnett - NOAA Affiliate <edward.hartnett@xxxxxxxx>
  • Date: Mon, 6 Mar 2023 05:20:53 -0700
Howdy John!

You should get a pointer to nc_vlen_t, defined in netcdf.h:

/** This is the type of arrays of vlens. */
typedef struct {
    size_t len; /**< Length of VL data (in base type units) */
    void *p;    /**< Pointer to VL data */
} nc_vlen_t;

Ed



On Sun, Mar 5, 2023 at 9:23 AM John Caron <jcaron1129@xxxxxxxxx> wrote:

>
> Hello friends:
>
> attached is a file with this ncdump output:
>
> netcdf IntTimSciSamp {
> types:
>   int(*) loopData ;
>   compound tim_record {
>     int shutterPositionA ;
>     int shutterPositionD ;
>     int shutterPositionB ;
>     int shutterPositionC ;
>     int dspGainMode ;
>     int coneActiveStateA ;
>     int coneActiveStateD ;
>     int coneActiveStateB ;
>     int coneActiveStateC ;
>     loopData loopDataA(1) ;
>     loopData loopDataB(1) ;
>     int64 sampleVtcw ;
>   }; // tim_record
> dimensions:
> time = UNLIMITED ; // (29 currently)
> variables:
> int64 time(time) ;
> tim_record tim_records(time) ;
> }
>
> if I am calling the latest netcdf4 library to read the tim_records, using
> this call:
>
> int nc_get_var(int ncid, int varid, void * ip )
>
> what am i expecting back in *ip ? Particularly for the int(*) loopData?
>
> thanks!
>
> Regards,
> John
>
>
> _______________________________________________
> NOTE: All exchanges posted to Unidata maintained email lists are
> recorded in the Unidata inquiry tracking system and made publicly
> available through the web.  Users who post to any of the lists we
> maintain are reminded to remove any personal information that they
> do not want to be made public.
>
>
> netcdfgroup mailing list
> netcdfgroup@xxxxxxxxxxxxxxxx
> For list information or to unsubscribe,  visit:
> https://www.unidata.ucar.edu/mailing_lists/
>
  • 2023 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: