Fixed Dimension of variables in NETCDF

Apr 30, 2015 at 2:58 PM

I recently tried to use the netcdf library for .NET. I was wondering if i could get some help in following two matter
  1. Is it possible to specify whether NETCDF3 or NETCDF4 file is created. I see that it creates NETCDF4 file by dafult.
  2. When using Dataset.Add() for creating and adding a variables in netcdf file, is it possible to make the dimensions fixed. I have tried to make variable but it only makes unlimited dimension.
It would be great if i can see some example etc.)
//dimension for netcdf file
int xdim = 101; // x dimensions
int ydim = 101; // y dimensions
int zdim = 11; // z dimensions          
int nsteps = 10; // time dimensions
//variables to netcdf file
double[] time = new double[nsteps]; // time
double[] lat = new double[ydim]; // latitude
double[] lon = new double[xdim]; // longitude
double[] z = new double[zdim]; // eta levels
float[,] hgt = new float[ydim, xdim];
float[,,,] u = new float[nsteps, zdim, ydim, xdim];
//Create file here
DataSet ds = DataSet.Open("");

ds.Add("HGT", hgt, "south_north", "east_west");
ds.PutAttr("HGT", "MemoryOrder", "XY");
ds.PutAttr("HGT", "stagger", "");
ds.PutAttr("HGT", "description", "Terrain Height");