function out = get_StSF_Cl36(in,datadir)

% Interpolates into precalculated scaling factor grids to obtain Lm
% scaling factors for specified Rc and pressure vectors. 
%
% This code ingests an input structure with the following information:
%   cell array sfdata.t contains time vectors, result of getDipRc.m
%   vector pressure is atmospheric pressure (hPa) for measurement instances
%   vector lat is latitudes (DD)
%
% Input arg 'datadir' is unused but retained for compatibility with other
% scaling methods. 
%
% Adds a cell array containing corresponding vectors of scaling factor
% and returns the structure. 

% Loop through all samples

for a = 1:length(in.tmax)
    
    % Make pressure vector. This is planning ahead for time-dependent
    % pressure changes. 
    if iscell(in.pressure)
        % Case in.pressure is cell array with time-dependent p
        temp_p = in.pressure{a};
    else
        % Case in.pressure is vector with non-time-dependent p. Then it is 
        % a scalar for each sample, must be expanded to become vector
        temp_p = zeros(size(in.tmax{a})) + in.pressure(a);
    end
    temp_lat = (zeros(size(temp_p))+in.lat(a)); % Lat always is scalar for each sample, must be expanded
     % assign vector to cell in fields for each pathway
    in.Ksp_St{a} = zeros(size(temp_p))+stone2000(temp_lat,temp_p,1);  
    in.Casp_St{a} = in.Ksp_St{a}; % No difference for St
    in.Pf0sp_St{a} = in.Ksp_St{a}; % No difference for St
    in.Fesp_St{a} = in.Ksp_St{a};
    in.Tisp_St{a} = in.Ksp_St{a};
       
end

% Return

out = in;
    
    
    
    
    
    
    
    