function [U,V]=getuEvN_uXvY_llc(ufaces,vfaces,csfaces,snfaces,xfaces,yfaces,proj_ctr);
%------------------------------------------------------------------------------
% function [U,V]=getuEvN_uXvY_llc(ufaces,vfaces,csfaces,snfaces,proj_ctr)
%
% function to rotate llc [ufaces,vfaces] to [uE,vN] or [uX,vY], size 5 faces
% input:
%  [ufaces,vfaces]  : at llc velocity points, hFacW/hFacS taken into account, 5faces (unprimed)
%  [xfaces,yfaces]: [lon,lat], 5 faces (unprimed)
%  [csfaces,snfaces]: rotational angles, 5 faces
%  proj_ctr : center longitude for llssmi1p
%           : [-180,180]
%           : if = -1000, no [X,Y] projection will be done, [uE,vN] are returned.
%  ATN 013007, mod 041607, mod 25Feb2012 for llc
%  NOTE: if use llssmi1p: need to use lon',lat',uE',vN'
%------------------------------------------------------------------------------

% rotate to uE/vN
[uE0,vN0]=calc_UEVNfromUVllc(ufaces,vfaces,csfaces,snfaces);

if(proj_ctr~=-1000);
  uE=uE0;%unprimed, 5 faces
  vN=vN0;%unprimed, 5 faces

  for iF=1:length(xfaces);
    [nx ny]=size(xfaces{iF});
    x=reshape(xfaces{iF}',nx*ny,1);y=reshape(yfaces{iF}',nx*ny,1);
    [uX,vY]=get_uXvY(reshape(uE{iF}',nx*ny,1),reshape(vN{iF}',nx*ny,1),x,y,proj_ctr);%primed
    U{iF}=reshape(uX,nx,ny);
    V{iF}=reshape(vY,nx,ny);
  end;
else;
  U=uE0;%			% 5faces, unprimed
  V=vN0;%			% 5faces, unprimed
end;

return
