function [V,T,C]=ncmerge(fnams,varn,cord)
% [V,T,C]=NCMERGE(fnams,varn,cord)
%
% INPUT:
%
% fnams     A cell array with filenames
% varn      A variable name string (e.g., 'var134')
% cord      A lat lon coordinate in decimal degrees (e.g., [41.905   12.474])
%
% OUTPUT:
%
% V         The merged variables
% T         The merged times
% C         The merged closes coordinates
%
% EXAMPLEL
%
% fnams={'ERA5-Single-2023_10.nc','ERA5-Single-2023_11.nc','ERA5-Single-2023_12.nc'};
% rome=[41.905   12.474];
% [V,T,C]=ncmerge(fnams,'var134',rome);
%
% Last modified by fjsimons-at-alum.mit.edu, 11/05/2024

[V,T,C]=deal([]);
for index=1:length(fnams)
    [v,t,c]=readVariableFromNetCDF(fnams{index},varn,cord);
    V=[V ; v];
    T=[T ; t];
    C=[C ; c];
end

