function field_out=put_tracer_astecompact_to_globalcompact(field_in)

%atn 12.Sep.2016
%field_out=put_tracer_astecompact_toglobalcompact(field_in)
% field_in: aste llc270 tracer field in compact format, size [270 x 1350 x nz]
% field_out: global llc270 tracer field in compact format, size [270 x (270*13) x nz]

sz=size(field_in);
if(length(sz)==2);sz=[sz 1];end;

nx=sz(1);
ny=sz(2);
nz=sz(3);

%check size
if(ny~=5*nx);error('field_in is not in correct ASTE size');end;

%define sizes of ASTE 5 faces:
nfx=[ nx 0 nx 180 450];
nfy=[450 0 nx  nx  nx];

%put into ASTE 5 faces:
f{1}=field_in(1:nx,1:nfy(1),:);
f{2}=[];
f{3}=field_in(1:nx,nfy(1)+1:nfy(1)+nfy(3),:);
f{4}=reshape(field_in(1:nx,nfy(1)+nfy(3)+1:nfy(1)+nfy(3)+nfx(4),:),nfx(4),nfy(4),nz);
f{5}=reshape(field_in(1:nx,nfy(1)+nfy(3)+nfx(4)+1:nfy(1)+nfy(3)+nfx(4)+nfx(5),:),nfx(5),nfy(5),nz);

%expand to full global faces:
fg{1}=zeros(nx,3*nx,nz);fg{1}(1:nx,3*nx-nfy(1)+1:3*nx,:)=f{1};
fg{2}=zeros(nx,3*nx,nz);
fg{3}=zeros(nx,nx,nz); fg{3}=f{3};
fg{4}=zeros(3*nx,nx,nz);fg{4}(1:nfx(4),1:nfy(4),:)=f{4};
fg{5}=zeros(3*nx,nx,nz);fg{5}(1:nfx(5),1:nfy(5),:)=f{5};

%now put back into compact form:

field_out=zeros(nx,13*nx,nz);
field_out=cat(2,fg{1},fg{2},fg{3},reshape(fg{4},nx,3*nx,nz),reshape(fg{5},nx,3*nx,nz));

return
