<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Ning,<div class=""><br class=""></div><div class="">NCL’s <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/where.shtml" class="">where()</a> and <a href="https://www.ncl.ucar.edu/Document/Functions/Built-in/ismissing.shtml" class="">ismissing()</a> functions should be helpful for this task.</div><div class=""><br class=""></div><div class="">Here’s an example of how you could replace missing values in Y with values from the corresponding index in X:</div><div class=""><font face="Menlo" class="">y = where(.not.ismissing(y), y, x)</font></div><div class=""><br class=""></div><div class="">This could also be written as:</div><div class=""><div class=""><font face="Menlo" class="">y = where(ismissing(y), x, y)</font></div></div><div class=""><br class=""></div><div class="">I hope this helps,</div><div class="">Kevin</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Apr 18, 2018, at 7:38 AM, ma.n2007 <<a href="mailto:ma.n2007@aliyun.com" class="">ma.n2007@aliyun.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div style="font-family: 'Microsoft YaHei UI'; font-size: 14.666666984558105px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span class=""></span></div><blockquote style="margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em; font-family: 'Microsoft YaHei UI'; font-size: 14.666666984558105px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class=""><div class="FoxDiv20180418213629844843"><div class="">Hi Sir,</div><div class="">Imagin that I have two data X and Y, both are with (tim, lat, lon).</div><div class="">If some grids of Y has missing values, while X does not. How can I replace the missing values in Y with the X grid value? This could fill the Y.</div><div class="">Could you please help me? </div><div class=""><br class=""></div><div class="">Thanks</div><div class="">Ning</div><div class=""><br class=""></div><div class=""><span class=""></span></div></div></div></blockquote><span style="font-family: 'Microsoft YaHei UI'; font-size: 14.666666984558105px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: 'Microsoft YaHei UI'; font-size: 14.666666984558105px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: 'Microsoft YaHei UI'; font-size: 14.666666984558105px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">ncl-talk mailing list</span><br style="font-family: 'Microsoft YaHei UI'; font-size: 14.666666984558105px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:ncl-talk@ucar.edu" style="font-family: 'Microsoft YaHei UI'; font-size: 14.666666984558105px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">ncl-talk@ucar.edu</a><br style="font-family: 'Microsoft YaHei UI'; font-size: 14.666666984558105px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: 'Microsoft YaHei UI'; font-size: 14.666666984558105px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">List instructions, subscriber options, unsubscribe:</span><br style="font-family: 'Microsoft YaHei UI'; font-size: 14.666666984558105px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" style="font-family: 'Microsoft YaHei UI'; font-size: 14.666666984558105px; font-style: normal; font-variant-caps: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;" class="">http://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></div></blockquote></div><br class=""></div></body></html>