
array set CGNSnodes {
  AdditionalExponents          {1 AdditionalExponents_t R4 3 0}
  AdditionalUnits              {1 AdditionalUnits_t C1 {32 3} 0}
  ArbitraryGridMotion          {0 ArbitraryGridMotion_t C1 {} 1}
  ArbitraryGridMotionPointers  {1 DataArray_t C1 32 0}
  Area                         {1 Area_t MT {} 0}
  AreaType                     {1 AreaType_t C1 {} 0}
  AverageInterface             {1 AverageInterface_t MT {} 0}
  AverageInterfaceType         {1 AverageInterfaceType_t C1 {} 0}
  Axisymmetry                  {1 Axisymmetry_t MT {} 0}
  AxisymmetryAngle             {1 DataArray_t R4 1 0}
  AxisymmetryAxisVector        {1 DataArray_t R4 2 0}
  AxisymmetryReferencePoint    {1 DataArray_t R4 2 0}
  BaseIterativeData            {0 BaseIterativeData_t I4 1 0}
  BC                           {0 BC_t C1 {} 1}
  BCData                       {0 BCData_t MT {} 0}
  BCDataSet                    {0 BCDataSet_t C1 {} 1}
  BCProperty                   {1 BCProperty_t MT {} 0}
  BCRegionName                 {1 Descriptor_t C1 {} 1}
  CellListDonor                {1 IndexArray_t I4 {} 0}
  CGNSBase                     {0 CGNSBase_t I4 2 1}
  CGNSLibraryVersion           {1 CGNSLibraryVersion_t R4 1 0}
  ChemicalKineticsModel        {1 ChemicalKineticsModel_t C1 {} 0}
  ConvergenceDataArray         {1 DataArray_t R4 {} 1}
  CoordinateNames              {1 DataArray_t C1 {32 2} 0}
  CoordinateData               {0 DataArray_t R4 {} 1}
  DataArray                    {0 DataArray_t {} {} 1}
  DataClass                    {1 DataClass_t C1 {} 0}
  DataConversion               {1 DataConversion_t R4 2 0}
  Descriptor                   {0 Descriptor_t C1 {} 1}
  DiffusionModel               {1 \"int[1+...+IndexDimension]\" I4 {} 0}
  DimensionalExponents         {1 DimensionalExponents_t R4 5 0}
  DimensionalUnits             {1 DimensionalUnits_t C1 {32 5} 0}
  DirichletData                {1 BCData_t MT {} 0}
  DiscreteData                 {0 DiscreteData_t MT {} 1}
  DiscreteDataArray            {0 DataArray_t R4 {} 1}
  ElementConnectivity          {1 DataArray_t I4 {} 0}
  ElementList                  {1 IndexArray_t I4 {} 0}
  ElementRange                 {1 IndexRange_t I4 {} 0}
  Elements                     {0 Elements_t I4 2 1}
  EMConductivityModel          {1 EMConductivityModel_t C1 {} 0}
  EMElectricFieldModel         {1 EMElectricFieldModel_t C1 {} 0}
  EMMagneticFieldModel         {1 EMMagneticFieldModel_t C1 {} 0}
  EquationDimension            {1 \"int\" I4 1 0}
  Family                       {0 Family_t MT {} 1}
  FamilyBC                     {1 FamilyBC_t C1 {} 0}
  FamilyBCDataSet              {0 FamilyBCDataSet_t C1 {} 1}
  FamilyName                   {1 FamilyName_t C1 {} 0}
  FamilyPointers               {1 DataArray_t C1 32 0}
  FlowEquationSet              {1 FlowEquationSet_t MT {} 0}
  FlowSolution                 {0 FlowSolution_t MT {} 1}
  FlowSolutionsPointers        {1 DataArray_t C1 32 0}
  GasModel                     {1 GasModel_t C1 {} 0}
  GeometryEntity               {0 GeometryEntity_t MT {} 1}
  GeometryFile                 {1 GeometryFile_t C1 {} 0}
  GeometryFormat               {1 GeometryFormat_t C1 {} 0}
  GeometryReference            {0 GeometryReference_t MT {} 1}
  GlobalConvergenceHistory     {1 ConvergenceHistory_t I4 1 0}
  GoverningEquations           {1 GoverningEquations_t C1 {} 0}
  Gravity                      {1 Gravity_t MT {} 0}
  GravityVector                {1 DataArray_t R4 3 0}
  GridConnectivity             {0 GridConnectivity_t C1 {} 1}
  GridConnectivity1to1         {0 GridConnectivity1to1_t C1 {} 1}
  GridConnectivityProperty     {1 GridConnectivityProperty_t MT {} 0}
  GridConnectivityRegionName   {1 Descriptor_t C1 {} 1}
  GridConnectivityType         {1 GridConnectivityType_t C1 {} 0}
  GridCoordinates              {0 GridCoordinates_t MT {} 1}
  GridCoordinatesPointers      {1 DataArray_t C1 32 0}
  GridLocation                 {1 GridLocation_t C1 {} 0}
  GridVelocity                 {0 DataArray_t R4 {} 1}
  IndexArray                   {0 IndexArray_t I4 {} 0}
  IndexRange                   {0 IndexRange_t I4 {} 0}
  IntegralData                 {0 IntegralData_t MT {} 1}
  IntegralDataValue            {0 DataArray_t R4 1 1}
  InterpolantsDonor            {1 DataArray_t R4 {} 0}
  InwardNormalIndex            {1 \"int[IndexDimension]\" I4 {} 0}
  InwardNormalList             {1 IndexArray_t R4 {} 0}
  IterationValues              {1 DataArray_t I4 {} 0}
  NeumannData                  {1 BCData_t MT {} 0}
  NormDefinitions              {1 Descriptor_t C1 {} 0}
  NumberOfFamilies             {1 DataArray_t I4 {} 0}
  NumberOfZones                {1 DataArray_t I4 {} 0}
  Ordinal                      {1 Ordinal_t I4 1 0}
  OriginLocation               {1 DataArray_t R4 {3 2} 0}
  OversetHoles                 {0 OversetHoles_t MT {} 1}
  ParentData                   {1 DataArray_t I4 {} 0}
  Periodic                     {1 Periodic_t MT {} 0}
  PointList                    {1 IndexArray_t I4 {} 0}
  PointListDonor               {1 IndexArray_t I4 {} 0}
  PointRange                   {1 IndexRange_t I4 {} 0}
  PointRangeDonor              {1 IndexRange_t I4 {} 0}
  ReferenceState               {1 ReferenceState_t MT {} 0}
  ReferenceStateDescription    {1 Descriptor_t C1 {} 0}
  ReferenceStateValue          {0 DataArray_t R4 1 1}
  RegionName                   {1 DataArray_t C1 32 0}
  RigidGridMotion              {0 RigidGridMotion_t C1 {} 1}
  RigidGridMotionPointers      {1 DataArray_t C1 32 0}
  RigidRotationAngle           {1 DataArray_t R4 3 0}
  RigidRotationRate            {1 DataArray_t R4 3 0}
  RigidVelocity                {1 DataArray_t R4 3 0}
  Rind                         {1 Rind_t I4 {} 0}
  RotatingCoordinates          {1 RotatingCoordinates_t MT {} 0}
  RotationAngle                {1 DataArray_t R4 3 0}
  RotationCenter               {1 DataArray_t R4 3 0}
  RotationRateVector           {1 DataArray_t R4 3 0}
  SimulationType               {1 SimulationType_t C1 {} 0}
  SolutionData                 {0 DataArray_t R4 {} 1}
  SurfaceArea                  {1 DataArray_t R4 1 0}
  ThermalConductivityModel     {1 ThermalConductivityModel_t C1 {} 0}
  ThermalRelaxationModel       {1 ThermalRelaxationModel_t C1 {} 0}
  TimeValues                   {1 DataArray_t R4 {} 0}
  Transform                    {1 \"int[IndexDimension]\" I4 {} 0}
  Translation                  {1 DataArray_t R4 3 0}
  TurbulenceClosure            {1 TurbulenceClosure_t C1 {} 0}
  TurbulenceModel              {1 TurbulenceModel_t C1 {} 0}
  UserDefinedData              {0 UserDefinedData_t MT {} 1}
  ViscosityModel               {1 ViscosityModel_t C1 {} 0}
  WallFunction                 {1 WallFunction_t MT {} 0}
  WallFunctionType             {1 WallFunctionType_t C1 {} 0}
  Zone                         {0 Zone_t I4 {} 1}
  ZoneBC                       {1 ZoneBC_t MT {} 0}
  ZoneConvergenceHistory       {1 ConvergenceHistory_t I4 1 0}
  ZoneGridConnectivity         {1 ZoneGridConnectivity_t MT {} 0}
  ZoneGridConnectivityPointers {1 DataArray_t C1 32 0}
  ZoneIterativeData            {0 ZoneIterativeData_t MT {} 0}
  ZonePointers                 {1 DataArray_t C1 32 0}
  ZoneSubRegion                {0 ZoneSubRegion_t I4 {} 1}
  ZoneSubRegionPointers        {1 DataArray_t C1 32 0}
  ZoneType                     {1 ZoneType_t C1 {} 0}
}

array set CGNSnodeChildren {
  / {CGNSBase CGNSLibraryVersion}
  ArbitraryGridMotion_t {DataClass Descriptor DimensionalUnits \
      GridLocation GridVelocity Rind UserDefinedData}
  Area_t {AreaType Descriptor RegionName SurfaceArea UserDefinedData}
  AverageInterface_t {AverageInterfaceType Descriptor UserDefinedData}
  Axisymmetry_t {AxisymmetryAngle AxisymmetryAxisVector \
      AxisymmetryReferencePoint CoordinateNames DataClass \
      Descriptor DimensionalUnits UserDefinedData}
  BaseIterativeData_t {DataArray DataClass Descriptor DimensionalUnits \
      FamilyPointers IterationValues NumberOfFamilies NumberOfZones \
      TimeValues UserDefinedData ZonePointers}
  BC_t {BCDataSet BCProperty DataClass Descriptor DimensionalUnits \
      ElementList ElementRange FamilyName GridLocation InwardNormalIndex \
      InwardNormalList Ordinal PointList PointRange \
      ReferenceState UserDefinedData}
  BCData_t {DataArray DataClass Descriptor DimensionalUnits UserDefinedData}
  BCDataSet_t {DataClass Descriptor DimensionalUnits DirichletData \
      NeumannData ReferenceState UserDefinedData}
  BCProperty_t {Area Descriptor UserDefinedData WallFunction}
  CGNSBase_t {Axisymmetry BaseIterativeData DataClass Descriptor \
      DimensionalUnits Family FlowEquationSet GlobalConvergenceHistory \
      Gravity IntegralData ReferenceState RotatingCoordinates \
      SimulationType UserDefinedData Zone}
  ChemicalKineticsModel_t {DataArray DataClass Descriptor \
      DimensionalUnits UserDefinedData}
  ConvergenceHistory_t {ConvergenceDataArray DataClass Descriptor \
      DimensionalUnits NormDefinitions UserDefinedData}
  DataArray_t {DataConversion DataClass Descriptor \
      DimensionalExponents DimensionalUnits}
  DiscreteData_t {DataClass Descriptor DimensionalUnits \
      DiscreteDataArray GridLocation Rind UserDefinedData}
  Elements_t {Descriptor ElementConnectivity ElementRange \
      ParentData Rind UserDefinedData}
  Family_t {Descriptor FamilyBC GeometryReference Ordinal UserDefinedData}
  FamilyBCDataSet_t {DataClass Descriptor DimensionalUnits DirichletData \
      NeumannData ReferenceState UserDefinedData}
  FlowEquationSet_t {ChemicalKineticsModel DataClass Descriptor \
      DimensionalUnits EquationDimension GasModel GoverningEquations \
      ThermalConductivityModel ThermalRelaxationModel TurbulenceClosure \
      TurbulenceModel UserDefinedData ViscosityModel}
  FlowSolution_t {DataClass Descriptor DimensionalUnits \
      GridLocation Rind SolutionData UserDefinedData}
  GasModel_t {DataArray DataClass Descriptor DimensionalUnits \
      UserDefinedData}
  GeometryReference_t {Descriptor GeometryEntity GeometryFile \
      GeometryFormat UserDefinedData}
  GoverningEquations_t {Descriptor DiffusionModel UserDefinedData}
  Gravity_t {DataClass Descriptor DimensionalUnits \
      GravityVector UserDefinedData}
  GridConnectivity_t {CellListDonor Descriptor GridConnectivityProperty \
      GridConnectivityType GridLocation InterpolantsDonor Ordinal \
      PointList PointListDonor PointRange UserDefinedData}
  GridConnectivity1to1_t {Descriptor Ordinal PointRange PointRangeDonor \
      Transform UserDefinedData}
  GridConnectivityProperty_t {AverageInterface Descriptor Periodic \
      UserDefinedData}
  GridCoordinates_t {CoordinateData DataClass Descriptor DimensionalUnits \
      Rind UserDefinedData}
  IntegralData_t {DataClass Descriptor DimensionalUnits \
      IntegralDataValue UserDefinedData}
  OversetHoles_t {Descriptor GridLocation PointList PointRange \
      UserDefinedData}
  Periodic_t {DataClass Descriptor DimensionalUnits RotationAngle \
      RotationCenter Translation UserDefinedData}
  ReferenceState_t {DataClass Descriptor DimensionalUnits \
      ReferenceStateDescription ReferenceStateValue UserDefinedData}
  RigidGridMotion_t {DataArray DataClass Descriptor DimensionalUnits \
      OriginLocation RigidRotationAngle RigidRotationRate \
      RigidVelocity UserDefinedData}
  RotatingCoordinates_t {DataClass Descriptor DimensionalUnits \
      RotationCenter RotationRateVector UserDefinedData}
  ThermalConductivityModel_t {DataArray DataClass Descriptor \
      DimensionalUnits UserDefinedData}
  ThermalRelaxationModel_t {DataArray DataClass Descriptor \
      DimensionalUnits UserDefinedData}
  TurbulenceClosure_t {DataArray DataClass Descriptor \
      DimensionalUnits UserDefinedData}
  TurbulenceModel_t {DataArray DataClass Descriptor DiffusionModel \
      DimensionalUnits UserDefinedData}
  UserDefinedData_t {DataArray DataClass Descriptor DimensionalUnits}
  ViscosityModel_t {DataArray DataClass Descriptor DimensionalUnits \
      UserDefinedData}
  WallFunction_t {Descriptor UserDefinedData WallFunctionType}
  Zone_t {ArbitraryGridMotion DataClass Descriptor DiscreteData \
      DimensionalUnits Elements FamilyName FlowEquationSet FlowSolution \
      GridCoordinates IntegralData Ordinal ReferenceState RigidGridMotion \
      RotatingCoordinates UserDefinedData ZoneBC ZoneConvergenceHistory \
      ZoneGridConnectivity ZoneIterativeData ZoneType}
  ZoneBC_t {BC DataClass Descriptor DimensionalUnits ReferenceState \
      UserDefinedData}
  ZoneGridConnectivity_t {Descriptor GridConnectivity \
      GridConnectivity1to1 OversetHoles UserDefinedData}
  ZoneIterativeData_t {ArbitraryGridMotionPointers DataArray DataClass \
      Descriptor DimensionalUnits FlowSolutionsPointers \
      GridCoordinatesPointers RigidGridMotionPointers UserDefinedData}
  ZoneSubRegion_t {BCRegionName DataArray DataClass DimensionalUnits \
      Descriptor FamilyName GridConnectivityRegionName GridLocation \
      PointList PointRange Rind UserDefinedData}
}

array set CGNSdataValues {
  AdditionalUnits_t {\
      {Null UserDefined Ampere Abampere Statampere Edison auCurrent} \
      {Null UserDefined Mole Entities StandardCubicFoot StandardCubicMeter} \
      {Null UserDefined Candela Candle Carcel Hefner Violle}}
  AngleUnits_t {Null UserDefined Degree Radian}
  ArbitraryGridMotion_t {Null UserDefined NonDeformingGrid DeformingGrid}
  AreaType_t {Null UserDefined BleedArea CaptureArea}
  AverageInterfaceType_t {Null UserDefined AverageAll AverageCircumferential \
      AverageRadial AverageI AverageJ AverageK}
  BC_t {Null UserDefined BCAxisymmetricWedge BCDegenerateLine \
      BCDegeneratePoint BCDirichlet BCExtrapolate BCFarfield BCGeneral \
      BCInflow BCInflowSubsonic BCInflowSupersonic BCNeumann BCOutflow \
      BCOutflowSubsonic BCOutflowSupersonic BCSymmetryPlane BCSymmetryPolar \
      BCTunnelInflow BCTunnelOutflow BCWall BCWallInviscid BCWallViscous \
      BCWallViscousHeatFlux BCWallViscousIsothermal FamilySpecified}
  BCData_t {Null UserDefined Dirichlet Neumann}
  BCDataSet_t {Null UserDefined BCAxisymmetricWedge BCDegenerateLine \
      BCDegeneratePoint BCDirichlet BCExtrapolate BCGeneral \
      BCInflowSubsonic BCInflowSupersonic BCNeumann \
      BCOutflowSubsonic BCOutflowSupersonic BCSymmetryPlane BCSymmetryPolar \
      BCTunnelInflow BCTunnelOutflow BCWall BCWallInviscid BCWallViscous \
      BCWallViscousHeatFlux BCWallViscousIsothermal FamilySpecified}
  ChemicalKineticsModel_t {Null UserDefined Frozen ChemicalEquilibCurveFit \
      ChemicalEquilibMinimization ChemicalNonequilib}
  DataClass_t {Null UserDefined Dimensional NormalizedByDimensional \
      NormalizedByUnknownDimensional NondimensionalParameter \
      DimensionlessConstant}
  DimensionalUnits_t {\
      {Null UserDefined Kilogram Gram Slug PoundMass} \
      {Null UserDefined Meter Centimeter Millimeter Foot Inch} \
      {Null UserDefined Second} \
      {Null UserDefined Kelvin Celcius Rankine Fahrenheit} \
      {Null UserDefined Radian Degree}}
  EMConductivityModel_t {Null UserDefined Constant Frozen \
      Equilibrium_LinRessler Chemistry_LinRessler}
  EMElectricFieldModel_t {Null UserDefined Voltage Interpolated \
      Constant Frozen}
  EMMagneticFieldModel_t {Null UserDefined Interpolated \
      Constant Frozen}
  FamilyBC_t {Null UserDefined BCAxisymmetricWedge BCDegenerateLine \
      BCDegeneratePoint BCDirichlet BCExtrapolate BCFarfield BCGeneral \
      BCInflow BCInflowSubsonic BCInflowSupersonic BCNeumann BCOutflow \
      BCOutflowSubsonic BCOutflowSupersonic BCSymmetryPlane BCSymmetryPolar \
      BCTunnelInflow BCTunnelOutflow BCWall BCWallInviscid BCWallViscous \
      BCWallViscousHeatFlux BCWallViscousIsothermal FamilySpecified}
  FamilyBCDataSet_t {Null UserDefined BCAxisymmetricWedge BCDegenerateLine \
      BCDegeneratePoint BCDirichlet BCExtrapolate BCGeneral \
      BCInflowSubsonic BCInflowSupersonic BCNeumann \
      BCOutflowSubsonic BCOutflowSupersonic BCSymmetryPlane BCSymmetryPolar \
      BCTunnelInflow BCTunnelOutflow BCWall BCWallInviscid BCWallViscous \
      BCWallViscousHeatFlux BCWallViscousIsothermal}
  GasModel_t {Null UserDefined Ideal VanderWaals CaloricallyPerfect \
      ThermallyPerfect ConstantDensity RedlichKwong}
  GoverningEquations_t {Null UserDefined FullPotential Euler NSLaminar \
      NSTurbulent NSLaminarIncompressible NSTurbulentIncompressible}
  GridConnectivityType_t {Null UserDefined Overset Abutting Abutting1to1}
  GridLocation_t {Null UserDefined Vertex CellCenter FaceCenter \
      IFaceCenter JFaceCenter KFaceCenter EdgeCenter}
  LengthUnits_t {Null UserDefined Meter Centimeter Millimeter Foot Inch}
  MassUnits_t {Null UserDefined Kilogram Gram Slug PoundMass}
  RigidGridMotion_t {Null UserDefined ConstantRate VariableRate}
  SimulationType_t {Null UserDefined TimeAccurate NonTimeAccurate}
  TemperatureUnits_t {Null UserDefined Kelvin Celcius Rankine Fahrenheit}
  ThermalConductivityModel_t {Null UserDefined PowerLaw SutherlandLaw \
      ConstantPrandtl}
  ThermalRelaxationModel_t {Null UserDefined Frozen ThermalEquilib \
      ThermalNonequilib}
  TimeUnits_t {Null UserDefined Second}
  TurbulenceClosure_t {Null UserDefined EddyViscosity ReynoldsStress \
      ReynoldsStressAlgebraic}
  TurbulenceModel_t {Null UserDefined \
      Algebraic_BaldwinLomax Algebraic_CebeciSmith \
      HalfEquation_JohnsonKing OneEquation_BaldwinBarth \
      OneEquation_SpalartAllmaras TwoEquation_JonesLaunder \
      TwoEquation_MenterSST TwoEquation_Wilcox}
  ViscosityModel_t {Null UserDefined Constant PowerLaw SutherlandLaw}
  WallFunctionType_t {Null UserDefined Generic}
  ZoneType_t {Null UserDefined Structured Unstructured}
  DataType_t {Null UserDefined Integer RealSingle RealDouble Character}
  ElementType_t {Null UserDefined NODE BAR_2 BAR_3 TRI_3 TRI_6 QUAD_4 \
      QUAD_8 QUAD_9 TETRA_4 TETRA_10 PYRA_5 PYRA_14 PENTA_6 PENTA_15 \
      PENTA_18 HEXA_8 HEXA_20 HEXA_27 MIXED NGON_n}
  PointSet_t {Null UserDefined PointList PointListDonor PointRange \
      PointRangeDonor ElementRange ElementList CellListDonor}
}

array set CGNSnodeDesc {
  AdditionalExponents_t {AdditionalExponents AdditionalExponents_t {0,1} \
      {R4 or R8} 1 3 {ElectricCurrentExponent, SubstanceAmountExponent,\
      LuminousIntensityExponent}}
  AdditionalUnits_t {AdditionalUnits AdditionalUnits_t {0,1} C1 2 {32,3} \
      {For ElectricCurrent, one of: Null, UserDefined, Ampere, Abampere,\
Statampere, Edison, auCurrent

For SubstanceAmount, one of: Null, UserDefined, Mole, Entities,\
StandardCubicFoot, StandardCubicMeter

For LuminousIntensity, one of: Null, UserDefined, Candela, Candle,\
Carcel, Hefner, Violle}}
  ArbitraryGridMotion_t {{user defined} ArbitraryGridMotion_t {0,N} C1 1 \
      {length of string} {one of: Null, UserDefined, NonDeformingGrid,\
      or DeformingGrid}}
  ArbitraryGridMotionPointers {ArbitraryGridMotionPointers DataArray_t {0,1} \
      C1 2 {32,NumberOfSteps} {pointers to ArbitraryGridMotion_t nodes}}
  Area_t {Area Area_t {0,1} MT {} {} {}}
  AreaType_t {AreaType AreaType_t 1 C1 1 {length of string} {one of:\
      Null, UserDefined, BleedArea, or CaptureArea}}
  AverageInterface_t {AverageInterface AverageInterface_t {0,1} MT {} {} {}}
  AverageInterfaceType_t {AverageInterfaceType AverageInterfaceType_t 1 \
      C1 1 {length of string} {one of: Null, UserDefined, AverageAll,\
      AverageCircumferential, AverageRadial, AverageI, AverageJ or AverageK}}
  Axisymmetry_t {Axisymmetry Axisymmetry_t {0,1} MT {} {} {}}
  AxisymmetryAngle {AxisymmetryAngle DataArray_t {0,1} R4 1 1 \
      {circumferential extent}}
  AxisymmetryAxisVector {AxisymmetryAxisVector DataArray_t 1 R4 1 2 \
      {direction cosines of rotation axis}}
  AxisymmetryReferencePoint {AxisymmetryReferencePoint DataArray_t 1 R4 1 2 \
      {origin for defining rotation axis}}
  BaseIterativeData_t {{user defined} BaseIterativeData_t {0,1} I4 1 1 \
      {NumberOfSteps}}
  BC_t {{user defined} BC_t {0,N} C1 1 {length of string} \
      {one of: Null, UserDefined, BCAxisymmetricWedge, BCDegenerateLine,\
      BCDegeneratePoint, BCDirichlet, BCExtrapolate, BCFarfield, BCGeneral,\
      BCInflow, BCInflowSubsonic, BCInflowSupersonic, BCNeumann,\
      BCOutflow, BCOutflowSubsonic, BCOutflowSupersonic,\
      BCSymmetryPlane, BCSymmetryPolar, BCTunnelInflow,\
      BCTunnelOutflow, BCWall, BCWallInviscid, BCWallViscous,\
      BCWallViscousHeatFlux, BCWallViscousIsothermal or FamilySpecified}}
  BCData_t {{user defined} BCData_t {0,1} MT {} {} {}}
  BCDataSet_t {{user defined} BCDataSet_t {0,N} C1 1 {length of string} \
      {BCTypeSimple value, one of: Null, UserDefined, BCAxisymmetricWedge,\
      BCDegenerateLine, BCDegeneratePoint, BCDirichlet, BCExtrapolate,\
      BCGeneral, BCInflowSubsonic, BCInflowSupersonic, BCNeumann,\
      BCOutflowSubsonic, BCOutflowSupersonic, BCSymmetryPlane,\
      BCSymmetryPolar, BCTunnelInflow, BCTunnelOutflow, BCWall,\
      BCWallInviscid, BCWallViscous, BCWallViscousHeatFlux,\
      BCWallViscousIsothermal or FamilySpecified}}
  BCProperty_t {BCProperty BCProperty_t {0,1} MT {} {} {}}
  BCRegionName {BCRegionName Descriptor_t {0,1} C1 1 \
      {length of string} {name of a ZoneBC node}}
  CellListDonor {CellListDonor IndexArray_t {0,1} I4 2 \
      {IndexDimension of donor,ListLength} \
      {list of indices for cells on adjoining patch}}
  CGNSBase_t {{user defined} CGNSBase_t {0,N} I4 1 2 \
      {CellDimension, PhysicalDimension}}
  CGNSLibraryVersion_t {CGNSLibraryVersion CGNSLibraryVersion_t 1 R4 1 1 \
      {CGNS Mid-Level Library version number}}
  ChemicalKineticsModel_t {ChemicalKineticsModel ChemicalKineticsModel_t \
      {0,1} C1 1 {length of string} {one of: Null, UserDefined, Frozen,\
      ChemicalEquilibCurveFit, ChemicalEquilibMinimization,\
      or ChemicalNonequilib}}
  ConvergenceDataArray {{user defined} DataArray_t {0,N} {C1,I4,R4 or R8} \
      1 NumIterations {convergence data}}
  ConvergenceHistory_t {{user defined} ConvergenceHistory_t {0,1} I4 1 1 \
      {number of iterations}}
  CoordinateNames {CoordinateNames DataArray_t {0,1} C1 2 {32,2} \
      {dataname identifiers for coordinates}}
  CoordinateData {{user defined} DataArray_t {0,N} {R4 or R8} 1 \
      NumberOfVertices {coordinate component array. Data-name identifiers\
      for coordinates are: CoordinateX, CoordinateY, CoordinateZ,\
      CoordinateR, CoordinateTheta, CoordinatePhi, CoordinateXi,\
      CoordinateEta, CoordinateZeta, CoordinateNormal and\
      CoordinateTangential}}
  DataArray_t {{user defined} DataArray_t {0,N} {C1,I4,R4 or R8} \
      {context dependent} {context dependent} {data values}}
  DataClass_t {DataClass DataClass_t {0,1} C1 1 {length of string} \
      {one of: Null, UserDefined, Dimensional, NormalizedByDimensional,\
      NormalizedByUnknownDimensional, NondimensionalParameter or\
      DimensionlessConstant}}
  DataConversion_t {DataConversion DataConversion_t {0,1} {R4 or R8} 1 2 \
      {ConversionScale, ConversionOffset}}
  Descriptor_t {{user defined} Descriptor_t {0,N} C1 1 {length of string} \
      {description string}}
  DimensionalExponents_t {DimensionalExponents DimensionalExponents_t {0,1} \
      {R4 or R8} 1 5 {MassExponent, LengthExponent, TimeExponent,\
      TemperatureExponent, AngleExponent}}
  DimensionalUnits_t {DimensionalUnits DimensionalUnits_t {0,1} C1 2 {32,5} \
      {For mass, one of: Null, UserDefined, Kilogram, Gram, Slug, PoundMass

For length, one of: Null, UserDefined, Meter, Centimeter, Millimeter, Foot, Inch

For time, one of: Null, UserDefined, Second

For temperature, one of: Null, UserDefined, Kelvin, Celsius, Rankine, Fahrenheit

For angles, one of: Null, UserDefined, Degree, Radian}}
  DirichletData {DirichletData BCData_t {0,1} MT {} {} {}}
  DiscreteData_t {{user defined} DiscreteData_t {0,N} MT {} {} {}}
  DiscreteDataArray {{user defined} DataArray_t {0,N} {C1,I4,R4 or R8} \
      IndexDimension {number of vertices or cells} {additional solution data\
      not normally part of the flow solution}}
  ElementConnectivity {ElementConnectivity DataArray_t 1 I4 1 \
      {ElementDataSize} {element connectivity table}}
  ElementList {ElementList IndexArray_t {0,1} I4 2 \
      {IndexDimension,ListLength} {list of indices for cells}}
  ElementRange {ElementRange IndexRange_t 1 I4 1 2 {begin and end indices}}
  Elements_t {{user defined} Elements_t {0,N} I4 1 2 \
      {ElementType, ElementSizeBoundary

element types are: 0:Null, 1:UserDefined, 2:NODE, 3:BAR_2, 4:BAR_3,\
5:TRI_3, 6:TRI_6, 7:QUAD_4, 8:QUAD_8, 9:QUAD_9, 10:TETRA_4, 11:TETRA_10,\
12:PYRA_5, 13:PYRA_14, 14:PENTA_6, 15:PENTA_15, 16:PENTA_18, 17:HEXA_8,\
18:HEXA_20, 19:HEXA_27, 20:MIXED, 21+:NGON_n}}
  EMConductivityModel_t {EMConductivityModel EMConductivityModel_t \
      {0,1} C1 1 {length of string} {one of: Null, UserDefined, Constant,\
Frozen, Equilibrium_LinRessler or Chemistry_LinRessler}}
  EMElectricFieldModel_t {EMElectricFieldModel EMElectricFieldModel_t \
      {0,1} C1 1 {length of string} {one of: Null, UserDefined, Voltage,\
Interpolated, Constant or Frozen}}
  EMMagneticFieldModel_t {EMMagneticFieldModel EMMagneticFieldModel_t \
      {0,1} C1 1 {length of string} {one of: Null, UserDefined, Interpolated,\
Constant or Frozen}}
  EquationDimension {EquationDimension \"int\" {0,1} I4 1 1 \
      {EquationDimension value}}
  Family_t {{user defined} Family_t {0,N} MT {} {} {}}
  FamilyBC_t {FamilyBC FamilyBC_t {0,1} C1 1 {length of string} \
      {one of: Null, UserDefined, BCAxisymmetricWedge, BCDegenerateLine,\
      BCDegeneratePoint, BCDirichlet, BCExtrapolate, BCFarfield, BCGeneral,\
      BCInflow, BCInflowSubsonic, BCInflowSupersonic, BCNeumann,\
      BCOutflow, BCOutflowSubsonic, BCOutflowSupersonic,\
      BCSymmetryPlane, BCSymmetryPolar, BCTunnelInflow,\
      BCTunnelOutflow, BCWall, BCWallInviscid, BCWallViscous,\
      BCWallViscousHeatFlux, BCWallViscousIsothermal or FamilySpecified}}
  FamilyBCDataSet_t {{user defined} FamilyBCDataSet_t {0,N} C1 1 {length of string} \
      {BCTypeSimple value, one of: Null, UserDefined, BCAxisymmetricWedge,\
      BCDegenerateLine, BCDegeneratePoint, BCDirichlet, BCExtrapolate,\
      BCGeneral, BCInflowSubsonic, BCInflowSupersonic, BCNeumann,\
      BCOutflowSubsonic, BCOutflowSupersonic, BCSymmetryPlane,\
      BCSymmetryPolar, BCTunnelInflow, BCTunnelOutflow, BCWall,\
      BCWallInviscid, BCWallViscous, BCWallViscousHeatFlux,\
      BCWallViscousIsothermal}}
  FamilyName_t {FamilyName FamilyName_t {0,1} C1 1 {length of string} \
      {name of CFD family}}
  FamilyPointers {FamilyPointers DataArray_t {0,1} C1 3 \
      {32,MaxNumberOfZones,NumberOfSteps} {pointers to Family_t nodes}}
  FlowEquationSet_t {FlowEquationSet FlowEquationSet_t {0,1} MT {} {} {}}
  FlowSolution_t {{user defined} FlowSolution_t {0,N} MT {} {} {}}
  FlowSolutionsPointers {FlowSolutionsPointers DataArray_t {0,1} C1 2 \
      {32,NumberOfSteps} {pointers to FlowSolution_t nodes}}
  GasModel_t {GasModel GasModel_t {0,1} C1 1 {length of string} \
      {one of: Null, UserDefined, Ideal, VanderWaals, CaloricallyPerfect,\
       ThermallyPerfect, ConstantDensity, or RedlichKwong}}
  GeometryEntity_t {{user defined} GeometryEntity_t {0,N} MT {} {} {}}
  GeometryFile_t {GeometryFile GeometryFile_t 1 C1 1 {length of string} \
      {name of the geometry file}}
  GeometryFormat_t {GeometryFormat GeometryFormat_t 1 C1 1 {length of string} \
      {name of the geometry format}}
  GeometryReference_t {{user defined} GeometryReference_t {0,N} MT {} {} {}}
  GlobalConvergenceHistory {GlobalConvergenceHistory ConvergenceHistory_t \
      {0,1} I4 1 1 {number of iterations}}
  GoverningEquations_t {GoverningEquations GoverningEquations_t {0,1} \
      C1 1 {length of string} {one of: Null, UserDefined, FullPotential,\
      Euler, NSLaminar, NSTurbulent, NSLaminarIncompressible\
      or NSTurbulentIncompressible}}
  Gravity_t {Gravity Gravity_t {0,1} MT {} {} {}}
  GravityVector {GravityVector DataArray_t 1 {R4 or R8} 1 PhysicalDimension \
      {components of the gravity vector}}
  GridConnectivity_t {{user defined} GridConnectivity_t {0,N} C1 1 \
      {length of string} {ZoneDonorName}}
  GridConnectivity1to1_t {{user defined} GridConnectivity1to1_t {0,N} C1 1 \
      {length of string} {ZoneDonorName}}
  GridConnectivityProperty_t {GridConnectivityProperty \
      GridConnectivityProperty_t {0,1} MT {} {} {}}
  GridConnectivityRegionName {GridConnectivityRegionName Descriptor_t {0,1} \
      C1 1 {length of string} {name of a ZoneGridConnectivity node}}
  GridConnectivityType_t {GridConnectivityType GridConnectivityType_t {0,1} \
      C1 1 {length of string} {one of: Null, UserDefined, Overset,\
      Abutting, or Abutting1to1}}
  GridCoordinates_t {{user defined} GridCoordinates_t {0,N} MT {} {} {}}
  GridCoordinatesPointers {GridCoordinatesPointers DataArray_t {0,1} \
      C1 2 {32,NumberOfSteps} {pointers to GridCoordinates_t nodes}}
  GridLocation_t {GridLocation GridLocation_t {0,1} C1 1 {length of string} \
      {one of: Null, UserDefined, Vertex, CellCenter, FaceCenter,\
      IFaceCenter, JFaceCenter, KFaceCenter or EdgeCenter}}
  GridVelocity {{user defined} DataArray_t {0,N} {R4 or R8} 1 \
      NumberOfVertices {component of grid velocity. Data-name identifiers\
      are: GridVelocityX, GridVelocityY, GridVelocityZ, GridVelocityR,\
      GridVelocityTheta, GridVelocityPhi, GridVelocityXi,\
      GridVelocityEta and GridVelocityZeta}}
  IndexArray_t {{user defined} IndexArray_t {0,1} I4 2 \
      {IndexDimension,number of items in the list} {Index coordinates of\
      each point or element in the list}}
  IndexRange_t {{user defined} IndexRange_t {0,1} I4 2 {IndexDimension,2} \
      {first indices, last indices}}
  \"int\" {{user defined} \"int\" {0,1} I4 1 1 {an integer value}}
  \"int[IndexDimension]\" {{user defined} \"int[IndexDimension]\" \
      {0,1} I4 1 IndexDimension {array of integer values}}
  \"int[2*IndexDimension]\" {{user defined} \"int[2*IndexDimension]\" \
      {0,1} I4 1 {2*IndexDimension} {array of integer values}}
  \"int[1+...+IndexDimension]\" {{user defined} \"int[1+...+IndexDimension]\" \
      {0,1} I4 1 {1 + ... + IndexDimension} {array of integer values}}
  IntegralData_t {{user defined} IntegralData_t {0,N} MT {} {} {}}
  IntegralDataValue {{user defined} DataArray_t {0,N} {C1,I4,R4 or R8} \
      1 1 {integral data value}}
  InterpolantsDonor {InterpolantsDonor DataArray_t {0,1} {R4 or R8} 2 \
      {CellDimension,PointListSize} {interpolants for each node}}
  InwardNormalIndex {InwardNormalIndex \"int[IndexDimension]\" {0,1} I4 \
      1 IndexDimension {index of inward normal}}
  InwardNormalList {InwardNormalList IndexArray_t {0,1} {R4 or R8} 2 \
      {PhysicalDimension,number of items in the list} {physical-space\
      normal vectors at each point or element in the list}}
  IterationValues {IterationValues DataArray_t {0,1} I4 1 NumberOfSteps \
      {array of interation values}}
  NeumannData {NeumannData BCData_t {0,1} MT {} {} {}}
  NormDefinitions {NormDefinitions Descriptor_t {0,1} C1 1 \
      {length of string} {description of convergence information}}
  NumberOfFamilies {NumberOfFamilies DataArray_t {0,1} I4 1 NumberOfSteps \
      {array of number of families involved in each time step}}
  NumberOfZones {NumberOfZones DataArray_t {0,1} I4 1 NumberOfSteps \
      {array of number of zones involved in each time step}}
  Ordinal_t {Ordinal Ordinal_t {0,1} I4 1 1 \
      {user-defined ordinal number (an integer)}}
  OriginLocation {OriginLocation DataArray_t 1 R4 2 {PhysicalDimension,2} \
      {coordinates of origin before and after motion}}
  OversetHoles_t {{user defined} OversetHoles_t {0,N} MT {} {} {}}
  ParentData {ParentData DataArray_t {0,1} I4 2 {ElementSize,4} \
      {Parent1[ElementSize], Parent2[ElementSize], SideOfParent1[ElementSize],\
      SideOfParent2[ElementSize]}}
  Periodic_t {Periodic Periodic_t {0,1} MT {} {} {}}
  PointList {PointList IndexArray_t {0,1} I4 2 {IndexDimension,ListLength} \
      {list of indices for vertices or cells}}
  PointListDonor {PointListDonor IndexArray_t {0,1} I4 2 \
      {IndexDimension of donor,ListLength} \
      {list of indices for vertices or cells on adjoining patch}}
  PointRange {PointRange IndexRange_t 1 I4 2 {IndexDimension,2} \
      {begin[IndexDimension], end[IndexDimension]}}
  PointRangeDonor {PointRangeDonor IndexRange_t 1 I4 2 \
      {IndexDimension of donor,2} \
      {begin[IndexDimension], end[IndexDimension] for adjoining patch}}
  ReferenceState_t {ReferenceState ReferenceState_t {0,1} MT {} {} {}}
  ReferenceStateDescription {ReferenceStateDescription Descriptor_t {0,1} \
      C1 1 {length of string} {reference state description}}
  ReferenceStateValue {{user defined} DataArray_t {0,N} {C1,I4,R4 or R8} \
      1 1 {reference state quantity}}
  RegionName {RegionName DataArray_t 1 C1 1 32 {name of region}}
  RigidGridMotion_t {{user defined} RigidGridMotion_t {0,N} C1 1 \
      {length of string} {one of: Null, UserDefined, ConstantRate\
      or VariableRate}}
  RigidGridMotionPointers {RigidGridMotionPointers DataArray_t {0,1} C1 2 \
      {32,NumberOfSteps} {pointers to RigidGridMotion_t nodes}}
  RigidRotationAngle {RigidRotationAngle DataArray_t {0,1} {R4 or R8} \
      1 PhysicalDimension {rotation angles about each axis of the\
      translated coordinate system}}
  RigidRotationRate {RigidRotationRate DataArray_t {0,1} {R4 or R8} \
      1 PhysicalDimension {rotation rate vector about each axis of the\
      translated coordinate system}}
  RigidVelocity {RigidVelocity DataArray_t {0,1} {R4 or R8} \
      1 PhysicalDimension {grid velocity vector of the origin translation}}
  Rind_t {Rind Rind_t {0,1} I4 1 {2*IndexDimension} \
      {number of planes of extra data in low i, high i, low j, high j, etc.}}
  RotatingCoordinates_t {RotatingCoordinates RotatingCoordinates_t {0,1} \
      MT {} {} {}}
  RotationAngle {RotationAngle DataArray_t 1 {R4 or R8} 1 \
      PhysicalDimension {defines angle from current interface to\
      the connecting interface}}
  RotationCenter {RotationCenter DataArray_t 1 {R4 or R8} 1 \
      PhysicalDimension {coordinates of center of rotation}}
  RotationRateVector {RotationRateVector DataArray_t 1 R4 1 PhysicalDimension \
      {components of the angular velocity about the center of rotation}}
  SimulationType_t {SimulationType SimulationType_t {0,1} C1 1 \
      {length of string} {one of: Null, UserDefined, TimeAccurate\
      or NonTimeAccurate}}
  SolutionData {{user defined} DataArray_t {0,N} {C1,I4,R4 or R8} \
      IndexDimension {number of vertices or cells} {solution data.\
      See the documentation for a list of data-name identifiers}}
  SurfaceArea {SurfaceArea DataArray_t 1 R4 1 1 {size of area}}
  ThermalConductivityModel_t {ThermalConductivityModel \
      ThermalConductivityModel_t {0,1} C1 1 {length of string} \
      {one of: Null, UserDefined, PowerLaw, SutherlandLaw or ConstantPrandtl}}
  ThermalRelaxationModel_t {ThermalRelaxationModel \
      ThermalRelaxationModel_t {0,1} C1 1 {length of string} \
      {one of: Null, UserDefined, Frozen, ThermalEquilib or ThermalNonequilib}}
  TimeValues {TimeValues DataArray_t {0,1} {R4 or R8} 1 NumberOfSteps \
      {array of iteration time values}}
  Transform {Transform \"int[IndexDimension]\" {0,1} I4 1 IndexDimension \
      {shorthand for the connectivity transformation matrix}}
  Translation {Translation DataArray_t 1 {R4 or R8} 1 \
      PhysicalDimension {defines translation from current interface to\
      the connecting interface}}
  TurbulenceClosure_t {TurbulenceClosure TurbulenceClosure_t {0,1} C1 1 \
      {length of string} {one of: Null, UserDefined, EddyViscosity,\
      ReynoldsStress or ReynoldsStressAlgebraic}}
  TurbulenceModel_t {TurbulenceModel TurbulenceModel_t {0,1} C1 1 \
      {length of string} {one of: Null, UserDefined,\
      Algebraic_BaldwinLomax, Algebraic_CebeciSmith,\
      HalfEquation_JohnsonKing, OneEquation_BaldwinBarth,\
      OneEquation_SpalartAllmaras, TwoEquation_JonesLaunder,\
      TwoEquation_MenterSST or TwoEquation_Wilcox}}
  UserDefinedData_t {{user defined} UserDefinedData_t {0,N} MT {} {} {}}
  ViscosityModel_t {ViscosityModel ViscosityModel_t {0,1} C1 1 \
      {length of string} {one of: Null, UserDefined, Constant,\
      PowerLaw or SutherlandLaw}}
  WallFunction_t {WallFunction WallFunction_t {0,1} MT {} {} {}}
  WallFunctionType_t {WallFunctionType WallFunctionType_t 1 C1 1 \
      {length of string} {one of: Null, UserDefined, or Generic}}
  Zone_t {{user defined} Zone_t {0,N} I4 2 {IndexDimension,3} \
      {VertexSize[IndexDimension], CellSize[IndexDimension],\
       VertexSizeBoundary[IndexDimension]}}
  ZoneBC_t {ZoneBC ZoneBC_t {0,1} MT {} {} {}}
  ZoneConvergenceHistory {ZoneConvergenceHistory ConvergenceHistory_t \
      {0,1} I4 1 1 {number of iterations}}
  ZoneGridConnectivity_t {ZoneGridConnectivity ZoneGridConnectivity_t \
      {0,1} MT {} {} {}}
  ZoneGridConnectivityPointers {ZoneGridConnectivityPointers DataArray_t \
      {0,1} C1 2 {32,NumberOfSteps} \
      {pointers to ZoneGridConnectivity_t nodes}}
  ZoneIterativeData_t {{user defined} ZoneIterativeData_t {0,1} MT {} {} {}}
  ZonePointers {ZonePointers DataArray_t {0,1} C1 3 \
      {32,MaxNumberOfZones,NumberOfSteps} {pointers to Zone_t nodes}}
  ZoneSubRegion_t {{user defined} ZoneSubRegion_t {0,N} I4 1 \
      RegionCellDimension {region dimension}}
  ZoneSubRegionPointers {ZoneSubRegionPointers DataArray_t \
      {0,1} C1 2 {32,NumberOfSteps} \
      {pointers to ZoneSubRegion_t nodes}}
  ZoneType_t {ZoneType ZoneType_t 1 C1 1 {length of string} \
      {one of: Null, UserDefined, Structured or Unstructured}}
  DataType_t {{} DataType_t {} C1 1 {length of string} \
      {one of: Null, UserDefined, Integer, RealSingle, RealDouble\
      or Character}}
  ElementType_t {{} ElementType_t {} C1 1 {length of string} \
      {one of: Null, UserDefined, NODE, BAR_2, BAR_3, TRI_3, TRI_6, QUAD_4,\
      QUAD_8, QUAD_9, TETRA_4, TETRA_10, PYRA_5, PYRA_14, PENTA_6, PENTA_15,\
      PENTA_18, HEXA_8, HEXA_20, HEXA_27, MIXED, or NGON_n}}
  PointSet_t {{} PointSet_t {} C1 1 {length of string} \
      {one of: Null, UserDefined, PointList, PointListDonor, PointRange,\
      PointRangeDonor, ElementRange, ElementList, or CellListDonor}}
}

array set CGNSnodeRef {
  AdditionalExponents_t {{build DimensionalExponents} \
      {physical dimensionalexponents}}
  AdditionalUnits_t {{build DimensionalUnits} {physical dimensionalunits}}
  ArbitraryGridMotion_t {{timedep ArbitraryGridMotion} {timedep arbitrary}}
  ArbitraryGridMotionPointers {}
  Area_t {{bc Area} {bc bcproperty}}
  AreaType_t {}
  AverageInterface_t {{cnct AverageInterface} {connectivity connproperty}}
  AverageInterfaceType_t {}
  Axisymmetry_t {{gridflow Axisymmetry} {grid axisymmetry}}
  AxisymmetryAngle {{} {physical dataarray}}
  AxisymmetryAxisVector {}
  AxisymmetryReferencePoint {}
  BaseIterativeData_t {{timedep BaseIterativeData} {timedep biter}}
  BC_t {{bc BC} {bc bc}}
  BCData_t {{bc BCData} {bc bcdata}}
  BCDataSet_t {{bc BCDataSet} {bc bcdataset}}
  BCProperty_t {{bc BCProperty} {bc bcproperty}}
  BCType_t {{bc BCType} {}}
  CellListDonor {}
  CGNSBase_t {{cgnsbase CGNSBase} {structural base}}
  CGNSLibraryVersion_t {{cgnsbase CGNSLibraryVersion} {open}}
  ChemicalKineticsModel_t {{floweqn ChemicalKineticsModel} \
      {equation auxiliary}}
  ConvergenceHistory_t {{misc ConvergenceHistory} {auxiliary convergence}}
  CoordinateNames {{} {physical dataarray}}
  CoordinateData {{dataname dataname_grid} {grid gridcoordinates}}
  DataArray_t {{data DataArray} {physical dataarray}}
  DataClass_t {{build DataClass} {physical dataclass}}
  DataConversion_t {{data DataConversion} {physical dataconversion}}
  Descriptor_t {{build Descriptor} {descriptor descriptor}}
  DiffusionModel {{floweqn DiffusionModel} {equation governingequations}}
  DimensionalExponents_t {{build DimensionalExponents} \
      {physical dimensionalexponents}}
  DimensionalUnits_t {{build DimensionalUnits} {physical dimensionalunits}}
  DiscreteData_t {{misc DiscreteData} {solution discretedata}}
  ElementConnectivity {{gridflow ElementConnectivity} {}}
  ElementList {}
  ElementRange {}
  Elements_t {{gridflow Elements} {grid elements}}
  EMConductivityModel_t {{floweqn EMConductivityModel} \
      {equation auxiliary}}
  EMElectricFieldModel_t {{floweqn EMElectricFieldModel} \
      {equation auxiliary}}
  EMMagneticFieldModel_t {{floweqn EMMagneticFieldModel} \
      {equation auxiliary}}
  EquationDimension {}
  Family_t {{misc Family} {families family}}
  FamilyBC_t {{misc FamilyBC} {families familybc}}
  FamilyBCDataSet_t {{bc BCDataSet} {bc bcdataset}}
  FamilyName_t {{} {families familyname}}
  FamilyPointers {{} {physical dataarray}}
  FlowEquationSet_t {{floweqn FlowEquationSet} {equation flowequationset}}
  FlowSolution_t {{gridflow FlowSolution} {solution flowsolution}}
  FlowSolutionsPointers {}
  GasModel_t {{floweqn GasModel} {equation auxiliary}}
  GeometryEntity_t {{} {families geometry}}
  GeometryFile_t {}
  GeometryFormat_t {}
  GeometryReference_t {{misc GeometryReference} {families geometry}}
  GoverningEquations_t {{floweqn GoverningEquations} \
      {equation governingequations}}
  Gravity_t {{misc Gravity} {auxiliary gravity}}
  GravityVector {}
  GridConnectivity_t {{cnct GridConnectivity} {connectivity general}}
  GridConnectivity1to1_t {{cnct GridConnectivity1to1} {connectivity 1to1}}
  GridConnectivityProperty_t {{cnct GridConnectivityProperty} \
      {connectivity connproperty}}
  GridConnectivityType_t {}
  GridCoordinates_t {{gridflow GridCoordinates} {grid gridcoordinates}}
  GridCoordinatesPointers {}
  GridLocation_t {{build GridLocation} {location gridlocation}}
  GridVelocity {}
  IndexArray_t {{build IndexArray} {}}
  IndexRange_t {{build IndexRange} {}}
  IntegralData_t {{misc IntegralData} {auxiliary integral}}
  InterpolantsDonor {}
  InwardNormalIndex {}
  InwardNormalList {}
  IterationValues {{} {physical dataarray}}
  NeumannData {}
  NormDefinitions {}
  NumberOfFamilies {{} {physical dataarray}}
  NumberOfZones {{} {physical dataarray}}
  Ordinal_t {{} {descriptor ordinal}}
  OriginLocation {}
  OversetHoles_t {{cnct OversetHoles} {connectivity overset}}
  ParentData {{} {grid elements}}
  Periodic_t {{cnct Periodic} {connectivity connproperty}}
  PointList {}
  PointListDonor {}
  PointRange {}
  PointRangeDonor {}
  ReferenceState_t {{misc ReferenceState} {auxiliary refstate}}
  ReferenceStateDescription {}
  RegionName {}
  RigidGridMotion_t {{timedep RigidGridMotion} {timedep rigid}}
  RigidGridMotionPointers {}
  RigidRotationAngle {}
  RigidRotationRate {}
  RigidVelocity {}
  Rind_t {{build Rind} {location rind}}
  RotatingCoordinates_t {{gridflow RotatingCoordinates} \
      {grid rotatingcoordinates}}
  RotationAngle {}
  RotationCenter {}
  RotationRateVector {}
  SimulationType_t {{cgnsbase SimulationType} {structural simulationtype}}
  SolutionData {{dataname dataname_flow} {solution flowsolution}}
  SurfaceArea {}
  ThermalConductivityModel_t {{floweqn ThermalConductivityModel} \
      {equation auxiliary}}
  ThermalRelaxationModel_t {{floweqn ThermalRelaxationModel} \
      {equation auxiliary}}
  TimeValues {{} {physical dataarray}}
  Transform {}
  Translation {}
  TurbulenceClosure_t {{floweqn TurbulenceClosure} {equation auxiliary}}
  TurbulenceModel_t {{floweqn TurbulenceModel} {equation auxiliary}}
  UserDefinedData_t {{misc UserDefinedData} {auxiliary userdefined}}
  ViscosityModel_t {{floweqn ViscosityModel} {equation auxiliary}}
  WallFunction_t {{bc WallFunction} {bc bcproperty}}
  WallFunctionType_t {}
  Zone_t {{cgnsbase Zone} {structural zone}}
  ZoneBC_t {{bc ZoneBC} {bc}}
  ZoneGridConnectivity_t {{cnct ZoneGridConnectivity} {connectivity}}
  ZoneIterativeData_t {{timedep ZoneIterativeData} {timedep ziter}}
  ZonePointers {{} {physical dataarray}}
  ZoneType_t {}
}

set CGNSlibraryVersion 3.1

#----- initialize CGNS nodes

proc cgns_init {{version ""}} {
  global CGNSlibraryVersion CGNSnodeChildren
  global CGNSnodeDesc CGNSdataValues

  if {$version == "" && [catch CGNSversion version]} {
    set CGNSlibraryVersion 3.1
  } else {
    set CGNSlibraryVersion $version
  }
  set version [expr int(1000.0 * $CGNSlibraryVersion + 0.5)]

  if {$version < 2100} {
    array set CGNSnodeChildren {
      ArbitraryGridMotion_t {DataClass Descriptor DimensionalUnits \
        GridLocation GridVelocity Rind}
      BaseIterativeData_t {DataArray DataClass Descriptor DimensionalUnits \
        FamilyPointers IterationValues NumberOfFamilies NumberOfZones \
        TimeValues ZonePointers}
      BCData_t {DataArray DataClass Descriptor DimensionalUnits}
      BCDataSet_t {DataClass Descriptor DimensionalUnits DirichletData \
        NeumannData ReferenceState}
      ConvergenceHistory_t {ConvergenceDataArray DataClass Descriptor \
        DimensionalUnits NormDefinitions}
      DiscreteData_t {DataClass Descriptor DimensionalUnits \
        DiscreteDataArray GridLocation Rind}
      Elements_t {Descriptor ElementConnectivity ElementRange ParentData}
      Family_t {Descriptor FamilyBC GeometryReference Ordinal}
      FlowEquationSet_t {DataClass Descriptor \
        DimensionalUnits EquationDimension GasModel GoverningEquations \
        ThermalConductivityModel ThermalRelaxationModel TurbulenceClosure \
        TurbulenceModel ViscosityModel}
      FlowSolution_t {DataClass Descriptor DimensionalUnits \
        GridLocation Rind SolutionData}
      GasModel_t {DataArray DataClass Descriptor DimensionalUnits}
      GeometryReference_t {Descriptor GeometryEntity GeometryFile \
        GeometryFormat}
      GridConnectivity1to1_t {Descriptor Ordinal PointRange PointRangeDonor \
        Transform}
      GridCoordinates_t {CoordinateData DataClass Descriptor DimensionalUnits \
        Rind}
      GoverningEquations_t {Descriptor DiffusionModel}
      IntegralData_t {DataClass Descriptor DimensionalUnits \
        IntegralDataValue}
      OversetHoles_t {Descriptor GridLocation PointList PointRange}
      ReferenceState_t {DataClass Descriptor DimensionalUnits \
        ReferenceStateDescription ReferenceStateValue}
      RigidGridMotion_t {DataArray DataClass Descriptor DimensionalUnits \
        OriginLocation RigidRotationAngle RigidRotationRate \
        RigidVelocity}
      ThermalConductivityModel_t {DataArray DataClass Descriptor \
        DimensionalUnits}
      ThermalRelaxationModel_t {DataArray DataClass Descriptor \
        DimensionalUnits}
      TurbulenceClosure_t {DataArray DataClass Descriptor \
        DimensionalUnits}
      TurbulenceModel_t {DataArray DataClass Descriptor DiffusionModel \
        DimensionalUnits}
      ViscosityModel_t {DataArray DataClass Descriptor DimensionalUnits}
      ZoneBC_t {BC DataClass Descriptor DimensionalUnits ReferenceState}
      ZoneGridConnectivity_t {Descriptor GridConnectivity \
        GridConnectivity1to1 OversetHoles}
      ZoneIterativeData_t {ArbitraryGridMotionPointers DataArray DataClass \
        Descriptor DimensionalUnits FlowSolutionsPointers \
        GridCoordinatesPointers RigidGridMotionPointers}
    }
  } else {
    array set CGNSnodeChildren {
      ArbitraryGridMotion_t {DataClass Descriptor DimensionalUnits \
        GridLocation GridVelocity Rind UserDefinedData}
      BaseIterativeData_t {DataArray DataClass Descriptor DimensionalUnits \
        FamilyPointers IterationValues NumberOfFamilies NumberOfZones \
        TimeValues UserDefinedData ZonePointers}
      BCData_t {DataArray DataClass Descriptor DimensionalUnits UserDefinedData}
      BCDataSet_t {DataClass Descriptor DimensionalUnits DirichletData \
        NeumannData ReferenceState UserDefinedData}
      ConvergenceHistory_t {ConvergenceDataArray DataClass Descriptor \
        DimensionalUnits NormDefinitions}
      DiscreteData_t {DataClass Descriptor DimensionalUnits \
        DiscreteDataArray GridLocation Rind UserDefinedData}
      Elements_t {Descriptor ElementConnectivity ElementRange \
        ParentData UserDefinedData}
      Family_t {Descriptor FamilyBC GeometryReference Ordinal UserDefinedData}
      FlowEquationSet_t {ChemicalKineticsModel DataClass Descriptor \
        DimensionalUnits EquationDimension GasModel GoverningEquations \
        ThermalConductivityModel ThermalRelaxationModel TurbulenceClosure \
        TurbulenceModel UserDefinedData ViscosityModel}
      FlowSolution_t {DataClass Descriptor DimensionalUnits \
        GridLocation Rind SolutionData UserDefinedData}
      GasModel_t {DataArray DataClass Descriptor DimensionalUnits \
        UserDefinedData}
      GeometryReference_t {Descriptor GeometryEntity GeometryFile \
        GeometryFormat UserDefinedData}
      GridConnectivity1to1_t {Descriptor Ordinal PointRange PointRangeDonor \
        Transform UserDefinedData}
      GridCoordinates_t {CoordinateData DataClass Descriptor DimensionalUnits \
        Rind UserDefinedData}
      GoverningEquations_t {Descriptor DiffusionModel UserDefinedData}
      IntegralData_t {DataClass Descriptor DimensionalUnits \
        IntegralDataValue UserDefinedData}
      OversetHoles_t {Descriptor GridLocation PointList PointRange \
        UserDefinedData}
      ReferenceState_t {DataClass Descriptor DimensionalUnits \
        ReferenceStateDescription ReferenceStateValue UserDefinedData}
      RigidGridMotion_t {DataArray DataClass Descriptor DimensionalUnits \
        OriginLocation RigidRotationAngle RigidRotationRate \
        RigidVelocity UserDefinedData}
      ThermalConductivityModel_t {DataArray DataClass Descriptor \
        DimensionalUnits UserDefinedData}
      ThermalRelaxationModel_t {DataArray DataClass Descriptor \
        DimensionalUnits UserDefinedData}
      TurbulenceClosure_t {DataArray DataClass Descriptor \
        DimensionalUnits UserDefinedData}
      TurbulenceModel_t {DataArray DataClass Descriptor DiffusionModel \
        DimensionalUnits UserDefinedData}
      ViscosityModel_t {DataArray DataClass Descriptor DimensionalUnits \
        UserDefinedData}
      ZoneBC_t {BC DataClass Descriptor DimensionalUnits ReferenceState \
        UserDefinedData}
      ZoneGridConnectivity_t {Descriptor GridConnectivity \
        GridConnectivity1to1 OversetHoles UserDefinedData}
      ZoneIterativeData_t {ArbitraryGridMotionPointers DataArray DataClass \
        Descriptor DimensionalUnits FlowSolutionsPointers \
        GridCoordinatesPointers RigidGridMotionPointers UserDefinedData}
    }
  }

  if {$version < 2000} {
    array set CGNSnodeChildren {
      CGNSBase_t {DataClass Descriptor \
        DimensionalUnits Family FlowEquationSet GlobalConvergenceHistory \
        IntegralData ReferenceState Zone}
      BC_t {BCDataSet DataClass Descriptor DimensionalUnits \
        ElementList ElementRange FamilyName GridLocation InwardNormalIndex \
        InwardNormalList Ordinal PointList PointRange ReferenceState}
      GridConnectivity_t {CellListDonor Descriptor \
        GridConnectivityType GridLocation InterpolantsDonor Ordinal \
        PointList PointListDonor PointRange}
      Zone_t {DataClass Descriptor \
        DiscreteData DimensionalUnits Elements FamilyName FlowEquationSet \
        FlowSolution GridCoordinates IntegralData Ordinal ReferenceState \
        ZoneBC ZoneConvergenceHistory ZoneGridConnectivity ZoneType}
    }
  } elseif {$version < 2100} {
    array set CGNSnodeChildren {
      CGNSBase_t {BaseIterativeData DataClass Descriptor \
        DimensionalUnits Family FlowEquationSet GlobalConvergenceHistory \
        IntegralData ReferenceState SimulationType Zone}
      BC_t {BCDataSet DataClass Descriptor DimensionalUnits \
        FamilyName GridLocation InwardNormalIndex \
        InwardNormalList Ordinal PointList PointRange ReferenceState}
      GridConnectivity_t {CellListDonor Descriptor \
        GridConnectivityType GridLocation InterpolantsDonor Ordinal \
        PointList PointListDonor PointRange}
      Zone_t {ArbitraryGridMotion DataClass Descriptor \
        DiscreteData DimensionalUnits Elements FamilyName FlowEquationSet \
        FlowSolution GridCoordinates IntegralData Ordinal ReferenceState \
        RigidGridMotion ZoneBC ZoneConvergenceHistory ZoneGridConnectivity \
        ZoneIterativeData ZoneType}
    }
  } elseif {$version < 2200} {
    array set CGNSnodeChildren {
      CGNSBase_t {BaseIterativeData DataClass Descriptor \
        DimensionalUnits Family FlowEquationSet GlobalConvergenceHistory \
        IntegralData ReferenceState SimulationType UserDefinedData Zone}
      BC_t {BCDataSet DataClass Descriptor DimensionalUnits \
        FamilyName GridLocation InwardNormalIndex \
        InwardNormalList Ordinal PointList PointRange \
        ReferenceState UserDefinedData}
      GridConnectivity_t {CellListDonor Descriptor \
        GridConnectivityType GridLocation InterpolantsDonor Ordinal \
        PointList PointListDonor PointRange UserDefinedData}
      Zone_t {ArbitraryGridMotion DataClass Descriptor \
        DiscreteData DimensionalUnits Elements FamilyName FlowEquationSet \
        FlowSolution GridCoordinates IntegralData Ordinal ReferenceState \
        RigidGridMotion UserDefinedData ZoneBC ZoneConvergenceHistory \
        ZoneGridConnectivity ZoneIterativeData ZoneType}
    }
  } else {
    array set CGNSnodeChildren {
      CGNSBase_t {Axisymmetry BaseIterativeData DataClass \
        Descriptor DimensionalUnits Family FlowEquationSet \
        GlobalConvergenceHistory Gravity IntegralData ReferenceState \
        RotatingCoordinates SimulationType UserDefinedData Zone}
      BC_t {BCDataSet BCProperty DataClass Descriptor DimensionalUnits \
        ElementList ElementRange FamilyName GridLocation InwardNormalIndex \
        InwardNormalList Ordinal PointList PointRange \
        ReferenceState UserDefinedData}
      GridConnectivity_t {CellListDonor Descriptor GridConnectivityProperty \
        GridConnectivityType GridLocation InterpolantsDonor Ordinal \
        PointList PointListDonor PointRange UserDefinedData}
      Zone_t {ArbitraryGridMotion DataClass Descriptor \
        DiscreteData DimensionalUnits Elements FamilyName FlowEquationSet \
        FlowSolution GridCoordinates IntegralData Ordinal ReferenceState \
        RigidGridMotion RotatingCoordinates UserDefinedData ZoneBC \
        ZoneConvergenceHistory ZoneGridConnectivity ZoneIterativeData ZoneType}
    }
  }

  if {$version > 2300} {
    array set CGNSnodeChildren {
      BCDataSet_t {DataClass Descriptor DimensionalUnits DirichletData \
        GridLocation NeumannData PointList PointRange ReferenceState \
        UserDefinedData}
      DimensionalUnits_t {AdditionalUnits}
      DimensionalExponents_t {AdditionalExponents}
      EMConductivityModel_t {DataArray DataClass Descriptor \
        DimensionalUnits UserDefinedData}
      EMElectricFieldModel_t {DataArray DataClass Descriptor \
        DimensionalUnits UserDefinedData}
      EMMagneticFieldModel_t {DataArray DataClass Descriptor \
        DimensionalUnits UserDefinedData}
      Family_t {Descriptor FamilyBC GeometryReference Ordinal \
        RotatingCoordinates UserDefinedData}
      FamilyBC_t {BCDataSet}
      FlowEquationSet_t {ChemicalKineticsModel DataClass Descriptor \
        DimensionalUnits EMConductivityModel EMElectricFieldModel \
        EMMagneticFieldModel EquationDimension GasModel GoverningEquations \
        ThermalConductivityModel ThermalRelaxationModel TurbulenceClosure \
        TurbulenceModel UserDefinedData ViscosityModel}
      GridConnectivity1to1_t {Descriptor GridConnectivityProperty Ordinal \
        PointRange PointRangeDonor Transform UserDefinedData}
      UserDefinedData_t {DataArray DataClass Descriptor DimensionalUnits \
        FamilyName GridLocation Ordinal PointList PointRange UserDefinedData}
    }
  }

  if {$version >= 2500} {
    set CGNSnodeChildren(Elements_t) {Descriptor ElementConnectivity \
      ElementRange ParentData Rind UserDefinedData}
  }

  if {$version >= 2530} {
    array set CGNSdataValues {
      DimensionalUnits_t {\
        {Null UserDefined Kilogram Gram Slug PoundMass} \
        {Null UserDefined Meter Centimeter Millimeter Foot Inch} \
        {Null UserDefined Second} \
        {Null UserDefined Kelvin Celsius Rankine Fahrenheit} \
        {Null UserDefined Radian Degree}}
      TemperatureUnits_t {Null UserDefined Kelvin Celsius Rankine Fahrenheit}
    }
  }

  if {$version >= 3100} {
    array set CGNSnodeDesc {
      Elements_t {{user defined} Elements_t {0,N} I4 1 2 \
        {ElementType, ElementSizeBoundary

element types are: 0:Null, 1:UserDefined, 2:NODE, 3:BAR_2, 4:BAR_3,\
5:TRI_3, 6:TRI_6, 7:QUAD_4, 8:QUAD_8, 9:QUAD_9, 10:TETRA_4, 11:TETRA_10,\
12:PYRA_5, 13:PYRA_14, 14:PENTA_6, 15:PENTA_15, 16:PENTA_18, 17:HEXA_8,\
18:HEXA_20, 19:HEXA_27, 20:MIXED, 21:PYRA_13, 22:NGON_n, 23:NFACE_n}}
      ZoneGridConnectivity_t {\
       {ZoneGridConnectivity or user defined} \
       ZoneGridConnectivity_t {0,N} MT {} {} {}}
    }
    array set CGNSnodeChildren {
      BC_t {BCDataSet BCProperty DataClass Descriptor DimensionalUnits \
        FamilyName GridLocation InwardNormalIndex \
        InwardNormalList Ordinal PointList PointRange \
        ReferenceState UserDefinedData}
      DiscreteData_t {DataClass Descriptor DimensionalUnits \
        DiscreteDataArray GridLocation PointList PointRange Rind \
        UserDefinedData}
      FamilyBC_t {FamilyBCDataSet}
      FlowSolution_t {DataClass Descriptor DimensionalUnits \
        GridLocation PointList PointRange Rind SolutionData \
        UserDefinedData}
      ZoneIterativeData_t {ArbitraryGridMotionPointers DataArray DataClass \
        Descriptor DimensionalUnits FlowSolutionsPointers \
        GridCoordinatesPointers RigidGridMotionPointers \
        ZoneGridConnectivityPointers ZoneSubRegionPointers UserDefinedData}
      Zone_t {ArbitraryGridMotion DataClass Descriptor DiscreteData \
        DimensionalUnits Elements FamilyName FlowEquationSet FlowSolution \
        GridCoordinates IntegralData Ordinal ReferenceState RigidGridMotion \
        RotatingCoordinates UserDefinedData ZoneBC ZoneConvergenceHistory \
        ZoneGridConnectivity ZoneIterativeData ZoneSubRegion ZoneType}
    }
  } else {
    array set CGNSnodeDesc {
      Elements_t {{user defined} Elements_t {0,N} I4 1 2 \
        {ElementType, ElementSizeBoundary

element types are: 0:Null, 1:UserDefined, 2:NODE, 3:BAR_2, 4:BAR_3,\
5:TRI_3, 6:TRI_6, 7:QUAD_4, 8:QUAD_8, 9:QUAD_9, 10:TETRA_4, 11:TETRA_10,\
12:PYRA_5, 13:PYRA_14, 14:PENTA_6, 15:PENTA_15, 16:PENTA_18, 17:HEXA_8,\
18:HEXA_20, 19:HEXA_27, 20:MIXED, 21+:NGON_n}}
      ZoneGridConnectivity_t {ZoneGridConnectivity \
       ZoneGridConnectivity_t {0,1} MT {} {} {}}
    }
  }
}

#----- popup windows for node data

proc cgns_data {} {
  global ProgData Node CGNSdataValues CGNSnodeDesc
  set label [string trim $Node(label)]
  if {$label != "" && [info exists CGNSdataValues($label)] &&
      [$ProgData(text) cget -state] == "normal"} {
    if {$label == "DimensionalUnits_t" || $label == "AdditionalUnits_t"} {
      cgns_units $label
    } else {
      cgns_string $label
    }
    return
  }
  set name [string trim $Node(name)]
  if {$name == "" || ![info exists CGNSnodeDesc($name)]} {
    if {$label == "" || ![info exists CGNSnodeDesc($label)]} return
    set name $label
  }
  set data [string trim [lindex $CGNSnodeDesc($name) 6]]
  if {$data != ""} {
    popup_message $data -pos $ProgData(text)
  }
}

proc cgns_units {label} {
  global ProgData Node CGNSdataValues
  set data $CGNSdataValues($label)
  set cur [split [string trim [$ProgData(text) get 1.0 end]] "\n"]
  if {$label == "DimensionalUnits_t"} {
    set units {mass length time temp angle}
    set names {Mass Length Time Temperature Angle}
  } else {
    set units {current amount intensity}
    set names {ElectricCurrent SubstanceAmount LuminousIntensity}
  }

  set w .unitlist
  catch {destroy $w}

  toplevel $w -relief flat -bd 0
  wm overrideredirect $w 1
  wm transient $w .
  wm group $w .
  wm protocol $w WM_DELETE_WINDOW {set ProgData(done) 0}

  frame $w.outer -relief solid -bd 1
  pack $w.outer -side top -fill both -expand 1

  set top [frame $w.outer.top]
  pack $top -side top -padx 3 -pady 3 -fill x -expand 1
  set n 0
  foreach i $units {
    FrameCreate $top.$i -text [lindex $names $n] -pady 0 -padx 0 -width 15
    pack $top.$i -side left -fill y -padx 2
    set f [FrameGet $top.$i]
    foreach v [lindex $data $n] {
      set j [string tolower $v]
      radiobutton $f.$j -text $v -variable ProgData(units,$i) \
        -value $v -highlightthickness 0 -bd 0
      pack $f.$j -side top -anchor w
    }
    set v [string trim [lindex $cur $n]]
    if {$v != "" && [lsearch [lindex $data $n] $v] >= 0} {
      set ProgData(units,$i) $v
    }
    incr n
  }

  set b [frame $w.outer.but]
  pack $b -side top -pady 3
  button $b.accept -text Accept -default active \
    -command {set ProgData(done) 1}
  button $b.cancel -text Cancel -command {set ProgData(done) 0}
  pack $b.accept $b.cancel -side left -padx 5

  bind $w <Return> {set ProgData(done) 1}

  center_window $w $ProgData(text)
  set oldFocus [focus]
  set oldGrab [grab current $w]
  if {$oldGrab != ""} {
    set grabStatus [grab status $oldGrab]
  }
  catch {grab $w}
  tkwait visibility $w
  focus $w
  tkwait variable ProgData(done)
  destroy $w
  catch {focus $oldFocus}
  if {$oldGrab != ""} {
    if {$grabStatus == "global"} {
      grab -global $oldGrab
    } else {
      grab $oldGrab
    }
  }

  if {$ProgData(done)} {
    set cnt [llength $units]
    set Node(type) C1
    set Node(dim) "32 $cnt"
    set Node(size) [expr 32 * $cnt]
    $ProgData(text) delete 1.0 end
    incr cnt -1
    for {set n 0} {$n < $cnt} {incr n} {
      set i [lindex $units $n]
      $ProgData(text) insert end "$ProgData(units,$i)\n"
    }
    set i [lindex $units end]
    $ProgData(text) insert end "$ProgData(units,$i)"
  }
}

proc cgns_string {label} {
  global ProgData Node CGNSdataValues
  set data $CGNSdataValues($label)
  set width 0
  foreach i $data {
    set len [string length $i]
    if {$width < $len} {set width $len}
  }
  set cnt [llength $data]

  set w .datalist
  catch {destroy $w}

  toplevel $w -relief flat -bd 0 -cursor left_ptr
  wm overrideredirect $w 1
  wm transient $w .
  wm group $w .
  wm protocol $w WM_DELETE_WINDOW {set ProgData(done) 0}

  bind $w <ButtonRelease-1> {set ProgData(done) 0}
  bind $w <ButtonRelease-3> {set ProgData(done) 0}
  bind $w <KeyRelease> {set ProgData(done) 0}
  bind $w <FocusOut> {set ProgData(done) 0}

  set top [frame $w.top -relief solid -bd 1]
  pack $top -side top -fill both -expand 1
  label $top.lab -text $label
  pack $top.lab -side top -fill x
  frame $top.sep -height 2 -bd 1 -relief sunken
  pack $top.sep -side top -fill x

  if {$cnt > 10} {
    listbox $top.list -relief flat -bd 0 -highlightthickness 0 \
      -exportselection 0 -width $width -height 10 \
      -yscroll "$top.scroll set" -takefocus 0 -cursor hand2
    scrollbar $top.scroll -highlightthickness 0 -takefocus 0 \
      -orient vertical -command "$top.list yview"
    pack $top.scroll -side right -fill y
    bind $top.scroll <ButtonRelease-1> break
  } else {
    listbox $top.list -relief flat -bd 0 -highlightthickness 0 \
      -exportselection 0 -width $width -height $cnt \
      -takefocus 0 -cursor hand2
  }
  pack $top.list -side left -fill both -expand 1
  bind $top.list <ButtonRelease-1> {set ProgData(done) 1; break}

  foreach i $data {
    $top.list insert end $i
  }
  set n [lsearch $data [string trim [$ProgData(text) get 1.0 end]]]
  if {$n >= 0} {
    $top.list selection set $n $n
    $top.list see $n
  }

  center_window $w $ProgData(text)
  set oldFocus [focus]
  set oldGrab [grab current $w]
  if {$oldGrab != ""} {
    set grabStatus [grab status $oldGrab]
  }
  catch {grab $w}
  tkwait visibility $w
  focus $w
  tkwait variable ProgData(done)

  set sel [$top.list curselection]
  if {$sel == ""} {
    set data ""
  } else {
    set data [$top.list get $sel]
  }

  destroy $w
  catch {focus $oldFocus}
  if {$oldGrab != ""} {
    if {$grabStatus == "global"} {
      grab -global $oldGrab
    } else {
      grab $oldGrab
    }
  }

  if {$data != "" && $ProgData(done)} {
    $ProgData(text) delete 1.0 end
    $ProgData(text) insert end $data
    set Node(type) C1
    set Node(dim) [string length $data]
    set Node(size) $Node(dim)
  }
}

proc cgns_info {} {
  global ProgData Node CGNSnodeDesc Font
  set name [string trim $Node(name)]
  if {$name == "" || ![info exists CGNSnodeDesc($name)]} {
    set name [string trim $Node(label)]
    if {$name == "" || ![info exists CGNSnodeDesc($name)]} return
  }

  set labw 10
  set wrap 30

  set w .datainfo
  catch {destroy $w}
  toplevel $w -bg black
  wm overrideredirect $w 1
  wm transient $w .

  frame $w.f -bg #ffffcc
  pack $w.f -side top -padx 1 -pady 1

  set n 0
  foreach i {"Node Name" "Node Label" Cardinality "Data Type"} {
    set f [frame $w.f.n$n -bg #ffffcc]
    pack $f -side top -padx 5 -anchor w
    label $f.lab -text "$i:" -width $labw -anchor w -font $Font(normal) \
      -bg #ffffcc -fg black
    label $f.ent -font $Font(fixed) -bg #ffffcc -fg black \
      -text [lindex $CGNSnodeDesc($name) $n]
    pack $f.lab $f.ent -side left
    incr n
  }

  if {[lindex $CGNSnodeDesc($name) 3] != "MT"} {
    foreach i {Dimension "Dim Values"} {
      set f [frame $w.f.n$n -bg #ffffcc]
      pack $f -side top -padx 5 -anchor w
      label $f.lab -text "$i:" -width $labw -anchor w -font $Font(normal) \
        -bg #ffffcc -fg black
      label $f.ent -font $Font(fixed) -bg #ffffcc -fg black \
        -text [lindex $CGNSnodeDesc($name) $n]
      pack $f.lab $f.ent -side left
      incr n
    }
    set data ""
    foreach line [split [lindex $CGNSnodeDesc($name) 6] "\n"] {
      if {$data != ""} {append data "\n"}
      set len 0
      foreach word $line {
        set n [string length $word]
        if [expr {$len + $n + 1 > $wrap}] {
          append data "\n"
          set len 0
        }
        if {$len} {
          append data " $word"
          incr n
        } else {
          append data $word
        }
        incr len $n
      }
    }

    set f [frame $w.f.data -bg #ffffcc]
    pack $f -side top -padx 5 -anchor w
    label $f.lab -text "Data:" -width $labw -anchor w -font $Font(normal) \
      -bg #ffffcc -fg black
    label $f.ent -justify left -font $Font(fixed) -bg #ffffcc -fg black \
      -text $data
    pack $f.lab $f.ent -side left -anchor n
  }

  center_window $w .

  bind $w <ButtonPress> {catch {destroy .datainfo};break}
  bind $w <KeyPress> {catch {destroy .datainfo};break}
  bind $w <FocusOut> {catch {destroy .datainfo}}

  set oldFocus [focus]
  set oldGrab [grab current $w]
  if {$oldGrab != ""} {
    set grabStatus [grab status $oldGrab]
  }
  catch {grab $w}
  focus $w
  tkwait window $w
  catch {focus $oldFocus}
  if {$oldGrab != ""} {
    if {$grabStatus == "global"} {
      grab -global $oldGrab
    } else {
      grab $oldGrab
    }
  }
}

proc cgns_tree {{top ""}} {
  global Font CGNSlibraryVersion CGNSnodes CGNSnodeChildren
  global CGNSdataValues CGNSdataDesc CGNSdata

  if {$top == ""} {
    set top .cgnstree
  }
  if {$top == "."} {
    set w ""
  } else {
    if {[winfo exists $top]} {
      wm deiconify $top
      return
    }
    toplevel $top
    set w $top
  }
  wm title $top "CGNS $CGNSlibraryVersion Node Reference"

  array set CGNSdata {
    node ""
    name ""
    label ""
    count ""
    type ""
    ndim ""
    dims ""
    sids ""
    midlevel  ""
  }

  FrameCreate $w.tree -text "Node Tree" -font $Font(bold)
  pack $w.tree -side left -fill both -expand 1
  set tree [FrameGet $w.tree]

  scrollbar $tree.ys -orient vertical -command "$tree.tree yview"
  pack $tree.ys -side right -fill y

  scrollbar $tree.xs -orient horizontal -command "$tree.tree xview"
  pack $tree.xs -side bottom -fill x

  TreeCreate $tree.tree -width 200 -height 300 -relief sunken \
    -bd 2 -yscrollcommand "$tree.ys set" -xscrollcommand "$tree.xs set" \
    -font $Font(normal)
  set CGSNdata(tree) $tree.tree
  pack $tree.tree -side left -fill both -expand 1

  bind $tree.tree <1> {cgns:show_node %W [TreeAt %W %x %y]}
  bind $tree.tree <Double-1> {TreeToggle %W [TreeAt %W %x %y]}
  bind $tree.tree <Shift-1> {cgns:tree %W %x %y open}
  bind $tree.tree <Control-1> {cgns:tree %W %x %y close}
  bind $tree.tree <Shift-3> {cgns:tree %W %x %y expand}
  bind $tree.tree <Control-3> {cgns:tree %W %x %y collapse}

  TreeInsert $tree.tree /
  foreach n $CGNSnodeChildren(/) {
    cgns:add_node $tree.tree "" $n
  }

  set labw 10
  set entw 32

  FrameCreate $w.prop -text "Node Properties" -font $Font(bold)
  pack $w.prop -side right -fill y
  set prop [FrameGet $w.prop]

  foreach {i j} {name "Node Name" label "Node Label" count Cardinality \
    type "Data Type" ndim Dimensions dims "Dim Values"} {
    set f [frame $prop.$i]
    pack $f -side top
    label $f.lab -width $labw -text $j -anchor w
    entry $f.ent -width $entw -textvariable CGNSdata($i) \
      -state disabled -cursor {}
    pack $f.lab $f.ent -side left
  }

  set f [frame $prop.data]
  pack $f -side top -fill both -expand 1
  label $f.lab -text "Data"
  pack $f.lab -side top -anchor w
  set CGNSdata(text) [text $f.text -width $entw -height 15 \
    -wrap word -cursor {}]
  pack $CGNSdata(text) -side top -fill both -expand 1

  frame $prop.sep -relief groove -bd 1 -height 2
  pack $prop.sep -side top -fill x -pady 3

  set f [frame $prop.but]
  pack $f -side top -fill x

  button $f.midlevel -text "MLL Doc..." -state disabled \
    -command {cgns:help midlevel}
  button $f.sids -text "SIDS Doc.." -state disabled \
    -command {cgns:help sids}
  pack $f.midlevel $f.sids -side left -expand 1
  if {$top == "."} {
    button $f.setup -text "Setup..." -command help_setup
    pack $f.setup -side left -expand 1
  }
  button $f.exit -text Exit -command "destroy $top" -width 6
  pack $f.exit -side left -expand 1
  set CGNSdata(buts) $f
}

proc cgns:add_node {tree parent child} {
  global CGNSnodes CGNSnodeChildren

  set node $parent/$child
  TreeInsert $tree $node
  set type [lindex $CGNSnodes($child) 1]
  if {[info exists CGNSnodeChildren($type)]} {
    foreach n $CGNSnodeChildren($type) {
      if {$n == $child} {
        TreeInsert $tree $node/$n
      } else {
        cgns:add_node $tree $node $n
      }
    }
  }
}

proc cgns:show_node {w node} {
  global CGNSnodes CGNSnodeDesc CGNSnodeRef CGNSdata

  TreeSelectionSet $w $node
  $CGNSdata(text) delete 1.0 end
  if {$node == "" || $node == "/"} {
    array set CGNSdata {
      node ""
      name ""
      label ""
      count ""
      type ""
      ndim ""
      dims ""
      sids ""
      midlevel ""
    }
  } else {
    set name [file tail $node]
    if {![info exists CGNSnodeDesc($name)]} {
      set name [lindex $CGNSnodes($name) 1]
    }
    set n 0
    foreach i {name label count type ndim dims} {
      set CGNSdata($i) [lindex $CGNSnodeDesc($name) $n]
      incr n
    }
    $CGNSdata(text) insert end [lindex $CGNSnodeDesc($name) 6]

    set name [file tail $node]
    if {![info exists CGNSnodeRef($name)]} {
      set name [lindex $CGNSnodes($name) 1]
    }
    if {[info exists CGNSnodeRef($name)]} {
      set CGNSdata(sids) [lindex $CGNSnodeRef($name) 0]
      set CGNSdata(midlevel) [lindex $CGNSnodeRef($name) 1]
    } else {
      set CGNSdata(sids) ""
      set CGNSdata(midlevel) ""
    }
  }

  foreach i {sids midlevel} {
    if {$CGNSdata($i) == {}} {
      $CGNSdata(buts).$i configure -state disabled
    } else {
      $CGNSdata(buts).$i configure -state normal
    }
  }
}

proc cgns:tree {w x y mode} {
  set node [TreeAt $w $x $y]
  if {$node == ""} return
  if {$node != [TreeSelectionGet $w]} {
    cgns:show_node $w $node
  }
  switch $mode {
    expand {TreeExpand $w $node}
    collapse {TreeCollapse $w $node}
    open {TreeOpenLevel $w $node}
    close {TreeCloseLevel $w $node}
  }
}

proc cgns:format {text width} {
  if {[string trim $text] == ""} {return ""}
  return $data
}

proc cgns:help {type} {
  global CGNSdata HelpData tcl_platform
  set htmlfile $HelpData(cgns)
  if {$htmlfile == ""} {
    errormsg "CGNS documentation URL not setup"
  }
  set html [lindex $CGNSdata($type) 0]
  set tag [lindex $CGNSdata($type) 1]
  if {$html == ""} return
  set ext [string tolower [file extension $htmlfile]]
  if {$HelpData(winhtml) && $ext == ".chm"} {
    if {$HelpData(chmfile) != $htmlfile} {
      if {[catch {WinHtml file $htmlfile} msg]} {
        errormsg $msg
        return
      }
      set HelpData(chmfile) $htmlfile
    }
    if {[catch {eval WinHtml topic "$type/$html.html" $tag} msg]} {
      errormsg $msg
    }
    return
  }
  if {$HelpData(browser) == ""} {
    errormsg "browser not set up"
  } else {
    set doc $htmlfile
    if {$ext == ".html" || $ext == ".htm"} {
      set n [string last / $htmlfile]
      if {$n > 0} {set doc [string range $htmlfile 0 $n]}
    }
    if {[string index $doc end] != "/"} {append doc /}
    append doc "$type/$html.html"
    if {$tag != ""} {append doc "\#$tag"}
    set cmd "$HelpData(browser) $HelpData(htmlopts) "
    if {$tcl_platform(platform) == "windows"} {
      append cmd "\"$doc\""
    } else {
      append cmd $doc
    }
    if {[catch {eval exec $cmd &} msg]} {
      errormsg $msg
    }
  }
}

