<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><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><div><div><span style="font-size:12.8px">(0)<span style="white-space:pre">        </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">        </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">        </span>--------------------------------------------------</span></div><div><span style="font-size:12.8px">(0)<span style="white-space:pre">        </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">        </span>'ESMF_RegridWeightGen --source src_SCRIP.nc --destination dst_SCRIP.nc --weight <a href="http://gimms_to_rect.nc">gimms_to_rect.nc</a> --method patch -i --check'</span></div><div><span style="font-size:12.8px">(0)<span style="white-space:pre">        </span>--------------------------------------------------</span></div><div><span style="font-size:12.8px">(0)<span style="white-space:pre">        </span>ESMF_regrid_gen_weights: output from 'ESMF_RegridWeightGen':</span></div><div><span style="font-size:12.8px">(0)<span style="white-space:pre">        </span> Starting weight generation with these inputs: </span></div><div><span style="font-size:12.8px">(1)<span style="white-space:pre">        </span> Source File: src_SCRIP.nc</span></div><div><span style="font-size:12.8px">(2)<span style="white-space:pre">        </span> Destination File: dst_SCRIP.nc</span></div><div><span style="font-size:12.8px">(3)<span style="white-space:pre">        </span> Weight File: <a href="http://gimms_to_rect.nc">gimms_to_rect.nc</a></span></div><div><span style="font-size:12.8px">(4)<span style="white-space:pre">        </span> Source File is in SCRIP format</span></div><div><span style="font-size:12.8px">(5)<span style="white-space:pre">        </span> Source Grid is a global grid</span></div><div><span style="font-size:12.8px">(6)<span style="white-space:pre">        </span> Source Grid is a logically rectangular grid</span></div><div><span style="font-size:12.8px">(7)<span style="white-space:pre">        </span> Destination File is in SCRIP format</span></div><div><span style="font-size:12.8px">(8)<span style="white-space:pre">        </span> Destination Grid is a global grid</span></div><div><span style="font-size:12.8px">(9)<span style="white-space:pre">        </span> Destination Grid is a logically rectangular grid</span></div><div><span style="font-size:12.8px">(10)<span style="white-space:pre">        </span> Regrid Method: patch</span></div><div><span style="font-size:12.8px">(11)<span style="white-space:pre">        </span> Pole option: ALL</span></div><div><span style="font-size:12.8px">(12)<span style="white-space:pre">        </span> Ignore unmapped destination points</span></div><div><span style="font-size:12.8px">(13)<span style="white-space:pre">        </span> Norm Type: dstarea</span></div><div><span style="font-size:12.8px">(14)<span style="white-space:pre">        </span> </span></div><div><span style="font-size:12.8px">(0)<span style="white-space:pre">        </span>--------------------------------------------------</span></div><div><span style="font-size:12.8px">(0)<span style="white-space:pre">        </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">;**********************************************</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">;***********************************************</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">load "$NCARG_ROOT/lib/ncarg/nclscripts/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))</span></div><div><span style="font-size:12.8px">lon_new = todouble(fspan(lonW,lonE,nlon))</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">ndvi3g_1982_nasa.nc</a>","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(dstGridName,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)).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">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(srcGridName,tmpndvi&lat,tmpndvi&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">;----------------------------------------------</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">;----------------------------------------------</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","LargeFile")</span></div><div><span style="font-size:12.8px"> ESMF_regrid_gen_weights(srcGridName,dstGridName,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"> ;--------------------------------------------</span></div><div><span style="font-size:12.8px"> ; esmf_regrid with precalculated weight file</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@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(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 = "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),toshort(-32768),toshort(ndvi_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&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">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">---------------------------------------------------------------------------------------------------------------------</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">ftp.cgd.ucar.edu/incoming</a>, the file name is "<a href="http://ndvi3g_1982_nasa.nc">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><div style="font-size:12.8px"><br></div><div><div class="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>
</div>