bufr/src/main/java/ucar/nc2/iosp/bufr/DataDescriptorTreeConstructor.java
private void grabCompoundNames(List<DataDescriptor> tree) {

    for (int i=0; i<tree.size(); i++) {
      DataDescriptor key = tree.get(i);
      if (key.bad) continue;

      if ((key.f == 3) && (key.subKeys != null)) {
        grabCompoundNames(key.subKeys);

      } else if (key.f == 1 && key.x == 1 && i < tree.size()-1) {  // replicator with 1 element
        DataDescriptor nextKey = tree.get(i+1);
        if (nextKey.f == 3) {  // the one element is a compound
          if (nextKey.name != null && !nextKey.name.isEmpty())
            key.name = nextKey.name;

        } else if (key.y == 0 && i < tree.size()-2) {  // seq has an extra key before the 3
          DataDescriptor nnKey = tree.get(i+2);
          if (nnKey.f == 3 )
            if (nnKey.name != null && !nnKey.name.isEmpty())
              key.name = nnKey.name;
        }
      }
    }
  }
private void grabCompoundNames(List<DataDescriptor> tree) {

    for (int i=0; i<tree.size(); i++) {
      DataDescriptor key = tree.get(i);
      if (key.bad) continue;

      if ((key.f == 3) && (key.subKeys != null)) {
        grabCompoundNames(key.subKeys);

      } else if (key.f == 1 && key.x == 1 && i < tree.size()-1) {  // replicator with 1 element
        DataDescriptor nextKey = tree.get(i+1);
        if (nextKey.f == 3) {  // the one element is a compound
          if (nextKey.name != null && !nextKey.name.isEmpty())
            key.name = nextKey.name;

        } else if (key.y == 0 && i < tree.size()-2) {  // seq has an extra key before the 3
          DataDescriptor nnKey = tree.get(i+2);
          if (nnKey.f == 3 )
            if (nnKey.name != null && !nnKey.name.isEmpty())
              key.name = nnKey.name;
        }
      }
    }
  }
private void grabCompoundNames ( List < DataDescriptor > tree ) { for ( int i = 0 ; i < tree . size ( ) ; i ++ ) { DataDescriptor key = tree . get ( i ) ; if ( key . bad ) continue ; if ( ( key . f == 3 ) && ( key . subKeys != null ) ) { grabCompoundNames ( key . subKeys ) ; } else if ( key . f == 1 && key . x == 1 && i < tree . size ( ) - 1 ) { // replicator with 1 element
 DataDescriptor nextKey = tree . get ( i + 1 ) ; if ( nextKey . f == 3 ) { // the one element is a compound
 if ( nextKey . name != null && ! nextKey . name . isEmpty ( ) ) key . name = nextKey . name ; } else if ( key . y == 0 && i < tree . size ( ) - 2 ) { // seq has an extra key before the 3
 DataDescriptor nnKey = tree . get ( i + 2 ) ; if ( nnKey . f == 3 ) if ( nnKey . name != null && ! nnKey . name . isEmpty ( ) ) key . name = nnKey . name ; } } } }
/* try to grab names of compounds (structs)
if f=1 is followed by f=3, eg:
0-40-20 : GQisFlagQualDetailed - Quality flag for the system
1-01-010: replication
3-40-2  : (IASI Level 1c band description)
0-25-140: Start channel
0-25-141: End channel
0-25-142: Channel scale factor
1-01-087: replication
3-40-3  : (IASI Level 1c 100 channels)
1-04-100: replication
2-01-136: Operator= change data width
0-5-42  : Channel number
2-01-000: Operator= change data width
0-14-46 : Scaled IASI radiance
0-2-19  : Satellite instruments
0-25-51 : AVHRR channel combination
1-01-007: replication
3-40-4  : (IASI Level 1c AVHRR single scene)
0-5-60  : Y angular position from centre of gravity
0-5-61  : Z angular position from centre of gravity
0-25-85 : Fraction of clear pixels in HIRS FOV
...

sequence:
3-60-4  : DRP1BIT
1-01-000: replication
0-31-0  : DRF1BIT
3-61-38 : TMPSQ2   SYNOPTIC REPORT WET BULB TEMPERATURE DATA
0-2-39  : MWBT
0-12-102: TMWB
0-13-3  : REHU

which has been preflattened into:

1-01-000: replication
0-31-0  : DRF1BIT
3-61-38 : TMPSQ2   SYNOPTIC REPORT WET BULB TEMPERATURE DATA
0-2-39  : MWBT
0-12-102: TMWB
0-13-3  : REHU
/ * try to grab names of compounds ( structs ) if f = 1 is followed by f = 3 eg : 0 - 40 - 20 : GQisFlagQualDetailed - Quality flag for the system 1 - 01 - 010 : replication 3 - 40 - 2 : ( IASI Level 1c band description ) 0 - 25 - 140 : Start channel 0 - 25 - 141 : End channel 0 - 25 - 142 : Channel scale factor 1 - 01 - 087 : replication 3 - 40 - 3 : ( IASI Level 1c 100 channels ) 1 - 04 - 100 : replication 2 - 01 - 136 : Operator = change data width 0 - 5 - 42 : Channel number 2 - 01 - 000 : Operator = change data width 0 - 14 - 46 : Scaled IASI radiance 0 - 2 - 19 : Satellite instruments 0 - 25 - 51 : AVHRR channel combination 1 - 01 - 007 : replication 3 - 40 - 4 : ( IASI Level 1c AVHRR single scene ) 0 - 5 - 60 : Y angular position from centre of gravity 0 - 5 - 61 : Z angular position from centre of gravity 0 - 25 - 85 : Fraction of clear pixels in HIRS FOV ...