function comp_strmf_ann(IBAS,CNAM,YEAR1,YEARN)

% set path names, etc
IDIR=[IBAS filesep CNAM filesep 'ocn/hist'];
%  IDIR=[IBAS filesep CNAM filesep 'run/'];

% create output folder
ODIR='Data';mkdir(ODIR);

% start calculating
i0=60;j0=287;nreg=2;
strmf_sum=zeros(360,385);
for year=YEAR1:YEARN 
  yyyy=sprintf('%4.4i',year);
  disp([yyyy]) 

  FNAME=[IDIR filesep CNAM '.micom.hy.' yyyy '.nc'];
  uflx=nansum(ncread(FNAME,'uflx'),3);
  vflx=nansum(ncread(FNAME,'vflx'),3);

  strmf_sum=strmf_sum+micom_strmf(uflx,vflx,i0,j0,nreg);
end

strmf=strmf_sum/(YEARN-YEAR1+1);

% save index
save([ODIR filesep 'strmf_' CNAM '_' sprintf('%4.4i',YEAR1) '-' sprintf('%4.4i',YEARN) '.mat'],'strmf'); 

