<html><head><meta http-equiv="Content-Type" content="text/html charset=gb2312"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class="">Hi,Mary</div><div class=""><br class=""></div><div class=""> I found the problem might be in the inconsistence between “hsic" and “hlat”</div><div class=""><br class=""></div><div class=""> <span class="" style="font-family: Menlo; font-size: 14px; font-variant-ligatures: no-common-ligatures;"> fi = </span><span class="" style="font-family: Menlo; font-size: 14px; font-variant-ligatures: no-common-ligatures; color: rgb(52, 187, 199);">addfile</span><span class="" style="font-family: Menlo; font-size: 14px; font-variant-ligatures: no-common-ligatures;">(</span><span class="" style="color: rgb(195, 55, 32); font-family: Menlo; font-size: 14px; font-variant-ligatures: no-common-ligatures;">"HadISST_ice.nc"</span><span class="" style="font-family: Menlo; font-size: 14px; font-variant-ligatures: no-common-ligatures;">,</span><span class="" style="color: rgb(195, 55, 32); font-family: Menlo; font-size: 14px; font-variant-ligatures: no-common-ligatures;">"r”</span><span class="" style="font-family: Menlo; font-size: 14px; font-variant-ligatures: no-common-ligatures;">) </span></div><blockquote type="cite" class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div class="" style="word-wrap: break-word;"><div class="" style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> hsic = fi->sic </span>; it is global </div></div></blockquote></div></div></blockquote><blockquote type="cite" class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div class="" style="word-wrap: break-word;"><div class="" style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> hlon = fi->longitude</span></div><div class="" style="margin: 0px; font-size: 14px; line-height: normal; font-family: Menlo;"><span class="" style="font-variant-ligatures: no-common-ligatures;"> hlat = fi->latitude(</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(206, 121, 36);">{</span><span class="" style="font-variant-ligatures: no-common-ligatures;">-</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(195, 55, 32);">90</span><span class="" style="font-variant-ligatures: no-common-ligatures;">.:-</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(195, 55, 32);">50</span><span class="" style="font-variant-ligatures: no-common-ligatures;">.</span><span class="" style="font-variant-ligatures: no-common-ligatures; color: rgb(206, 121, 36);">}</span><span class="" style="font-variant-ligatures: no-common-ligatures;">) ; it is regional</span></div></div></blockquote></div></div></blockquote><div class=""><br class=""></div> However, the same scripts with such error can not run in mac, while it run well in my Linux and output figure & nc files although error existed in masking.<div class=""><div class=""> <div class=""> </div><div class=""><br class=""></div><div class="">Thank</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Lin</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">在 2016年12月20日,06:06,Mary Haley <<a href="mailto:haley@ucar.edu" class="">haley@ucar.edu</a>> 写道:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div class="gmail_default" style="font-size:small">Lin,</div><div class="gmail_default" style="font-size:small"><br class=""></div><div class="gmail_default" style="font-size:small">I'm confused by the comment on this line:</div><div class="gmail_default" style="font-size:small"><br class=""></div><div class="gmail_default" style="font-size:small"><div class="gmail_default"> Opt@SrcGridMask = where(.not.ismissing(thetao(0,:,:)),1,0) ; thetao is the source grids, with data zero in land, no missing </div><div class=""><br class=""></div><div class="">When you say "data zero in land, no missing", do you mean that the "thetao" variable is equal to 0 whenever it is over land, and that it contains no missing values? If so, then using "ismissing" on a variable that doesn't contain missing values is never going to return True.</div><div class=""><br class=""></div><div class="">Instead, you want something like this:</div><div class=""><br class=""></div><div class=""><div style="font-size:12.8px" class=""> Opt@SrcGridMask = where(thetao.ne.0,1,0)</div></div><div style="font-size:12.8px" class=""><br class=""></div><div style="font-size:12.8px" class="">This creates a mask array that is equal to 1 at locations where thetao is NOT equal to 0, and equal to 0 at locations where thetao is equal to 0. </div><div style="font-size:12.8px" class=""><br class=""></div><div style="font-size:12.8px" class="">Just as an example, this line should produce the exact same mask array:</div><div style="font-size:12.8px" class=""><br class=""></div><div style="font-size:12.8px" class=""><div style="font-size:small" class=""><div style="font-size:12.8px" class=""> Opt@SrcGridMask = where(thetao.eq.0,0,1)</div><div style="font-size:12.8px" class=""><br class=""></div><div style="font-size:12.8px" class="">--Mary</div><div style="font-size:12.8px" class=""><br class=""></div><div class=""><br class=""></div></div></div><div class=""><br class=""></div></div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Dec 19, 2016 at 11:53 AM, 林祥 <span dir="ltr" class=""><<a href="mailto:xianglin72@icloud.com" target="_blank" class="">xianglin72@icloud.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">Hi, all<div class=""><br class=""></div><div class=""> I have many CMIP5 sea ice concentration data and want to regrid them into the same grid coordinate as HadISST.</div><div class=""><br class=""></div><div class=""> Since the land area own missing_value (_FillValue) in HadiSST, I also want the regridded data show missing values in land .</div><div class=""><br class=""></div><div class="">I use the following scripts:</div><div class=""> </div><div class=""> <span style="font-family:Menlo;font-size:14px;font-variant-ligatures:no-common-ligatures" class=""> fi = </span><span style="font-family:Menlo;font-size:14px;font-variant-ligatures:no-common-ligatures;color:rgb(52,187,199)" class="">addfile</span><span style="font-family:Menlo;font-size:14px;font-variant-ligatures:no-common-ligatures" class="">(</span><span style="color:rgb(195,55,32);font-family:Menlo;font-size:14px;font-variant-ligatures:no-common-ligatures" class="">"HadISST_ice.nc"</span><span style="font-family:Menlo;font-size:14px;font-variant-ligatures:no-common-ligatures" class="">,</span><span style="color:rgb(195,55,32);font-family:Menlo;font-size:14px;font-variant-ligatures:no-common-ligatures" class="">"r"</span><span style="font-family:Menlo;font-size:14px;font-variant-ligatures:no-common-ligatures" class="">)</span></div><div style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""> hsic = fi->sic</span></div><div style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""> hlon = fi->longitude</span></div><div style="margin:0px;font-size:14px;line-height:normal;font-family:Menlo" class=""><span style="font-variant-ligatures:no-common-ligatures" class=""> hlat = fi->latitude(</span><span style="font-variant-ligatures:no-common-ligatures;color:#ce7924" class="">{</span><span style="font-variant-ligatures:no-common-ligatures" class="">-</span><span style="font-variant-ligatures:no-common-ligatures;color:#c33720" class="">90</span><span style="font-variant-ligatures:no-common-ligatures" class="">.:-</span><span style="font-variant-ligatures:no-common-ligatures;color:#c33720" class="">50</span><span style="font-variant-ligatures:no-common-ligatures" class="">.</span><span style="font-variant-ligatures:no-common-ligatures;color:#ce7924" class="">}</span><span style="font-variant-ligatures:no-common-ligatures" class="">)</span></div><div class=""> …….</div><div class=""> </div><div class=""> Opt@SrcGridMask = where(.not.ismissing(thetao(0,<wbr class="">:,:)),1,0) ; thetao is the source grids, with data zero in land, no missing </div><div class=""> Opt@DstGridMask = where(.not.ismissing(hsic(0,:,<wbr class="">:)),1,0) ; hsic is the HadISST SIC data, with missing values in land</div><div class=""> </div><div class=""> <span style="font-family:Menlo;font-size:14px" class="">Opt@DstGridLat </span><span style="font-family:Menlo;font-size:14px" class=""> </span><span style="font-family:Menlo;font-size:14px" class="">= hlat</span></div><div class=""><span style="font-family:Menlo;font-size:14px" class=""> </span><span style="font-family:Menlo;font-size:14px" class="">Opt@DstGridLon </span><span style="font-family:Menlo;font-size:14px" class=""> </span><span style="font-family:Menlo;font-size:14px" class="">= hlon</span> </div><div class="">……..</div><div class=""><br class=""></div><div class=""> <span style="font-family:Menlo;font-size:14px" class=""> </span><span style="font-family:Menlo;font-size:14px" class="">thetao_regrid = ESMF_regrid(thetao,Opt)</span></div><div class=""><br class=""></div><div class="">However, I found the regridded data “thetao_regrid" show zero values, not missing values in land.</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""> How to make the regridded data have missing values for the same grids as HadISST?</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Thank</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Lin </div><div class=""><br class=""></div><div class=""> </div><div class=""><br class=""></div></div><br class="">______________________________<wbr class="">_________________<br class="">
ncl-talk mailing list<br class="">
<a href="mailto:ncl-talk@ucar.edu" class="">ncl-talk@ucar.edu</a><br class="">
List instructions, subscriber options, unsubscribe:<br class="">
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank" class="">http://mailman.ucar.edu/<wbr class="">mailman/listinfo/ncl-talk</a><br class="">
<br class=""></blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></div></div></body></html>