function [stencil_variables] = read_stencil(stencil)
fileID = fopen(stencil,'r');
line = fgetl(fileID);



while ~feof(fileID)
    if isempty(line)
    elseif strcmp(line(1),'#')
    else
        varname = genvarname(line);
        val = [];
        line = fgetl(fileID);
        while ~isempty(str2num(line))
            val = [val; str2num(line)];
            line = fgets(fileID);
            if line == -1
                break
            end
        end
     stencil_variables.(varname) = val;
    end
    line = fgetl(fileID);  
end

end