function [temp] =biascorrect_parfor_function_100percentiles(temp_dataobs,...
		temp_datagcm,temp_XX,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);
	%troubleshoot
	%temp_dataobs=dataobs(:,:,:,j);
	%temp_datagcm=datagcm(:,:,:,j);
	%temp_XX=XX(j);

	for i=1:NUM_YY;
		f=find(~isnan(temp_dataobs(:,:,i)));
	       if(~isempty(f)); %some values not NaN
		[temp(:,:,i)]=...
		    biascorrect_window_100percentiles(temp_dataobs(:,:,i),temp_datagcm(:,:,i),...
			    bc_mult_or_add,YY(i),temp_XX,...
			HISTORICAL_YEAR_INDICES,FUTURE_YEAR_INDICES,...
			var,...
			BC_SEMI_DAY_WINDOW_MULT,BC_SEMI_DAY_WINDOW_ADD,...
			BC_MAX_PR_RATIO,...
			DRY_DAY_THRES);	
		else
			temp(:,:,i) = NaN(DAYS,YEARS);
	      end
	end

end
