<div dir="ltr"><div><div><div><div>Hi Laura,<br><br></div>The problem is that &quot;where&quot; 
evaluates both options and then chooses which to put where in your 
ratio_rainc variable. Therefore itll raise the error even though the 
value wont be used.<br><br></div>A workaround would be setting a mask first, setting a dummy value, and masking the variable later, e.g.<br><br></div>msk = where(ismissing(rain),1,0)<br></div>rain = where(rain.eq.0,9999,rain)<br><div>
ratio_rainc = where(rain.gt.5.,rainc/rain,ra<wbr>in@_FillValue)<br></div><div>ratio_rainc = where(msk.eq.1,ratio_rainc@_<wbr>FIllValue,ratio_rainc)<br><br></div>It&#39;s not very elegant or efficient but works.
</div>