13 cout<<
"Opening file \"firstFile.cdf\" with NcFile::replace"<<endl;
14 NcFile ncFile(
"firstFile.cdf",NcFile::replace);
16 cout<<left<<setw(50)<<
"Testing addGroup(\"groupName\")";
17 NcGroup groupA(ncFile.addGroup(
"groupA"));
18 NcGroup groupA0(ncFile.addGroup(
"groupA0"));
19 NcGroup groupB(groupA.addGroup(
"groupB"));
20 NcGroup groupC(groupA.addGroup(
"groupC"));
22 cout <<left<<setw(50)<<
"Number of groups in the top-level group is" << ncFile.
getGroupCount() <<endl;
25 ncFile.addDim(
"dim1",11);
26 ncFile.addDim(
"dim2");
29 NcVar var1 = ncFile.addVar(
"varA",ncByte,
"dim1");
32 vector<string> stringArray(2);
33 stringArray[0] =
"dim1";
34 stringArray[1] =
"dim2";
35 NcVar var2 = ncFile.addVar(
"varB",ncByte,stringArray);
39 cout <<
"unknown error"<<endl;
Class represents a netCDF group.
int getGroupCount(NcGroup::GroupLocation location=ChildrenGrps) const
Gets the number of NcGroup objects.
Base object is thrown if a netCDF exception is encountered.
Class represents a netCDF variable.
Class represents a netCDF root group.