cdm/src/main/java/ucar/nc2/NetcdfFile.java
public String findAttValueIgnoreCase(Variable v, String attName, String defaultValue) {
    String attValue = null;
    Attribute att;

    if (v == null)
      att = rootGroup.findAttributeIgnoreCase(attName);
    else
      att = v.findAttributeIgnoreCase(attName);

    if ((att != null) && att.isString())
      attValue = att.getStringValue();

    if (null == attValue)                     // not found, use default
      attValue = defaultValue;

    return attValue;
  }
public String findAttValueIgnoreCase(Variable v, String attName, String defaultValue) {
    String attValue = null;
    Attribute att;

    if (v == null)
      att = rootGroup.findAttributeIgnoreCase(attName);
    else
      att = v.findAttributeIgnoreCase(attName);

    if ((att != null) && att.isString())
      attValue = att.getStringValue();

    if (null == attValue)                     // not found, use default
      attValue = defaultValue;

    return attValue;
  }
public String findAttValueIgnoreCase ( Variable v , String attName , String defaultValue ) { String attValue = null ; Attribute att ; if ( v == null ) att = rootGroup . findAttributeIgnoreCase ( attName ) ; else att = v . findAttributeIgnoreCase ( attName ) ; if ( ( att != null ) && att . isString ( ) ) attValue = att . getStringValue ( ) ; if ( null == attValue ) // not found, use default attValue = defaultValue ; return attValue ; }
Find a String-valued global or variable Attribute by
Attribute name (ignore case), return the Value of the Attribute.
If not found return defaultValue

@param v            the variable or null for global attribute
@param attName      the (full) name of the attribute, case insensitive
@param defaultValue return this if attribute not found
@return the attribute value, or defaultValue if not found
Find a String - valued global or variable Attribute by Attribute name ( ignore case ) return the Value of the Attribute . If not found return defaultValue