function [maskC,maskW,maskS]=get_aste_mask_obcs(hFacC,hFacW,hFacS,nx)
%------
%function [maskC,maskW,maskS]=get_aste_mask_obcs(hFacC,hFacW,hFacS,nx)
% input:
%   hFac[C,W,S], will hard-codedly zero out obcs
%   example directory where hFacC is read from:
%   /work/03901/atnguyen/llc270/aste_270x450x180/GRID_real8/
%   nx: 90, 270, 1080, etc., meant for llc grid
% output: 
%   mask[C,W,S] in compact format, for aste of size nx x ncut1 x ncut2 specifically
%
% atn 28.jul.2018, copy from my version to close gcmfaces budgets
%----

%%determine 3rd dim
%ss=size(hFacC);if(length(ss)==2);nz=1;else;nz=ss(3);end;

if(nx==90);
% OB_Jsouth =   90*8, 300*0,
% OB_Ieast  =   86*0, 1*33, 63*0, 90*0, 90*42, 90*143,
% 282 = 150+90+42 = ncut1 + nx + 42, 33+90 = 123, 86+1:86+1
  ncut1=150;ncut2=60;
  nfx=[nx 0 nx ncut2 ncut1];nfy=[ncut1 0 nx nx nx];
  i_Pac=nx+1:2*nx;	j_Pac=nfy(1)+nx+42;	%Pacific	   [91:180, 282]
  i_Atl=1:2*nx;		j_Atl=8;		%South Atlantic	   [ 1:180,   8]
  i_GB=33+nx;		j_GB=87;		%Gibraltar Strait: [   123,  87]
elseif(nx==270);
% OB_Jsouth =   270*24, 900*0,
% OB_Ieast  =   260*0, 2*96, 458*0, 270*125, 270*427,
% 845 = 450+270+125 = ncut1 + nx + 125, 96+270 = 366, 260+1:260+2
  ncut1=450;ncut2=180;
  nfx=[nx 0 nx ncut2 ncut1];nfy=[ncut1 0 nx nx nx];
  i_Pac=nx+1:2*nx;	j_Pac=nfy(1)+nx+125;	%Pacific	   [271:540, 845]
  i_Atl=1:2*nx;		j_Atl=24;		%South Atlantic    [  1:540,  24]
  i_GB=96+nx;		j_GB=261:262;		%Gibraltar Strait  [    366, 261:262]
elseif(nx==1080);
% OB_Jsouth =   1080*76, 3060*0,
% OB_Ieast  =   500*0, 4*387, 756*0, 1080*0, 1080*494, 1080*1185,
% 2834 = 1260+1080+494, 387+1080 = 1467, 500+1:500+4
  ncut1=1260;ncut2=540;
  nfx=[nx 0 nx ncut2 ncut1];nfy=[ncut1 0 nx nx nx];
  i_Pac=nx+1:2*nx;	j_Pac=nfy(1)+nx+494;	%Pacific	   [1081:2160,    2834]
  i_Atl=1:2*nx;		j_Atl=76;		%South Atlantic    [   1:2160,      76]
  i_GB=387+nx;		j_GB=501:504;		%Gibraltar Strait  [     1467, 501:504]
end;

hFacC(find(hFacC==0))=nan;
maskC=get_aste_tracer(hFacC,nfx,nfy);

hFacW(find(hFacW==0))=nan;
hFacS(find(hFacS==0))=nan;
[maskW,maskS]=get_aste_vector(hFacW,hFacS,nfx,nfy,0);

maskC(i_Pac,j_Pac,:)=nan; maskW(i_Pac,j_Pac,:)=nan; maskS(i_Pac,j_Pac,:)=nan;
maskC(i_Atl,j_Atl,:)=nan; maskW(i_Atl,j_Atl,:)=nan; maskS(i_Atl,j_Atl+1,:)=nan;%<-- note +1 for maskS
maskC(i_GB ,j_GB,:) =nan; maskW(i_GB ,j_GB ,:)=nan; maskS(i_GB ,j_GB ,:)=nan;

maskC=aste_tracer2compact(maskC,nfx,nfy);				%90 x 450 or 270 x 1350 or 1080 x 4140
[maskW,maskS]=aste_vector2compact(maskW,maskS,nfx,nfy,0);		%90 x 450 or 270 x 1350 or 1080 x 4140

%[tmpu,tmpv]=get_aste_vector(udata(:,:,1),vdata(:,:,1),inputs.nfx,inputs.nfy,1);
%msku=nan(size(tmpu));
%msku(inputs.i_obcsGB,inputs.j_obcsGB)=NaN;
%msku(inputs.i_obcsSAtl,inputs.j_obcsSAtl)=NaN;
%msku(inputs.i_obcsPac,inputs.j_obcsPac)=NaN;
%mskv(inputs.i_obcsSAtl,inputs.j_obcsSAtl+1)=NaN;
%maskU=maskC;

return
