function  stringname=filenametruncation(filename)
%% remove path from the full path-filename string and the file extensions 

%%  Kriging Software Package  version 1.0 beta,   October 29, 1998
%%  Copyright (c) 1998, property of Dezhang Chu and Woods Hole Oceanographic
%%  Institution.  All Rights Reserved.


pp=find(filename == '/' | filename == '\' | filename == ':');
if length(pp) > 0
   indx1=pp(length(pp))+1;
else
   indx1=1;
end
qq=find(filename == '.');
indx2=qq(length(qq))-1;
stringname=filename(indx1:indx2);
