[netcdfgroup] NC_STRINGS Query

Hi all,
Im trying to hyperslab str_tst of type NC_STRING in the netcdf4 file below:

With stride=1,
I allocate some space using:
char **sngp;
sngp=(char**)nco_calloc(var->sz,sizeof(char*));

Then call:
(void)nc_get_vara_string(nc_id,var->id,var->srt,var->cnt,sngp);

The function then fills sng[0] ...sng[var->sz-1] with strings


With stride >1 I call
(void)nc_get_vars_string(nc_id,var->id,var->srt,var->cnt,var->srd,sngp);

What I get returned  is

sng[0]= last element of the hyperslab and

sng[1]...sng[var->sz-1]  ==NULL


Not sure what is happening here ????????



/*********************************************************************************/
netcdf foo {
dimensions:
        lat = 2 ;
        lon = 4 ;
variables:
        string str_tst(lat, lon) ;


data:

 str_tst =
  "one", "two", "three", "four",
  "five", "six", "seven", "eight" ;
}
/********************************************************************************/





  • 2009 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: