<div dir="ltr"><div class="gmail_default" style="font-size:small">All,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Dennis and I took this discussion with Greg offline for a bit and have come to a solution. (Greg, thanks for providing the script and data!)</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I'm posting back to ncl-talk so others can benefit.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">There were four issues:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">1) The "conserve" method requires "grid corners" to be input. If they are not, then NCL uses an internally developed "bounding box method". Generally it works well, but can be problematic because NCL can't guess at the structure of your grid. We switch to using the "bilinear" method:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Opt@InterpMethod = "bilinear" ; the default</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">2) The destination grid is rather large (6144 x 6144) which causes large (> 3 GB) NetCDF files to be generated. You need to set:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><div class="gmail_default"><span style="font-size:12.8px">Opt@SrcLargeFile = True </span><br style="font-size:12.8px"><span style="font-size:12.8px">Opt@DstLargeFile = True </span><br style="font-size:12.8px"><span style="font-size:12.8px">Opt@WgtLargeFile = True </span><br></div><div class="gmail_default"><span style="font-size:12.8px"><br></span></div><div class="gmail_default"><span style="font-size:12.8px">so that large file support is turned on. </span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">3) Dennis added calls to the "where" function to set all negative values to missing, and to create a source grid mask:</span></div></div><div class="gmail_default" style="font-size:small"><div style="font-size:12.8px"><div><div><div><div><div><div><br> CDR_Conc = where (CDR_Conc.lt.0, CDR_Conc@_FillValue, CDR_Conc)<br><br></div> Opt@SrcMask2D = where(ismissing(CDR_Conc),0,1)</div><div><br></div><div>4) The output files were so large, we had to use a scratch directory where there was enough disk space.<br><br></div>Attached is the modified script and png output.</div><div><br></div><div>--Mary<br><br></div></div></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Mar 28, 2017 at 7:31 PM, Dennis Shea <span dir="ltr"><<a href="mailto:shea@ucar.edu" target="_blank">shea@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>I have looked at this using NCL 6.3.0 (MAC OS)<br><br>From: PET0.RegridWeightGen.Log<br><br>The error is "<font size="2">Concave Element Detected"<br><br></font></div><font size="2">***Someone else will have to suggest a work around.***<br></font></div><font size="2"></font><div><font size="2">---<br></font><div><font size="2"><br>20170328 173330.778 INFO PET0 Running with ESMF Version 6.3.0rp1<br>20170328 173734.737 INFO PET0 Running with ESMF Version 6.3.0rp1<br>20170328 174808.719 ERROR ~~~~~~~~~~~~~~~~~~ Concave Element Detected ~~~~~~~~~~~~~~~~~~<br>20170328 174808.723 ERROR PET0 concave elem. id=24017<br>20170328 174808.723 ERROR PET0 <br>20170328 174808.723 ERROR PET0 concave elem. coords (lon [-180 to 180], lat [-90 to 90]) (x,y,z)<br>20170328 174808.723 ERROR PET0 ------------------------------<wbr>------------------------------<wbr>-----<br>20170328 174808.723 ERROR PET0 0 (179.815179, 42.405261) (-0.738390, 0.002382, 0.674370)<br>20170328 174808.723 ERROR PET0 1 (179.627955, 42.541923) (-0.736767, 0.004784, 0.676129)<br>20170328 174808.723 ERROR PET0 2 (89.813369, 42.680222) (0.002395, 0.735145, 0.677906)<br>20170328 174808.723 ERROR PET0 3 (-89.999394, 42.542971) (0.000008, -0.736770, 0.676143)<br>20170328 174808.723 ERROR PET0 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<wbr>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<wbr>~~~~~~<br>20170328 174808.723 ERROR PET0 ESMCI_Regrid_F.C:149 c_esmc_regrid_create() Invalid argument - Src contains a concave cell<br>20170328 174808.727 ERROR PET0 ESMCI_Regrid_F.C:434 c_esmc_regrid_create() Invalid argument Internal subroutine call returned Error<br>20170328 174808.727 ERROR PET0 ESMF_Regrid.F90:321 ESMF_RegridStore Invalid argument - Internal subroutine call returned Error<br>20170328 174808.727 ERROR PET0 ESMF_FieldRegrid.F90:1008 ESMF_FieldRegridStoreNX Invalid argument - Internal subroutine call returned Error<br>20170328 174808.727 ERROR PET0 ESMF_RegridWeightGen.F90:1152 ESMF_RegridWeightGenFile Invalid argument - Internal subroutine call returned <br><br>=======<br>/glade/p/work/shea/ESMF/CDR_NS<wbr>IDC>dir<br><br>-rw-r--r-- 1 shea ncar 3170894556 Mar 28 19:12 <a href="http://destination_grid_file.nc" target="_blank">destination_grid_file.nc</a><br>-rw-r--r-- 1 shea ncar 4277 Mar 28 17:55 g02202_Regrid_v01.ncl<br>-rw-r--r-- 1 shea ncar 1868 Mar 28 19:12 g02202_Regrid_v01.ncl_orig<br>-rw-r--r-- 1 shea ncar 528585368 Mar 28 19:24 <a href="http://masiemask_ims4km.nc" target="_blank">masiemask_ims4km.nc</a><br>-rw-r--r-- 1 shea ncar 7033 Mar 28 18:44 OUT_g02202.txt<br>-rw-r--r-- 1 shea ncar 1849 Mar 28 17:59 PET0.RegridWeightGen.Log<br>-rw-r--r-- 1 shea ncar 3738850 Mar 28 19:24 <a href="http://seaice_conc_daily_nh_f13_20060101_v02r00.nc" target="_blank">seaice_conc_daily_nh_f13_20060<wbr>101_v02r00.nc</a><br>-rw-r--r-- 1 shea ncar 11440924 Mar 28 19:12 <a href="http://source_grid_file.nc" target="_blank">source_grid_file.nc</a><br></font></div></div><div class="gmail_extra"><br>=========<br><div class="gmail_quote"><div><div class="gmail-m_-391322832387855215h5">On Tue, Mar 28, 2017 at 2:47 PM, Greg Deemer <span dir="ltr"><<a href="mailto:greg.deemer@nsidc.org" target="_blank">greg.deemer@nsidc.org</a>></span> wrote:<br></div></div><blockquote style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex" class="gmail_quote"><div><div class="gmail-m_-391322832387855215h5"><div style="word-wrap:break-word;color:rgb(0,0,0);font-size:14px;font-family:calibri,sans-serif"><div>Hello, </div><div><br></div><div>I’m attempting to regrid sea-ice concentrations from a coarse spatial resolution onto a higher-resolution grid. Both grids are NSIDC Sea Ice Polar Stereographic North with a WGS84 reference datum. The coarse product (<a href="https://nsidc.org/data/g02202" target="_blank">https://nsidc.org/data/g02202</a><wbr>) is 448X304, or a 25km nominal resolution. The higher-resolution product (<a href="http://nsidc.org/data/docs/noaa/g02186_masie/index.html" target="_blank">http://nsidc.org/data/docs/no<wbr>aa/g02186_masie/index.html</a>) is 6144x6144, or a 4km nominal resolution.</div><div><br></div><div>The grid for the high-res product is a little funky in that it extends well beyond the equator, from the polar view (for added context, it is the 4km variant of the 24km grid handled here: <a href="http://www.ncl.ucar.edu/Applications/nic_ims.shtml" target="_blank">http://www.ncl.ucar.edu/<wbr>Applications/nic_ims.shtml</a>). I’m wondering if this is causing some error in the ESMF_regrid routine, which is throwing two errors:</div><div><br></div><div>1. nonsensical values to the minimum Extlon2d and minimum ExtGridCenter_Lon, as seen in the processing log</div><div><br></div><div><div>(0)<span style="white-space:pre-wrap" class="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308Apple-tab-span">        </span>get_src_grid_info: source lat dims = (448,304)</div><div>(0)<span style="white-space:pre-wrap" class="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308Apple-tab-span">        </span>get_src_grid_info: source lon dims = (448,304)</div><div>(0)<span style="white-space:pre-wrap" class="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308Apple-tab-span">        </span>get_src_grid_info: source grid type is 'curvilinear'</div><div>(0)<span style="white-space:pre-wrap" class="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308Apple-tab-span">        </span>curvilinear_to_SCRIP: calculating grid corners...</div><div>(0)<span style="white-space:pre-wrap" class="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308Apple-tab-span">        </span>curvilinear_to_SCRIP: no lat values are at the poles, so</div><div>(0)<span style="white-space:pre-wrap" class="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308Apple-tab-span">        </span> calculating grid corners using</div><div>(0)<span style="white-space:pre-wrap" class="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308Apple-tab-span">        </span> calc_SCRIP_corners_noboundarie<wbr>s...</div><div>(0)<span style="white-space:pre-wrap" class="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308Apple-tab-span">        </span>calc_SCRIP_corners_noboundarie<wbr>s</div><div>(0)<span style="white-space:pre-wrap" class="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308Apple-tab-span">        </span> min/max original lat: 31.1026717524309/89.8368159996<wbr>152</div><div>(0)<span style="white-space:pre-wrap" class="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308Apple-tab-span">        </span> min/max original lon: -180/179.813975395493</div><div>(0)<span style="white-space:pre-wrap" class="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308Apple-tab-span">        </span>calc_SCRIP_corners_noboundarie<wbr>s</div><div>(0)<span style="white-space:pre-wrap" class="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308Apple-tab-span">        </span> min/max Extlat2d: 30.8580632088782/89.8368159996<wbr>152</div><div>(0)<span style="white-space:pre-wrap" class="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308Apple-tab-span">        </span> min/max Extlon2d: -539.812759557033/180.00120791<wbr>7857</div><div>(0)<span style="white-space:pre-wrap" class="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308Apple-tab-span">        </span>calc_SCRIP_corners_noboundarie<wbr>s</div><div>(0)<span style="white-space:pre-wrap" class="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308Apple-tab-span">        </span> min/max ExtGridCenter_lat: 30.98047461780758/89.836815999<wbr>6152</div><div>(0)<span style="white-space:pre-wrap" class="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308Apple-tab-span">        </span> min/max ExtGridCenter_lon: -269.812759557033/179.81517939<wbr>19093</div><div>(0)<span style="white-space:pre-wrap" class="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308Apple-tab-span">        </span>=====> CPU Elapsed Time: curvilinear_to_SCRIP: 0.109368 seconds <=====</div><div>(0)<span style="white-space:pre-wrap" class="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308Apple-tab-span">        </span>get_dst_grid_info: destination lat dims = (6144,6144)</div><div>(0)<span style="white-space:pre-wrap" class="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308Apple-tab-span">        </span>get_dst_grid_info: destination lon dims = (6144,6144)</div><div>(0)<span style="white-space:pre-wrap" class="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308Apple-tab-span">        </span>curvilinear_to_SCRIP: calculating grid corners...</div><div>(0)<span style="white-space:pre-wrap" class="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308Apple-tab-span">        </span>curvilinear_to_SCRIP: no lat values are at the poles, so</div><div>(0)<span style="white-space:pre-wrap" class="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308Apple-tab-span">        </span> calculating grid corners using</div><div>(0)<span style="white-space:pre-wrap" class="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308Apple-tab-span">        </span> calc_SCRIP_corners_noboundarie<wbr>s...</div><div>(0)<span style="white-space:pre-wrap" class="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308Apple-tab-span">        </span>calc_SCRIP_corners_noboundarie<wbr>s</div><div>(0)<span style="white-space:pre-wrap" class="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308Apple-tab-span">        </span> min/max original lat: -21.4848/89.9729</div><div>(0)<span style="white-space:pre-wrap" class="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308Apple-tab-span">        </span> min/max original lon: -180/180</div><div>(0)<span style="white-space:pre-wrap" class="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308Apple-tab-span">        </span>calc_SCRIP_corners_noboundarie<wbr>s</div><div>(0)<span style="white-space:pre-wrap" class="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308Apple-tab-span">        </span> min/max Extlat2d: -21.5023/89.9729</div><div>(0)<span style="white-space:pre-wrap" class="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308Apple-tab-span">        </span> min/max Extlon2d: -539.995/180</div><div>(0)<span style="white-space:pre-wrap" class="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308Apple-tab-span">        </span>calc_SCRIP_corners_noboundarie<wbr>s</div><div>(0)<span style="white-space:pre-wrap" class="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308Apple-tab-span">        </span> min/max ExtGridCenter_lat: -21.4935/89.9729</div><div>(0)<span style="white-space:pre-wrap" class="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308Apple-tab-span">        </span> min/max ExtGridCenter_lon: -269.988/179.989</div></div><div><br></div><div>And a second error:</div><div>2. NetCDF: One or more variable sizes violate format constraints</div><div><br></div><div>I tried converting longitudes to monotonic, but the output log still spit out large negative values (e.g. <<0). I’ve also added Opt@srcLargeFile and Opt@dstLargFile lines within the code as I see the resulting ‘<a href="http://destination-grid-file.nc" target="_blank">destination-grid-file.nc</a>’ is on the order of 3.15Gb in size.</div><div><br></div><div>Please find script attached. The data files in use for this script can be found here:</div><div>Coarse: <a href="ftp://sidads.colorado.edu/pub/DATASETS/NOAA/G02202_v2/north/daily/2006/seaice_conc_daily_nh_f13_20060101_v02r00.nc" target="_blank">ftp://sidads.colorado.<wbr>edu/pub/DATASETS/NOAA/G02202_v<wbr>2/north/daily/2006/seaice_conc<wbr>_daily_nh_f13_20060101_v02r00.<wbr>nc</a></div><div>Fine: <a href="ftp://sidads.colorado.edu/DATASETS/NOAA/G02186/ancillary/masiemask_ims4km.nc" target="_blank">ftp://sidads.colorado.ed<wbr>u/DATASETS/NOAA/G02186/ancilla<wbr>ry/masiemask_ims4km.nc</a></div><div><br></div><div>Thank you for the attention to this question and for any help.</div><span class="gmail-m_-391322832387855215m_9062197686647367206gmail-HOEnZb"><font color="#888888"><div><br></div><div><div id="gmail-m_-391322832387855215m_9062197686647367206gmail-m_2410564885733441308MAC_OUTLOOK_SIGNATURE"><div><div>-- </div><div><br></div></div><div><div style="font-family:-webkit-standard"><b>Greg Deemer</b></div><div style="font-family:-webkit-standard">User Services Office</div><div style="font-family:-webkit-standard">National Snow and Ice Data Center</div><div style="font-family:-webkit-standard"><a value="+13037358068" href="tel:%28303%29%20735-8068" target="_blank">(303) 735-8068</a></div><div style="font-family:-webkit-standard"><a href="http://nsidc.org/" target="_blank">http://nsidc.org</a></div><div style="font-family:-webkit-standard">Twitter: @NSIDC</div></div></div></div></font></span></div>
<br></div></div>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a rel="noreferrer" href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" target="_blank">http://mailman.ucar.edu/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div></div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu" target="_blank">ncl-talk@ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="http://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">http://mailman.ucar.edu/mailma<wbr>n/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div></div>