<div dir="ltr">Thanks Mary!<div><br></div><div>I have tried several times for this code. Only one time it provide some information in the Log file. I have attached the content of the Log file here.</div><div><br></div><div>----------------------------------------------------------------------------------------------------</div><div><br></div><div><div>20170728 103137.390 INFO PET0 Running with ESMF Version 6.3.0rp1</div><div>20170728 103900.100 INFO PET0 Running with ESMF Version 6.3.0rp1</div><div>20170728 104239.462 INFO PET0 Running with ESMF Version 6.3.0rp1</div><div>20170728 104941.512 INFO PET0 Running with ESMF Version 6.3.0rp1</div><div>20170728 110122.770 INFO PET0 Running with ESMF Version 6.3.0rp1</div><div>20170728 112721.098 INFO PET0 Running with ESMF Version 6.3.0rp1</div><div>20170728 112900.452 INFO PET0 Running with ESMF Version 6.3.0rp1</div><div>20170728 113226.698 ERROR PET0 ESMCI_Regrid_F.C:424 c_esmc_regrid_create() Internal error: Bad condition std::bad_alloc</div><div>20170728 113226.701 ERROR PET0 ESMF_Regrid.F90:321 ESMF_RegridStore Internal error: Bad condition - Internal subroutine call returned Error</div><div>20170728 113226.701 ERROR PET0 ESMF_FieldRegrid.F90:1008 ESMF_FieldRegridStoreNX Internal error: Bad condition - Internal subroutine call returned Error</div><div>20170728 113226.719 ERROR PET0 ESMF_RegridWeightGen.F90:1152 ESMF_RegridWeightGenFile Internal error: Bad condition - Internal subroutine call returned Error</div><div>20170728 113639.935 INFO PET0 Running with ESMF Version 6.3.0rp1</div></div><div><br></div><div>------------------------------------------------------------------------------------------------------</div><div><br></div><div>Thanks for the catch of type mismatch.</div><div><br></div><div>Best,</div><div>Douglas</div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_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">yrao@terpmail.umd.edu</a></div></div></div></div></div></div></div></div></div></div>
<br><div class="gmail_quote">On Mon, Jul 31, 2017 at 1:23 PM, Mary Haley <span dir="ltr"><<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-size:small">I ran your script over the first four timesteps instead of all of them, just so I could see the end result faster.</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">It completed without any errors. I'm now trying it with the full ntime timesteps. A side note: I had to change:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><span class=""><div class="gmail_default"> ndvi_all@time = systemfunc("date")</div><div class="gmail_default"><br></div></span><div class="gmail_default">to:</div><span class=""><div class="gmail_default"><br></div><div class="gmail_default"> ndvi_all@time := systemfunc("date")</div><div class="gmail_default"><br></div></span><div class="gmail_default">because otherwise there's an error about the attribute being a different type.</div></div><div class="gmail_default" style="font-size:small"><br></div>Meanwhile, can you send me the PET0.RegridWeightGen.Log file if you still have it?<div class="gmail_default" style="font-size:small;display:inline"> It will hopefully explain what was causing your error.</div><div><div class="gmail_default" style="font-size:small;display:inline"><br></div></div><div><div class="gmail_default" style="font-size:small;display:inline">--Mary</div></div><div><div class="gmail_default" style="font-size:small;display:inline"><br></div></div><div><div class="gmail_default" style="font-size:small;display:inline"></div>
</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 31, 2017 at 9:40 AM, Mary Haley <span dir="ltr"><<a href="mailto:haley@ucar.edu" target="_blank">haley@ucar.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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'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"><div><div class="m_8270367882324752183h5">On Fri, Jul 28, 2017 at 11:54 AM, Yuhan Rao <span dir="ltr"><<a href="mailto:yrao@terpmail.umd.edu" target="_blank">yrao@terpmail.umd.edu</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_8270367882324752183h5"><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><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>=====> CPU Elapsed Time: rectilinear_to_SCRIP: 9.34327 seconds <=====</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>'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'</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 'ESMF_RegridWeightGen':</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: 'ESMF_RegridWeightGen' 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 "$NCARG_ROOT/lib/ncarg/nclscri<wbr>pts/esmf/ESMF_regridding.ncl"</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 = "lat"</span></div><div><span style="font-size:12.8px">lat_new&lat = lat_new</span></div><div><span style="font-size:12.8px">lat_new&lat@long_name = "latitude"</span></div><div><span style="font-size:12.8px">lat_new&lat@units = "degrees_north"</span></div><div><span style="font-size:12.8px">lon_new!0 = "lon"</span></div><div><span style="font-size:12.8px">lon_new&lon = lon_new</span></div><div><span style="font-size:12.8px">lon_new&lon@long_name = "longitude"</span></div><div><span style="font-size:12.8px">lon_new&lon@units = "degrees_east"</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("<a href="http://ndvi3g_1982_nasa.nc" target="_blank">ndvi3g_1982_nasa.nc</a>",<wbr>"r")</span></div><div><span style="font-size:12.8px">ndvi = fin->ndvi</span></div><div><span style="font-size:12.8px">flag = fin->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&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 & 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 = "dst_SCRIP.nc"</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(dstGridNa<wbr>me,lat_new,lon_new,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 = "src_SCRIP.nc"</span></div><div><span style="font-size:12.8px"> wgtFileName = "<a href="http://gimms_to_rect.nc" target="_blank">gimms_to_rect.nc</a>"</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 = "GIMMS Grid"</span></div><div><span style="font-size:12.8px"> </span></div><div><span style="font-size:12.8px"> rectilinear_to_SCRIP(srcGridN<wbr>ame,tmpndvi&lat,tmpndvi&lon,Op<wbr>t)</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 = "patch"</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("nc","Format","L<wbr>argeFile")</span></div><div><span style="font-size:12.8px"> ESMF_regrid_gen_weights(srcGr<wbr>idName,dstGridName,wgtFileName<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"> ;----------------------------<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(tmpnd<wbr>vi,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 = "time"</span></div><div><span style="font-size:12.8px">ndvi_all!1 = "lat"</span></div><div><span style="font-size:12.8px">ndvi_all!2 = "lon"</span></div><div><span style="font-size:12.8px">ndvi_all&lat = lat_new</span></div><div><span style="font-size:12.8px">ndvi_all&lon = lon_new</span></div><div><span style="font-size:12.8px">ndvi_all&lat@units = "degrees_north"</span></div><div><span style="font-size:12.8px">ndvi_all&lon@units = "degrees_east"</span></div><div><span style="font-size:12.8px">ndvi_all&lat@long_name = "latitude"</span></div><div><span style="font-size:12.8px">ndvi_all&lon@long_name = "longitude"</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">ndvi_all@time = systemfunc("date")</span></div><div><span style="font-size:12.8px">ndvi_all@comments = "Regridded GIMMS 3g NDVI data from NASA NEX using ESMF_regrid in NCL. Only NDVI values with flag (0,1) is used in regridding."</span></div><div><span style="font-size:12.8px">ndvi_all@long_name = "Normalized Difference Vegetation Index (GIMMS 3g)"</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),tosh<wbr>ort(-32768),toshort(ndvi_all*1<wbr>0000))</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&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 = "<a href="http://ndvi3d_1982_r0.75x0.75.nc" target="_blank">ndvi3d_1982_r0.75x0.75.nc</a>"</span></div><div><span style="font-size:12.8px">system("rm -f "+oname)</span></div><div><span style="font-size:12.8px">fout = addfile(oname,"c")</span></div><div><span style="font-size:12.8px">fout->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 "<a href="http://ndvi3g_1982_nasa.nc" target="_blank">ndvi3g_1982_nasa.nc</a>".</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><div style="font-size:12.8px"><br></div><div><div class="m_8270367882324752183m_-672606457213805719m_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></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 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>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>