function status = get_epic_key_data( epic_key_filename )

global epic_key_data;

afid = fopen ( epic_key_filename, 'r' );
if ( afid == -1 )
    status = -1;
    fprintf ( 2, '\tCould not open %s, is this the proper location of the epic key file?', epic_key_filename );
    return;
end

count = 0;

disp ( 'retrieving data from epic key file...' );

line = fgetl ( afid );
line = fgetl ( afid );
while ( line ~= -1 )

    count = count+1;

    [t,r] = strtok ( line, ':' );
    epic_code(count) = str2num(t);

    [t,r] = strtok ( r, ':' );
    short_name{count} = deblank(t);

    [t,r] = strtok ( r, ':' );
    long_name{count} = t;

    [t,r] = strtok ( r, ':' );
    generic_name{count} = t;

    [t,r] = strtok ( r, ':' );
    units{count} = t;

    [t,r] = strtok ( r, ':' );
    fortran_format{count} = t;

    [t,r] = strtok ( r, ':' );
    comment{count} = t;

    line = fgetl ( afid );

end % while line

epic_key_data.epic_code = epic_code;
epic_key_data.short_name = short_name;
epic_key_data.long_name = long_name;
epic_key_data.generic_name = generic_name;
epic_key_data.units = units;
epic_key_data.fortran_format = fortran_format;
epic_key_data.comment = comment;

disp ( 'all done retrieving data from epic key file...' );

fclose ( afid );

status = 1;

return

