function [fld_faces]=aste_to_faces(fld_in,index)
%-------------------------------------------------
% function [fld_faces]=aste_to_faces(fld_in,index)
%
% Input
%   fld_in: aste domain, size [484 749] if llc270
%   index:  info needed for aste domain,
%           [field_aste,index]=get_aste_tracer(ffaces,xfaces,yfaces)
% Output:
%   fld_faces: 5 faces, nan outside aste domain
%--------------------------------------------------

nx=index(1,2);
ny=nx*3;
[nxo nyo]=size(fld_in);%[484 749];
Lx=index(1,:);Ly=index(2,:);
ix=[1,cumsum(Lx)+1];%Lx=diff(ix);
iy=[1,cumsum(Ly)+1];%Ly=diff(iy);

fld_faces={nan(nx,ny),nan(nx,ny),nan(nx,nx),nan(ny,nx),nan(ny,nx)};

temp=sym_g_mod(fld_in(ix(2):ix(3)-1,iy(2):iy(3)-1),7,0);
fld_faces{3}=temp;

temp=sym_g_mod(fld_in(1:ix(2)-1,iy(2):iy(3)-1),6,0);
fld_faces{5}(1:Lx(1),:)=temp;

temp=sym_g_mod(fld_in(ix(2):ix(3)-1,iy(3):nyo),7,0);
fld_faces{4}(1:Ly(3),:)=temp;

temp=fld_in(ix(2):ix(3)-1,1:iy(2)-1);
fld_faces{1}(:,ny-Ly(1)+1:ny)=temp;

temp=sym_g_mod(fld_in(ix(3):nxo,iy(2):iy(3)-1),7,0);
fld_faces{2}(:,ny-Lx(3)+1:ny)=temp;
