undef("getfilevaratt_value") function getfilevaratt_value(f[1]:file, varname[1]:string, attname[1]:string) local varAtts, iAtt, attValue begin if (isfilevar(f,varname)) then varAtts = getfilevaratts(f, varname) iAtt = ind(varAtts.eq.attname) if (ismissing(iAtt)) then print("getfilevaratt_value: FATAL: variable "+varname+" does not have an attribute named "+attname) exit end if attValue = f->$varname$@$attname$ return(attValue) else print("getfilevaratt_value: FATAL: variable "+varname+" is not in the file") exit end if end