function [ array ] = threetotwo( array );
% function [ array ] = threetotwo( array );
%
% Rearrange a 3-dimensional array (lon, lat, time)
% into a 2-dimensional array (time, lat and lon ),
% where the longitude varies the most in the output array
% (as in FORTRAN).
%
% Todd Mitchell, November 2010

[ nx ny, nt ] = size( array );
if min( [ nx ny nt ] )==1
error( 'Not a three dimensional array.' )
end

array = reshape( array, nx*ny, nt, 1 )' ;


