function [dataout]=...
         biascorrect_window_100percentiles(obsdata,gcmdata,bc_mult_or_add,lat,lon,...
		HISTORICAL_YEAR_INDICES,FUTURE_YEAR_INDICES,var,...
		BC_SEMI_DAY_WINDOW_MULT,BC_SEMI_DAY_WINDOW_ADD,...
		BC_MAX_PR_RATIO,DRY_DAY_THRES);

	%obsdata = temp_dataobs(:,:,i);
	%gcmdata = temp_datagcm(:,:,i);
	%lat = YY(i);
	%lon = temp_XX;


        DAYS=size(gcmdata,1); %Days in gcm data

%%%=======================================================
%               BIAS CORRECT DATA OVER THE WINDOW
%%%=======================================================
	calendarDays = 1:DAYS;
        dayWindow = calendarDays;
	%-----------------------------------------------------
        %bias correct over region centered about each calendar day
        [tempdataout(calendarDays,:),tempdatafout(calendarDays,:)]=...
		bias_correction_100percentiles(obsdata(dayWindow,:),... 
              gcmdata(dayWindow,HISTORICAL_YEAR_INDICES),gcmdata(dayWindow,FUTURE_YEAR_INDICES),...
			bc_mult_or_add,var,DRY_DAY_THRES,calendarDays,BC_MAX_PR_RATIO);

    dataout(:,HISTORICAL_YEAR_INDICES)=tempdataout;
    dataout(:,FUTURE_YEAR_INDICES)=tempdatafout;

end %end of function
