mgetdir.m 661 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
function mpath = mgetdir(M_ABBREV);
%function mpath = mgetdir(M_ABBREV);
%function mpath = mgetdir(abbrev);
%
% outputs the full path to the directory for data of type abbrev
%   set in m_setup
%
% e.g. root_sal = mgetdir('bot_sal');
%   or root_sal = mgetdir('M_BOT_SAL');
%   might give root_sal = '/local/users/pstar/cruise/data/ctd/BOTTLE_SAL';

if ~strncmp(M_ABBREV, 'M_', 2); M_ABBREV = ['M_' upper(M_ABBREV)]; end

m_common

ii = find(strcmp(M_ABBREV, MEXEC_G.MDIRLIST(:,1)));
if length(ii)==1
   mpath = [MEXEC_G.MEXEC_DATA_ROOT '/' MEXEC_G.MDIRLIST{ii,2}];
else
20 21
   warning([M_ABBREV ' set ' num2str(length(ii)) ' times in m_setup'])
   mpath = '';
22
end