<div dir="ltr"><div class="gmail_default" style="font-size:small">Hi Tim,</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small">Hmmm, I'm not sure about this, but maybe the weights file is too large? You might need to set:</div><div class="gmail_default" style="font-size:small"><br></div><div class="gmail_default" style="font-size:small"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"> Opt@WgtNetCDFType = "netcdf4"</span><br></div><div class="gmail_default" style="font-size:small"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div class="gmail_default" style="font-size:small"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">which will force a NetCDF4 file to be written, which allows for large variables. I'm a little dubious this will fix these, because it should have complained when it tried to write that file.</span></div><div class="gmail_default" style="font-size:small"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div class="gmail_default" style="font-size:small"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">How big are <a href="http://source_grid_file.nc">source_grid_file.nc</a> and <a href="http://destination_grid_file.nc">destination_grid_file.nc</a>?</span></div><div class="gmail_default" style="font-size:small"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div class="gmail_default" style="font-size:small"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Also, what version of NCL are you using?</span></div><div class="gmail_default" style="font-size:small"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div class="gmail_default" style="font-size:small"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">If you continue to have problems even when setting the WgtNetCDFType option, then could you provide the input files, if they are not excessively large? You can use our ftp:</span></div><div class="gmail_default" style="font-size:small"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div class="gmail_default"><span style="text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="font-size:12.8px"><a href="http://www.ncl.ucar.edu/ftp_files.shtml">http://www.ncl.ucar.edu/ftp_files.shtml</a></span><br></span></div><div class="gmail_default"><span style="text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="font-size:12.8px"><br></span></span></div><div class="gmail_default"><span style="text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="font-size:12.8px">Thanks,</span></span></div><div class="gmail_default"><span style="text-align:start;text-indent:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><span style="font-size:12.8px"><br></span></span></div><div class="gmail_default" style="font-size:small"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">--Mary</span></div><div class="gmail_default" style="font-size:small"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div class="gmail_default" style="font-size:small"><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 23, 2018 at 12:13 PM, Glotfelty, Timothy William <span dir="ltr"><<a href="mailto:twglotfe@email.unc.edu" target="_blank">twglotfe@email.unc.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="m_-4431982693225763505WordSection1">
<p class="MsoNormal">Hello,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"> I’m trying to run the ESMF regridding function to regrid land use and land cover information from a rectilinear Albers equal area projection to a WRF lambert conformal projection. I’ve used a version of this script many times to regrid
between different projections and it has worked perfectly but this time I get an error indicating that the weights cannot be generated. Any ideas as to why this might be occurring? Could it have something to do with the Albers projection?<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">My script is as follows:<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_code.ncl"<u></u><u></u></p>
<p class="MsoNormal">load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/gsn_csm.ncl"<u></u><u></u></p>
<p class="MsoNormal">load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/csm/contributed.<wbr>ncl"<u></u><u></u></p>
<p class="MsoNormal">load "$NCARG_ROOT/lib/ncarg/<wbr>nclscripts/esmf/ESMF_<wbr>regridding.ncl"<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">begin<u></u><u></u></p>
<p class="MsoNormal">vars = (/"2006_2001_Loss","2006_2001_<wbr>Gain","2006_2001_Shift"/)<u></u><u></u></p>
<p class="MsoNormal">outfile = "<a href="http://MODIS.2006-2001.Africa.nc" target="_blank">MODIS.2006-2001.Africa.nc</a>"<u></u><u></u></p>
<p class="MsoNormal">fon = addfile(outfile,"c")<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">do v=0,dimsizes(vars)-1<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">;---Data file containing source grid<u></u><u></u></p>
<p class="MsoNormal"> src_file = "<a href="http://Change.2001_2006.nc" target="_blank">Change.2001_2006.nc</a>" <wbr> ;;---Change (likely)<u></u><u></u></p>
<p class="MsoNormal"> src_map = "MODIS_2001.nc"<u></u><u></u></p>
<p class="MsoNormal"> sfile = addfile(src_file,"r")<u></u><u></u></p>
<p class="MsoNormal"> smfile = addfile(src_map,"r")<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">;---Get variable to regrid<u></u><u></u></p>
<p class="MsoNormal"> var_name = vars(v) ;;---Change (likely)<u></u><u></u></p>
<p class="MsoNormal"> var = sfile->$var_name$ ;;---Change (likely)<u></u><u></u></p>
<p class="MsoNormal"> src_lat = smfile->latitude <wbr> ;;---Change (maybe)<u></u><u></u></p>
<p class="MsoNormal"> src_lon = smfile->longitude <wbr> ;;---Change (maybe)<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">;---Data file containing destination grid<u></u><u></u></p>
<p class="MsoNormal"> dst_file = "<a href="http://map.Africa.nc" target="_blank">map.Africa.nc</a>" ;;---Change (likely)<u></u><u></u></p>
<p class="MsoNormal"> dfile = addfile(dst_file,"r")<u></u><u></u></p>
<p class="MsoNormal"> dst_lat = dfile->XLAT(0,:,:) <wbr> ;;---Change (likely)<u></u><u></u></p>
<p class="MsoNormal"> dst_lon = dfile->XLONG(0,:,:) <wbr> ;;---Change (likely)<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">;---Set up regridding options<u></u><u></u></p>
<p class="MsoNormal"> Opt = True<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">;---"bilinear" is the default. "patch" and "conserve" are other options.<u></u><u></u></p>
<p class="MsoNormal"> Opt@InterpMethod = "neareststod" ;;---Change (maybe)<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"> Opt@WgtFileName = "<a href="http://rec_to_curv.nc" target="_blank">rec_to_curv.nc</a>" ; optional<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"> Opt@SrcGridLat = src_lat ; source grid<u></u><u></u></p>
<p class="MsoNormal"> Opt@SrcGridLon = src_lon<u></u><u></u></p>
<p class="MsoNormal"> Opt@SrcRegional = True ;;--Change (maybe)<u></u><u></u></p>
<p class="MsoNormal"> Opt@SrcInputFileName = src_file ; optional, but good idea<u></u><u></u></p>
<p class="MsoNormal"> <wbr> ; missing values.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"> Opt@DstGridLat = dst_lat ; destination grid<u></u><u></u></p>
<p class="MsoNormal"> Opt@DstGridLon = dst_lon<u></u><u></u></p>
<p class="MsoNormal"> Opt@DstRegional = True ;;--Change (maybe)<u></u><u></u></p>
<p class="MsoNormal"> Opt@DstMask2D = where(.not.ismissing(dst_lat).<wbr>and.\<u></u><u></u></p>
<p class="MsoNormal"> .not.ismissing(dst_lon),1,0) ; Necessary if lat/lon<u></u><u></u></p>
<p class="MsoNormal"> <wbr> ; has missing values.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"> Opt@ForceOverwrite = True<u></u><u></u></p>
<p class="MsoNormal"> Opt@PrintTimings = True<u></u><u></u></p>
<p class="MsoNormal"> Opt@Debug = True<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"> var_regrid = ESMF_regrid(var,Opt) ; Do the regridding<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"> fon->$var_name$ = var_regrid<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"> printVarSummary(var_regrid)<u></u><u></u></p>
<p class="MsoNormal"> delete(var_name)<u></u><u></u></p>
<p class="MsoNormal"> delete(var)<u></u><u></u></p>
<p class="MsoNormal"> delete(var_regrid)<u></u><u></u></p>
<p class="MsoNormal"> delete(dst_lat)<u></u><u></u></p>
<p class="MsoNormal"> delete(dst_lon)<u></u><u></u></p>
<p class="MsoNormal"> delete(src_lat)<u></u><u></u></p>
<p class="MsoNormal"> delete(src_lon)<u></u><u></u></p>
<p class="MsoNormal"> delete(Opt)<u></u><u></u></p>
<p class="MsoNormal">end do<u></u><u></u></p>
<p class="MsoNormal">end<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">The script output with the error message is as follows<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">(0) get_src_grid_info: source lat dims = (7770)<u></u><u></u></p>
<p class="MsoNormal">(0) get_src_grid_info: source lon dims = (7563)<u></u><u></u></p>
<p class="MsoNormal">(0) get_src_grid_info: source grid type is 'rectilinear'<u></u><u></u></p>
<p class="MsoNormal">(0) curvilinear_to_SCRIP: calculating grid corners...<u></u><u></u></p>
<p class="MsoNormal">(0) curvilinear_to_SCRIP: no lat values are at the poles, so<u></u><u></u></p>
<p class="MsoNormal">(0) calculating grid corners using<u></u><u></u></p>
<p class="MsoNormal">(0) calc_SCRIP_corners_<wbr>noboundaries...<u></u><u></u></p>
<p class="MsoNormal">(0) calc_SCRIP_corners_<wbr>noboundaries<u></u><u></u></p>
<p class="MsoNormal">(0) min/max original lat: -35.23254905085637/37.<wbr>99549894885637<u></u><u></u></p>
<p class="MsoNormal">(0) min/max original lon: -18.96852865285641/52.<wbr>3084051828564<u></u><u></u></p>
<p class="MsoNormal">(0) calc_SCRIP_corners_<wbr>noboundaries<u></u><u></u></p>
<p class="MsoNormal">(0) min/max Extlat2d: -35.24197472314363/38.<wbr>00492462114362<u></u><u></u></p>
<p class="MsoNormal">(0) min/max Extlon2d: -18.9779543251436/52.<wbr>3178308551436<u></u><u></u></p>
<p class="MsoNormal">(0) calc_SCRIP_corners_<wbr>noboundaries<u></u><u></u></p>
<p class="MsoNormal">(0) min/max ExtGridCenter_lat: -35.237261887/38.<wbr>00021178499999<u></u><u></u></p>
<p class="MsoNormal">(0) min/max ExtGridCenter_lon: -18.973241489/52.313118019<u></u><u></u></p>
<p class="MsoNormal">(0) =====> CPU Elapsed Time: rectilinear_to_SCRIP: 49.0142 seconds <=====<u></u><u></u></p>
<p class="MsoNormal">(0) get_dst_grid_info: destination lat dims = (169,252)<u></u><u></u></p>
<p class="MsoNormal">(0) get_dst_grid_info: destination lon dims = (169,252)<u></u><u></u></p>
<p class="MsoNormal">(0) curvilinear_to_SCRIP: calculating grid corners...<u></u><u></u></p>
<p class="MsoNormal">(0) curvilinear_to_SCRIP: no lat values are at the poles, so<u></u><u></u></p>
<p class="MsoNormal">(0) calculating grid corners using<u></u><u></u></p>
<p class="MsoNormal">(0) calc_SCRIP_corners_<wbr>noboundaries...<u></u><u></u></p>
<p class="MsoNormal">(0) calc_SCRIP_corners_<wbr>noboundaries<u></u><u></u></p>
<p class="MsoNormal">(0) min/max original lat: -35.2259/19.128<u></u><u></u></p>
<p class="MsoNormal">(0) min/max original lon: -24.1202/64.4362<u></u><u></u></p>
<p class="MsoNormal">(0) calc_SCRIP_corners_<wbr>noboundaries<u></u><u></u></p>
<p class="MsoNormal">(0) min/max Extlat2d: -35.5159/19.4431<u></u><u></u></p>
<p class="MsoNormal">(0) min/max Extlon2d: -24.5117/64.8278<u></u><u></u></p>
<p class="MsoNormal">(0) calc_SCRIP_corners_<wbr>noboundaries<u></u><u></u></p>
<p class="MsoNormal">(0) min/max ExtGridCenter_lat: -35.3709/19.2855<u></u><u></u></p>
<p class="MsoNormal">(0) min/max ExtGridCenter_lon: -24.3161/64.6321<u></u><u></u></p>
<p class="MsoNormal">(0) =====> CPU Elapsed Time: curvilinear_to_SCRIP: 0.0331116 seconds <=====<u></u><u></u></p>
<p class="MsoNormal">(0) ESMF_regrid_gen_weights: number of processors used: 1<u></u><u></u></p>
<p class="MsoNormal">(0) ------------------------------<wbr>--------------------<u></u><u></u></p>
<p class="MsoNormal">(0) ESMF_regrid_gen_weights: the following command is about to be executed on the system:<u></u><u></u></p>
<p class="MsoNormal">(0) 'ESMF_RegridWeightGen --source <a href="http://source_grid_file.nc" target="_blank">source_grid_file.nc</a> --destination <a href="http://destination_grid_file.nc" target="_blank">destination_grid_file.nc</a> --weight <a href="http://rec_to_curv.nc" target="_blank">rec_to_curv.nc</a> --method neareststod --src_regional --dst_regional -i'<u></u><u></u></p>
<p class="MsoNormal">(0) ------------------------------<wbr>--------------------<u></u><u></u></p>
<p class="MsoNormal">(0) ESMF_regrid_gen_weights: output from 'ESMF_RegridWeightGen':<u></u><u></u></p>
<p class="MsoNormal">(0) Starting weight generation with these inputs:<u></u><u></u></p>
<p class="MsoNormal">(1) Source File: <a href="http://source_grid_file.nc" target="_blank">source_grid_file.nc</a><u></u><u></u></p>
<p class="MsoNormal">(2) Destination File: <a href="http://destination_grid_file.nc" target="_blank">destination_grid_file.nc</a><u></u><u></u></p>
<p class="MsoNormal">(3) Weight File: <a href="http://rec_to_curv.nc" target="_blank">rec_to_curv.nc</a><u></u><u></u></p>
<p class="MsoNormal">(4) Source File is in SCRIP format<u></u><u></u></p>
<p class="MsoNormal">(5) Source Grid is a regional grid<u></u><u></u></p>
<p class="MsoNormal">(6) Source Grid is a logically rectangular grid<u></u><u></u></p>
<p class="MsoNormal">(7) Destination File is in SCRIP format<u></u><u></u></p>
<p class="MsoNormal">(8) Destination Grid is a regional grid<u></u><u></u></p>
<p class="MsoNormal">(9) Destination Grid is a logically rectangular grid<u></u><u></u></p>
<p class="MsoNormal">(10) Regrid Method: nearest source to destination<u></u><u></u></p>
<p class="MsoNormal">(11) Pole option: NONE<u></u><u></u></p>
<p class="MsoNormal">(12) Ignore unmapped destination points<u></u><u></u></p>
<p class="MsoNormal">(13) Norm Type: dstarea<u></u><u></u></p>
<p class="MsoNormal">(14)<u></u><u></u></p>
<p class="MsoNormal">(0) ------------------------------<wbr>--------------------<u></u><u></u></p>
<p class="MsoNormal">(0) ESMF_regrid_gen_weights: 'ESMF_RegridWeightGen' was not successful.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I checked the weights log file and the only information it has is the following<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">20180323 140041.361 INFO PET0 Running with ESMF Version 6.3.0rp1<u></u><u></u></p>
<p class="MsoNormal">20180323 140041.376 INFO PET0 Running with ESMF Version 6.3.0rp1<u></u><u></u></p>
<p class="MsoNormal">20180323 140041.408 INFO PET0 Running with ESMF Version 6.3.0rp1<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Thanks,<u></u><u></u></p>
<p class="MsoNormal">Tim Glotfelty<u></u><u></u></p>
<p class="MsoNormal">Postdoctoral Research Associate<u></u><u></u></p>
<p class="MsoNormal">Department of Environmental Science and Engineering<u></u><u></u></p>
<p class="MsoNormal">University of North Carolina at Chapel Hill<u></u><u></u></p>
</div>
</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>