function[dataout]= get_bias_correction_100percentiles(dataobs,datagcm,...
		XX,YY,NUM_XX,NUM_YY,...
		HISTORICAL_YEAR_INDICES,FUTURE_YEAR_INDICES,...
		bc_mult_or_add,var,BC_SEMI_DAY_WINDOW_MULT,BC_SEMI_DAY_WINDOW_ADD,BC_MAX_PR_RATIO,...
		DRY_DAY_THRES);

	%trouble shoot coarse bc
	%dataobs=obsdataCoarse(:,:,:,:,var);
	%datagcm=gcmdataCoarse(:,:,:,:,var);
	%bc_mult_or_add = VAR_MULT_OR_ADD(kk)
	%XX=COARSE_XX;
	%NUM_XX=NUM_COARSE_XX;
	%YY=COARSE_YY;
	%NUM_YY=NUM_COARSE_YY;
	%var=kk;

	%troubleshoot fine bc
	%var=1;
	%dataobs=obsdataFine(:,:,:,:,var);
	%datagcm=gcmdataFine(:,:,:,:,var);
	%bc_mult_or_add = VAR_MULT_OR_ADD(kk);
	%XX=FINE_XX;
	%NUM_XX=NUM_FINE_XX;
	%YY=FINE_YY;
	%NUM_YY=NUM_FINE_YY;
	%var=kk;

	%dataout= NaN(size(datagcm),  'single');                
	DAYS=size(datagcm,1);
	YEARS=size(datagcm,2);

   	parfor j=1:NUM_XX;
		temp = biascorrect_parfor_function_100percentiles(...
			dataobs(:,:,:,j),datagcm(:,:,:,j),...
			XX(j),YY,NUM_YY,DAYS,YEARS,HISTORICAL_YEAR_INDICES,...
			FUTURE_YEAR_INDICES,bc_mult_or_add,var,...
			BC_SEMI_DAY_WINDOW_MULT,BC_SEMI_DAY_WINDOW_ADD,BC_MAX_PR_RATIO,...
			DRY_DAY_THRES);

		dataout(:,:,:,j) = temp;
	end            
%%%=======================================================%
end
