function [ array ] = fill_year( array, nperyr );
% function [ array ] = fill_year( array, nperyr );
%
% Append missing values ("NaN"s) to a time series / data file
%  to make a complete year of data.
%
% Input:
% array       a time series or data matrix where time varies by
%             row, for example, a time series is a column vector.
% nperyr      (optional) number of records in a year; default 12
%
% Todd Mitchell, November 2010.
%

if nargin==1; nperyr=12; end
a = size( array );
ndim = length(a);
nt   = ceil( a(1)/nperyr ) * nperyr;

array = [ array; ones([ nt-a(1) a(2:ndim) ])*NaN ];



