function [alpha0] = init_conc(app, init_conc_type, x, y) 
%   init_conc given a point, return the initial concentration of plastic at
% that point 
%   type 2 - along coastline - mask + convolution matrix /blur - watch the
% type - DONE 
%   type 3 - uniform distribution - mask + set everything equal - DONE 
%   type 4 - point source along coast - mask + choose a point on coast
%           a. only Merrimack 
%           b. only Charles 
%           c. both rivers, unweighted 
%           d. both rivers, weighted
%   type 5 - point source in the ocean - mask + choose a point in ocean -
%   DONE 
%   type 6 - point source along coast (rivers) = weighted heavy (relative to each other), all other
%   points on coastline = normal weight 
%   type 7 - coastal point sources (rivers - weighted heavy) + coastline + point source in
%   ocean - most comprehensive and realistic model 

%   code different masks for each case and save in separate places 
 
%   remember to compare results of type 2 and type 4 - does denser
% surrounding concentration affect particle transpor? theoretically, no 

    g = app.grid;
    
    x0 = g.xs{1}';
    y0 = g.xs{2}';
    
    lat = app.lat;
    lon = app.lon;
    
    mask = app.mask;
    
%   function [mask_coast] = coastline(mask, k_width)            attempt to
%   write this tomorrow for more efficien code 
        
%   end 
    
    if (init_conc_type ~= 7) & (init_conc_type ~= 2) & (init_conc_type ~= 3) & (init_conc_type ~= 4) & (init_conc_type ~= 5) & (init_conc_type ~= 6)
        init_conc_type = 3; 
    end 
    
    if init_conc_type == 2                      % uniform conc along coastline 
        k_width = 10;
        kernel = ones(k_width,k_width)/(k_width^2);
        mask_blur = 1-conv2(1-mask, kernel, "same");
        mask2 = 1-double(mask_blur.*mask<1);
        mask_coast = mask-mask2;
        
        alpha0_mat = mask_coast;
        
        alpha0 = interp2(x0,y0,alpha0_mat,x,y);
    end %complete 
    
    if init_conc_type == 3                         % uniform conc in water 
        k_width = 15; 
        kernel = ones(k_width, k_width)/(k_width^2); 
        mask_blur = conv2(mask, kernel, "same"); 
        mask3 = mask_blur>0; 
        
        alpha0 = mask3; 
        
        alpha0 = interp2(x0, y0, double(alpha0), x, y); 
    end %complete 
    
    if init_conc_type == 4                  % point source(s) on coastline  
       y0_mid = (y0(1,1)+y0(end,end))/2
       x0_mid = (x0(1,1)+x0(end,end))/2

       strength=[1e6,1e6,1e6];
       x0_source=x0_mid+[0,5000,10000];
       y0_source=[y0_mid,y0_mid+2000,y0_mid];
       
       alpha0 = 0;
       for i=1:3
          alpha0 = alpha0 + exp(-((x-x0_source(i)).^2+(y-y0_source(i)).^2)/strength(i));
       end
    end  

    if init_conc_type == 5                        % point source  in the middle of domain   
        x0_mid = (x0(1,1)+x0(end,end))/2;
        y0_mid = (y0(1,1)+y0(end,end))/2; 
       
        strength=1e-6;
        alpha0 = exp(-strength*((x-x0_mid).^2+(y-y0_mid).^2));
    end %complete 
    
    if init_conc_type == 6      % point sources along coast (type 4) +  coastline (type 2) 
        
    end 
    
    
    if init_conc_type == 7      % coastal point sources (type 4) + coastline (type 2) + point source in ocean (type 5) 
        
    end 

end
 

% mask_blur = mask convolued with gaussian kernel 
% mask 2 = mask_blur>0 
% mask_coast = mask2-mask 



