<div dir="ltr">Hi Dennis,<div>Thanks for getting back to me. </div><div>Opt@SrcGridCornerLat and Opt@SrcGridCornerLon points provided through WRF max and min coordinates. <br></div><div>I don't know Is this way we can do it.</div><div>Src grid (Unstructured) is covering the Gulf and Atlantic and I want to mask out the region where my wrf grid is located. For example WRF grid is set up over the Houston Coastal region. </div><div>Is this correct?</div><div>Thanks</div><div><br></div><div> dst_file = "../<a href="http://geo_em.d01.nc">geo_em.d01.nc</a>" //WRF grid <br> dfile = addfile(dst_file,"r")<br><br><br> dst_lat = dfile->XLAT_M(0,:,:) ; Be sure to use appropriate names<br> dst_lon = dfile->XLONG_M(0,:,:) ; here.<br></div><div><br></div><div> Opt@SrcGridLat = lat1D<br> Opt@SrcGridLon = lon1D<br> Opt@SrcRegional = True ;;--Change (maybe)<br> Opt@SrcInputFileName = src_file ; optional, but good idea<br><br> Opt@SrcGridCornerLat = (/ min(dst_lat), max(dst_lat)/) ;sfile->lat_vertices ; corners are necessary<br> Opt@SrcGridCornerLon = (/ min(dst_lon), max(dst_lon)/) ;sfile->lon_vertices ; for "conserve" method<br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 28, 2022 at 9:22 PM Dennis Shea <<a href="mailto:shea@ucar.edu">shea@ucar.edu</a>> wrote:<br></div><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>Given no responses, I speculate no user knows how to generate the edge vertices.</div><div><br></div><div><a href="https://www.ncl.ucar.edu/Applications/ESMF.shtml" target="_blank"><b>https://www.ncl.ucar.edu/Applications/ESMF.shtml</b></a></div><div><br></div><div>Example 6 reads the vertices from a file.</div><div><br></div><div>ESMF_regrid_6.ncl: Opt@SrcGridCornerLat = sfile->lat_vertices ; corners are necessary</div><div>ESMF_regrid_6.ncl: Opt@SrcGridCornerLon = sfile->lon_vertices ; for "conserve" method</div><div><br></div><div>===</div><div>The text above the examples contains:</div><div><br></div><div>"
You can (and are highly recommended to) provide your own grid corners
via the special Src/Dst/GridCornerLat/Lon resources. They must be
provided as an <i>N</i> x 4 array, where <i>N</i> represents the
dimensionality of the center lat/lon grid. For example, if the center
lat/lon grid is dimensioned 256 x 220, then the corner arrays must be
256 x 220 x 4. Sometimes the corner grids are provided on the file
along with the center grids, with names like
"lat_vertices"/"lon_vertices" or "lat_bounds"/"lon_bounds"."</div><div><br></div><div>Good Luck<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Mar 23, 2022 at 7:17 AM Anil Kumar - NOAA Affiliate via ncl-talk <<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a>> wrote:<br></div><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">Hi All,<div>I am using ncl script for esmf regrid and converting unstructured onto WRF grid. </div><div>There is nothing wrong with the script, it was working fine with the previous unstructured grid nodes ( node = 1813443). </div><div>Now I am facing issues running these scripts for new unstructured data nodes ( node = 6057307). It is taking a long time and CPU time terminates the script and even job_script takes more than 8 hours and time limitation issues with job_scripts. </div><div>Any suggestions to resolve this issue? Below is my script<br></div><div><br></div><div>However, when I run script, it says </div><div> This can be VERY slow if you have a large array.<br>(0) To speed up code, provide your own edge vertices via the<br>(0) 'ElementVertices' option.<br></div><div>How to use ElementVertices?</div><div><br></div><div>*******************************************************</div><div> src_file = "../<a href="http://fort.63.nc" target="_blank">fort.63.nc</a>"<br> sfile = addfile(src_file,"r")<br> lat1D = sfile->y<br> lon1D = sfile->x<br> var = sfile->zeta(89,:)<br><br> dst_file = "../<a href="http://geo_em.d01.nc" target="_blank">geo_em.d01.nc</a>"<br> dfile = addfile(dst_file,"r")<br> Opt = True<br><br>;---"bilinear" is the default. "patch" and "conserve" are other options.<br> Opt@InterpMethod = "neareststod" ;;---Change (maybe)<br> Opt@WgtFileName = "unstruct_to_rect_2906_D1.nc"<br> Opt@SrcGridLat = lat1D<br> Opt@SrcGridLon = lon1D<br> Opt@SrcRegional = False ;;--Change (maybe)<br> Opt@SrcInputFileName = src_file ; optional, but good idea<br><br> Opt@SrcMask2D = where(.not.ismissing(var),1,0) ; Necessary if has<br> ; missing values.<br></div><div><br> dst_lat = dfile->XLAT_M(0,:,:) ; Be sure to use appropriate names<br> dst_lon = dfile->XLONG_M(0,:,:) ; here.<br> Opt@DstGridLon = dst_lon<br> Opt@DstGridLat = dst_lat<br> Opt@DstRegional = True ;;--Change (maybe)<br> Opt@ForceOverwrite = True<br> Opt@Debug = True<br> Opt@PrintTimings = True<br> var_regrid = ESMF_regrid(var,Opt) ; Do the regridding<br> printVarSummary(var_regrid)<br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Dr. Anil Kumar<div>Environmental Modeling Center/NCEP/NWS/NOAA<br><div cols="72">College Park, MD, USA </div></div><div><br></div><div><br></div></div></div></div></div></div></div></div></div></div>
_______________________________________________<br>
ncl-talk mailing list<br>
<a href="mailto:ncl-talk@mailman.ucar.edu" target="_blank">ncl-talk@mailman.ucar.edu</a><br>
List instructions, subscriber options, unsubscribe:<br>
<a href="https://mailman.ucar.edu/mailman/listinfo/ncl-talk" rel="noreferrer" target="_blank">https://mailman.ucar.edu/mailman/listinfo/ncl-talk</a></blockquote></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Dr. Anil Kumar<div>Environmental Modeling Center/NCEP/NWS/NOAA<br><div cols="72">College Park, MD, USA </div></div><div><br></div><div><br></div></div></div></div></div></div></div></div>