static int findDtype(
  String nm,
  int nhTp)
throws NhException
{
  int dtype = 0;
  if (nhTp == TP_SBYTE) dtype = HdfGroup.DTYPE_SFIXED08;
  else if (nhTp == TP_UBYTE) dtype = HdfGroup.DTYPE_UFIXED08;
  else if (nhTp == TP_SHORT) dtype = HdfGroup.DTYPE_FIXED16;
  else if (nhTp == TP_INT) dtype = HdfGroup.DTYPE_FIXED32;
  else if (nhTp == TP_LONG) dtype = HdfGroup.DTYPE_FIXED64;
  else if (nhTp == TP_FLOAT) dtype = HdfGroup.DTYPE_FLOAT32;
  else if (nhTp == TP_DOUBLE) dtype = HdfGroup.DTYPE_FLOAT64;
  else if (nhTp == TP_CHAR) dtype = HdfGroup.DTYPE_STRING_FIX;
  else if (nhTp == TP_STRING_VAR) dtype = HdfGroup.DTYPE_STRING_VAR;
  else throwerr("NhVariable: variable or attr \"%s\" has unknown type: %d",
    nm, nhTp);
  return dtype;
}