/* This is part of the netCDF package. Copyright 2005 University Corporation for Atmospheric Research/Unidata See COPYRIGHT file for conditions of use. See www.unidata.ucar.edu for more info. Test netcdf-4 enum types. $Id: tst_enums.c,v 1.15 2008/05/30 19:36:51 ed Exp $ */ #include #include "netcdf.h" #define FILE_NAME "tst_enums.nc" #define DIM_LEN 4 #define NUM_MEMBERS 4 #define DIM_NAME "dim" #define BASE_SIZE 20 #define VAR_NAME "Advice" #define TYPE_NAME "Mysterous_Word" int main(int argc, char **argv) { int ncid; nc_type typeid; int i; char name_in[NC_MAX_NAME+1]; int ntypes, typeids[1] = {0}; nc_type base_nc_type, base_nc_type_in; size_t nfields_in, num_members, base_size_in; int class_in; #ifdef USE_PARALLEL MPI_Init(&argc, &argv); #endif printf("\n*** Testing netcdf-4 enum type.\n"); printf("*** creating enum type..."); { int value_in; unsigned char data[DIM_LEN]; /* Can't use the same name twice! */ char member_name[NUM_MEMBERS][NC_MAX_NAME + 1] = {"Mene1", "Mene2", "Tekel", "Upharsin"}; int member_value[NUM_MEMBERS] = {0, 99, 81232, 12}; for (i=0; i