function stdposnfile(yd,lat,lon)
% 
% program to convert SCS position files to GLOBEC standard
% pos'n file format
% using a couple of Ari's functions: "date" and "dec2hrm"
%
% Uses the "fprintf" command inside a For-Loop to generate
% formatted data
%
% Note the following funtion should be made more flexible at one point
date=day2date(yd);
[hh,mm]=dec2hrm(yd);
hhmm=(hh*100)+mm;
gmt=hhmm+400;
if gmt >= 2400
 gmt=gmt-2400;
end;
%
fn=input('enter outputfile: ','s');
fid = fopen(fn,'w');
for i=1:length(yd);
fprintf(fid,'%7.4f %8.0f %5.0f %5.0f %8.4f %9.4f\n',...
 yd(i,:),date(i,:),hhmm(i,:),gmt(i,:),lat(i,:),lon(i,:));
end
fclose(fid)
