<div dir="ltr"><div>Hi NCL user community, <br></div><div><br></div><div>I am trying to add two arrays: SMAP soil moisture L3 am and pm arrays, to obtain total soil moisture.<div><span style="color:rgb(0,0,0)">Soil moisture total(var5) is var3+var4 but when there are missing values in either of those arrays, then var5 is also having missing values. Instead, I want to use sm_pm(var4) when sm_am(var3) is having missing values</span><span style="color:rgb(0,0,0)"> and if sm_pm(var4) is having missing values then use sm_am(var3), and when both are having nonmissing values then sum them.</span></div><div><span style="color:rgb(0,0,0)"><br> </span></div></div><div>I use below code but var5 is solved for line 3 of the code rather than both the line 3 and line 4, so where var4 is missing it does not use var3 value:</div><div>
<div style="color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:Consolas,"Courier New",monospace;font-weight:normal;font-size:14px;line-height:19px;white-space:pre"><div><span style="color:rgb(0,0,0)"> var3 = sm_am(x,:,:) ;sm_am = soil moisture am data x = time dimension</span></div><div><span style="color:rgb(0,0,0)"> var4 = sm_pm(x,:,:) ;sm_pm = soil moisture pm data <span style="color:rgb(0,0,0)">x = time dimension</span>
</span><span style="color:rgb(0,0,0)"></span></div><div><span style="color:rgb(0,0,0)"> var5 = </span><span style="color:rgb(121,94,38)">where</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(121,94,38)">ismissing</span><span style="color:rgb(0,0,0)">(var3), var4, var3+var4) </span></div><div><span style="color:rgb(0,0,0)"> var5 = </span><span style="color:rgb(121,94,38)">where</span><span style="color:rgb(0,0,0)">(</span><span style="color:rgb(121,94,38)">ismissing</span><span style="color:rgb(0,0,0)">(var4), var3, var3+var4)</span></div></div> <br></div><div>Please suggest a way to get the correct total soil moisture array such that these conditions are satisfied. <br></div><div><br></div><div>I would appreciate your help in finding a solution.</div><div><br></div><div>Thank you, <br></div><div>Jetal <br></div><div><br></div></div>