<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Douglas,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Thanks for providing a clean script and your data.  I tried running it on Friday, but it was taking a really long time for some reason and I never got back to it.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">I&#39;m running it again to see if I can reproduce the error.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">--Mary</div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jul 28, 2017 at 11:54 AM, Yuhan Rao <span dir="ltr">&lt;<a href="mailto:yrao@terpmail.umd.edu" target="_blank">yrao@terpmail.umd.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><span style="font-size:12.8px">Hi,</span><div style="font-size:12.8px"><br></div><div style="font-size:12.8px">My apologies for the previous incomplete message.</div><span class=""><div style="font-size:12.8px"> </div><div style="font-size:12.8px">I was running into issues of ESMF_regid_with_weights. I am trying to regrid the the NDVI data (at the resolution of 1/12 degree) to a 0.75 degree for my analysis.</div><div style="font-size:12.8px">When I try to regrid them using ESMF_regrid_with_weights functions, I ran into the problem during weight generation step. The information provided by the debug option is listed here:</div></span><div><div><span style="font-size:12.8px">(0)<span style="white-space:pre-wrap">        </span>=====&gt; CPU Elapsed Time: rectilinear_to_SCRIP: 9.34327 seconds &lt;=====</span></div><div><span style="font-size:12.8px">(0)<span style="white-space:pre-wrap">        </span>ESMF_regrid_gen_weights: number of processors used: 1</span></div><div><span style="font-size:12.8px">(0)<span style="white-space:pre-wrap">        </span>------------------------------<wbr>--------------------</span></div><div><span style="font-size:12.8px">(0)<span style="white-space:pre-wrap">        </span>ESMF_regrid_gen_weights: the following command is about to be executed on the system:</span></div><div><span style="font-size:12.8px">(0)<span style="white-space:pre-wrap">        </span>&#39;ESMF_RegridWeightGen --source src_SCRIP.nc --destination dst_SCRIP.nc --weight <a href="http://gimms_to_rect.nc" target="_blank">gimms_to_rect.nc</a> --method patch -i --check&#39;</span></div><div><span style="font-size:12.8px">(0)<span style="white-space:pre-wrap">        </span>------------------------------<wbr>--------------------</span></div><div><span style="font-size:12.8px">(0)<span style="white-space:pre-wrap">        </span>ESMF_regrid_gen_weights: output from &#39;ESMF_RegridWeightGen&#39;:</span></div><div><span style="font-size:12.8px">(0)<span style="white-space:pre-wrap">        </span>      Starting weight generation with these inputs: </span></div><div><span style="font-size:12.8px">(1)<span style="white-space:pre-wrap">        </span>        Source File: src_SCRIP.nc</span></div><div><span style="font-size:12.8px">(2)<span style="white-space:pre-wrap">        </span>        Destination File: dst_SCRIP.nc</span></div><div><span style="font-size:12.8px">(3)<span style="white-space:pre-wrap">        </span>        Weight File: <a href="http://gimms_to_rect.nc" target="_blank">gimms_to_rect.nc</a></span></div><div><span style="font-size:12.8px">(4)<span style="white-space:pre-wrap">        </span>        Source File is in SCRIP format</span></div><div><span style="font-size:12.8px">(5)<span style="white-space:pre-wrap">        </span>        Source Grid is a global grid</span></div><div><span style="font-size:12.8px">(6)<span style="white-space:pre-wrap">        </span>        Source Grid is a logically rectangular grid</span></div><div><span style="font-size:12.8px">(7)<span style="white-space:pre-wrap">        </span>        Destination File is in SCRIP format</span></div><div><span style="font-size:12.8px">(8)<span style="white-space:pre-wrap">        </span>        Destination Grid is a global grid</span></div><div><span style="font-size:12.8px">(9)<span style="white-space:pre-wrap">        </span>        Destination Grid is a logically rectangular grid</span></div><div><span style="font-size:12.8px">(10)<span style="white-space:pre-wrap">        </span>        Regrid Method: patch</span></div><div><span style="font-size:12.8px">(11)<span style="white-space:pre-wrap">        </span>        Pole option: ALL</span></div><div><span style="font-size:12.8px">(12)<span style="white-space:pre-wrap">        </span>        Ignore unmapped destination points</span></div><div><span style="font-size:12.8px">(13)<span style="white-space:pre-wrap">        </span>        Norm Type: dstarea</span></div><div><span style="font-size:12.8px">(14)<span style="white-space:pre-wrap">        </span>     </span></div><div><span style="font-size:12.8px">(0)<span style="white-space:pre-wrap">        </span>------------------------------<wbr>--------------------</span></div><div><span style="font-size:12.8px">(0)<span style="white-space:pre-wrap">        </span>ESMF_regrid_gen_weights: &#39;ESMF_RegridWeightGen&#39; was not successful.</span></div><div style="font-size:12.8px"><br></div></div><div style="font-size:12.8px">My scripts is listed below:</div><div style="font-size:12.8px"><br></div><div><div><span style="font-size:12.8px">;*****************************<wbr>*****************</span></div><div><span style="font-size:12.8px">;  process_ndvi3g_data.ncl</span></div><div><span style="font-size:12.8px">;</span></div><div><span style="font-size:12.8px">;    -read in ndvi 3g data</span></div><div><span style="font-size:12.8px">;    -regrid 1/12 degree to 0.75 deg</span></div><div><span style="font-size:12.8px">;    -during regridding, mask climatology value</span></div><div><span style="font-size:12.8px">;*****************************<wbr>******************</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">load &quot;$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/esmf/ESMF_<wbr>regridding.ncl&quot;</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">pixel   = 0.75                           ; new grid size</span></div><div><span style="font-size:12.8px">latN    = todouble(  90.-0.5*pixel)      ; geolocation limits</span></div><div><span style="font-size:12.8px">latS    = todouble( -90.+0.5*pixel)      ; for center of coner grids</span></div><div><span style="font-size:12.8px">lonW    = todouble(-180.+0.5*pixel)</span></div><div><span style="font-size:12.8px">lonE    = todouble( 180.-0.5*pixel)</span></div><div><span style="font-size:12.8px">nlon    = toint((lonE-lonW)/pixel+1)</span></div><div><span style="font-size:12.8px">nlat    = toint((latN-latS)/pixel+1)</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">lat_new = todouble(fspan(latS,latN,nlat)<wbr>)</span></div><div><span style="font-size:12.8px">lon_new = todouble(fspan(lonW,lonE,nlon)<wbr>)</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">lat_new!0             = &quot;lat&quot;</span></div><div><span style="font-size:12.8px">lat_new&amp;lat           = lat_new</span></div><div><span style="font-size:12.8px">lat_new&amp;lat@long_name = &quot;latitude&quot;</span></div><div><span style="font-size:12.8px">lat_new&amp;lat@units     = &quot;degrees_north&quot;</span></div><div><span style="font-size:12.8px">lon_new!0             = &quot;lon&quot;</span></div><div><span style="font-size:12.8px">lon_new&amp;lon           = lon_new</span></div><div><span style="font-size:12.8px">lon_new&amp;lon@long_name = &quot;longitude&quot;</span></div><div><span style="font-size:12.8px">lon_new&amp;lon@units     = &quot;degrees_east&quot;</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">ndvi_all = new((/24,nlat,nlon/),float)</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">fin  = addfile(&quot;<a href="http://ndvi3g_1982_nasa.nc" target="_blank">ndvi3g_1982_nasa.nc</a>&quot;,<wbr>&quot;r&quot;)</span></div><div><span style="font-size:12.8px">ndvi = fin-&gt;ndvi</span></div><div><span style="font-size:12.8px">flag = fin-&gt;flag</span></div><div><span style="font-size:12.8px">printVarSummary(ndvi)</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">ntime = dimsizes(ndvi&amp;time)</span></div><div><span style="font-size:12.8px">;---iterate through each 15-day period</span></div><div><span style="font-size:12.8px">;   masking out data with flag=2 &amp; missing data</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">;---Generate dst grid file</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">  dstGridName        = &quot;dst_SCRIP.nc&quot;</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">  Opt                = True</span></div><div><span style="font-size:12.8px">  Opt@ForceOverwrite = True</span></div><div><span style="font-size:12.8px">  Opt@PrintTimins    = True</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">  rectilinear_to_SCRIP(<wbr>dstGridName,lat_new,lon_new,<wbr>Opt)</span></div><div><span style="font-size:12.8px">  delete(Opt)</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">  do itime = 0, ntime-1</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">;---Generate Src grids (mask is changing)</span></div><div><span style="font-size:12.8px">   tmpndvi = ndvi(itime,:,:)</span></div><div><span style="font-size:12.8px">   tmpmask = flag(itime,:,:)</span></div><div><span style="font-size:12.8px">   tmpmask = where((.not.ismissing(tmpndvi)<wbr>).and.(tmpmask.ne.2),1,0)</span></div><div><span style="font-size:12.8px">      </span></div><div><span style="font-size:12.8px">   srcGridName        = &quot;src_SCRIP.nc&quot;</span></div><div><span style="font-size:12.8px">   wgtFileName        = &quot;<a href="http://gimms_to_rect.nc" target="_blank">gimms_to_rect.nc</a>&quot;</span></div><div><span style="font-size:12.8px">   </span></div><div><span style="font-size:12.8px">   Opt                = True</span></div><div><span style="font-size:12.8px">   Opt@GridMask       = tmpmask</span></div><div><span style="font-size:12.8px">   Opt@ForceOverwrite = True</span></div><div><span style="font-size:12.8px">   Opt@PrintTimings   = True</span></div><div><span style="font-size:12.8px">   Opt@Title          = &quot;GIMMS Grid&quot;</span></div><div><span style="font-size:12.8px">   </span></div><div><span style="font-size:12.8px">   rectilinear_to_SCRIP(<wbr>srcGridName,tmpndvi&amp;lat,<wbr>tmpndvi&amp;lon,Opt)</span></div><div><span style="font-size:12.8px">   delete(Opt)</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">;-----------------------------<wbr>-----------------</span></div><div><span style="font-size:12.8px">;  Generate the weights between Src to Dst grids</span></div><div><span style="font-size:12.8px">;-----------------------------<wbr>-----------------</span></div><div><span style="font-size:12.8px">   Opt                = True</span></div><div><span style="font-size:12.8px">   Opt@InterpMethod   = &quot;patch&quot;</span></div><div><span style="font-size:12.8px">   Opt@ForceOverwrite = True</span></div><div><span style="font-size:12.8px">   Opt@PrintTimings   = True</span></div><div><span style="font-size:12.8px">   Opt@Debug          = True</span></div><div><span style="font-size:12.8px">   Opt@Check          = True</span></div><div><span style="font-size:12.8px">;   setfileoption(&quot;nc&quot;,&quot;Format&quot;,&quot;<wbr>LargeFile&quot;)</span></div><div><span style="font-size:12.8px">   ESMF_regrid_gen_weights(<wbr>srcGridName,dstGridName,<wbr>wgtFileName,Opt)</span></div><div><span style="font-size:12.8px">   delete(Opt)</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">   ;----------------------------<wbr>----------------</span></div><div><span style="font-size:12.8px">   ; esmf_regrid with precalculated weight file</span></div><div><span style="font-size:12.8px">   ;----------------------------<wbr>----------------</span></div><div><span style="font-size:12.8px">   Opt                 = True</span></div><div><span style="font-size:12.8px">   Opt@PrintTimings    = True</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">   tmp_regrid = ESMF_regrid_with_weights(<wbr>tmpndvi,wgtFileName,Opt)</span></div><div><span style="font-size:12.8px">   printVarSummary(tmp_regrid)</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">   ndvi_all(itime,:,:) = tmp_regrid</span></div><div><span style="font-size:12.8px">   </span></div><div><span style="font-size:12.8px">  end do ;itime</span></div><div><span style="font-size:12.8px">  </span></div><div><span style="font-size:12.8px">ndvi_all!0             = &quot;time&quot;</span></div><div><span style="font-size:12.8px">ndvi_all!1             = &quot;lat&quot;</span></div><div><span style="font-size:12.8px">ndvi_all!2             = &quot;lon&quot;</span></div><div><span style="font-size:12.8px">ndvi_all&amp;lat           = lat_new</span></div><div><span style="font-size:12.8px">ndvi_all&amp;lon           = lon_new</span></div><div><span style="font-size:12.8px">ndvi_all&amp;lat@units     = &quot;degrees_north&quot;</span></div><div><span style="font-size:12.8px">ndvi_all&amp;lon@units     = &quot;degrees_east&quot;</span></div><div><span style="font-size:12.8px">ndvi_all&amp;lat@long_name = &quot;latitude&quot;</span></div><div><span style="font-size:12.8px">ndvi_all&amp;lon@long_name = &quot;longitude&quot;</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">ndvi_all@time          = systemfunc(&quot;date&quot;)</span></div><div><span style="font-size:12.8px">ndvi_all@comments      = &quot;Regridded GIMMS 3g NDVI data from NASA NEX using ESMF_regrid in NCL. Only NDVI values with flag (0,1) is used in regridding.&quot;</span></div><div><span style="font-size:12.8px">ndvi_all@long_name     = &quot;Normalized Difference Vegetation Index (GIMMS 3g)&quot;</span></div><div><span style="font-size:12.8px">ndvi_all@scale         = 0.0001</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">ndvi_all               = where(ismissing(ndvi_all),<wbr>toshort(-32768),toshort(ndvi_<wbr>all*10000))</span></div><div><span style="font-size:12.8px">ndvi_all@_FillValue   := toshort(-32768)    ; conver to short to compress</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">ndvi_all&amp;time          = fspan(0.5,12,24)</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">oname = &quot;<a href="http://ndvi3d_1982_r0.75x0.75.nc" target="_blank">ndvi3d_1982_r0.75x0.75.nc</a>&quot;</span></div><div><span style="font-size:12.8px">system(&quot;rm -f &quot;+oname)</span></div><div><span style="font-size:12.8px">fout  = addfile(oname,&quot;c&quot;)</span></div><div><span style="font-size:12.8px">fout-&gt;ndvi = ndvi_all</span></div></div><div><span style="font-size:12.8px">------------------------------<wbr>------------------------------<wbr>------------------------------<wbr>---------------------------</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">I have put my data in the <a href="http://ftp.cgd.ucar.edu/incoming" target="_blank">ftp.cgd.ucar.edu/incoming</a>, the file name is &quot;<a href="http://ndvi3g_1982_nasa.nc" target="_blank">ndvi3g_1982_nasa.nc</a>&quot;.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Could you help me look into this issue?</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Thanks!</span></div><div><span style="font-size:12.8px">Best,</span></div><div><span style="font-size:12.8px">Douglas</span></div><span class=""><div style="font-size:12.8px"><br></div><div><div class="m_8691324554335367460gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div style="font-size:small;font-family:tahoma,sans-serif;display:inline">​</div><span style="font-size:small">-- </span><br style="font-size:small"><div style="font-size:small"><div dir="ltr"><div dir="ltr"><div dir="ltr" style="font-size:12.8px"><span style="font-size:12.8px">Rao, Yuhan (Douglas)</span><br style="font-size:12.8px"><span style="font-size:12.8px">Doctoral Candidate/Graduate Research Assistant</span><br style="font-size:12.8px"><span style="font-size:12.8px">Department of Geographical Sciences</span></div><div style="font-size:12.8px"><span style="font-size:12.8px">Cooperative Institute for Climate and Satellites-Maryland</span></div><div dir="ltr" style="font-size:12.8px"><span style="font-size:12.8px">University of Maryland</span><br style="font-size:12.8px"><span style="font-size:12.8px">2138 LeFrak Hall, </span><span style="font-size:12.8px">7251 Preinkert Dr.</span></div><div dir="ltr" style="font-size:12.8px"><span style="font-size:12.8px">College Park, MD 20742</span><br style="font-size:12.8px"><span style="font-size:12.8px">E-mail: </span><a href="mailto:yuhan.rao@gmail.com" style="font-size:12.8px" target="_blank">yuhan.rao@gmail.com</a><span style="font-size:12.8px">/</span><a href="mailto:yrao@terpmail.umd.edu" style="font-size:12.8px" target="_blank">yr<wbr>ao@terpmail.umd.edu</a></div></div></div></div></div></div></div></div></div></div>
</span></div>
<br>______________________________<wbr>_________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@ucar.edu">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/<wbr>mailman/listinfo/ncl-talk</a><br>
<br></blockquote></div><br></div>