cdm/src/main/java/ucar/nc2/NetcdfFile.java
public Attribute addAttribute(Group parent, Attribute att) {
    if (immutable) throw new IllegalStateException("Cant modify");
    if (parent == null) parent = rootGroup;
    parent.addAttribute(att);
    return att;
  }
public Attribute addAttribute(Group parent, Attribute att) {
    if (immutable) throw new IllegalStateException("Cant modify");
    if (parent == null) parent = rootGroup;
    parent.addAttribute(att);
    return att;
  }
public Attribute addAttribute ( Group parent , Attribute att ) { if ( immutable ) throw new IllegalStateException ( "Cant modify" ) ; if ( parent == null ) parent = rootGroup ; parent . addAttribute ( att ) ; return att ; }
Add an attribute to a group.

@param parent add to this group. If group is null, use root group
@param att    add this attribute
@return the attribute that was added
Add an attribute to a group .