[ncl-talk] interpolation

Dennis Shea shea at ucar.edu
Mon Jul 23 17:57:47 MDT 2018


I modified your script.

Use only "bilinear" and/or "nearest neighbor' .

"patch" is *NOT* appropriate. I was/is for highly accurate derivatives. as
needed for say ocean curl.

Please read all ESMF documentation.

On Sat, Jul 21, 2018 at 5:43 AM, Ehsan Taghizadeh <ehsantaghizadeh at yahoo.com
> wrote:

> Thank you for your help.
> I'd used ncl scrip which was written by ncl-talk group, to interpolate GPM
> data to station points, in ASCII format.
> After finishing work, and sending paper to journal, referee wants to know
> the effect of other interpolating methods. So I decided to use some other
> methods to interpolate GPM data on station points.
> I've tried ESMF regridding library as you suggested. However I faced the
> error:
> "ESMF_regrid_gen_weights: 'ESMF_RegridWeightGen' was not successful."
> Beside that I have to write output file in ASCII format.
> I've attached first script (Interpolating_bilinear.ncl) which works
> correctly via bilinear method, and second script (Interpolating_ESMF.ncl)
> which uses ESMF regridding. Also input data are attached (
> GPM_IMERGV04DE_20160401_20170228 directory and stations_NW.csv file which
> contains destination lat/lon).
> Could I have your help to modify "Interpolating_ESMF.ncl" to use
> different interpolating methods (bilinear", "neareststod", "patch")?
> Also could I have your opinion to answer the referee about using different
> interpolating methods? Is it necessary to use different interpolating
> methods and comparing them?
>
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
> $ ncl -V
>     6.5.0
> $ uname -a
>     Linux localhost.localdomain 3.10.0-514.2.2.el7.x86_64 #1 SMP Tue Dec 6
> 23:06:41 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
> $ gcc --version
>     gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28)
> ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
>
> Sincerely
> Ehsan
>
> On Thursday, July 19, 2018, 10:22:38 PM GMT+4:30, Dennis Shea <
> shea at ucar.edu> wrote:
>
>
> Without the printVarSummary() of your 'z' variable, it is hard to tell
> what the problem might be:
>
> function dspnt2 (
>                 x  [*] : numeric,
>                 y  [*] : numeric,
>                 z      : numeric,
>                 xo [*] : numeric,
>                 yo [*] : numeric
>         )
>
> This assumes a cartesian grid. Still: lon[*] and lat[*] are commonly input
> to the function as x[*] and y[*]
>
> =====
> However, I am not evne going to deall with the 'dspnt2. Please use the
> ESMF regridding library.
>
>
>   http://www.ncl.ucar.edu/ Applications/ESMF.shtml
> <http://www.ncl.ucar.edu/Applications/ESMF.shtml>
>
> Something like:
>
>     var = f->FOO
>     printVarSummary(var)
>     printMinMax(var,0)
>
>     interp_method = "bilinear"   ; "neareststod", "patch"
>     wgt_file_name = "wgt.ESHAN_"+interp_method+".nc"
>
>   Opt                 = True
>   Opt at SrcGridLat      = lat     ; rectilinear lat[*]
>   Opt at SrcGridLon      = lon     ;      "      lon[*]
>
>   Opt at DstGridLat      = ulat    ; unstructured latitudes
>   Opt at DstGridLon      = ulon    ;      "       longitudes
>
>   Opt at InterpMethod    = interp_method
>   Opt at WgtFileName     = wgt_file_name
>
>
>   var_regrid = ESMF_regrid(var,Opt)     ; Do the regridding
>
>     printVarSummary(var_regrid))
>     printMinMax(var_regrid,0)
>
> PLEASE *CAREFULLY* READ the documentation and examples.
>
>
> On Thu, Jul 19, 2018 at 2:04 AM, Ehsan Taghizadeh <
> ehsantaghizadeh at yahoo.com> wrote:
>
> Hi,
> Is there any interpolation method from rectilinear grid to an
> unstructured grid other than bilinear interpolation in NCL, like kriging,
> nearest point, etc? However I found this link (https://www.ncl.ucar.edu/
> Support/talk_archives/2011/ 0595.html
> <https://www.ncl.ucar.edu/Support/talk_archives/2011/0595.html>) which
> states "There is no kriging interpolation function in NCL".
> Beside that could "dspnt2" be used to interpolate from rectilinear grid
> to an unstructured grid? However it seems it couldn't and following error
> is the subject "fatal:dspnt2: the rightmost dimension of z must be the
> same as the dimension of x and y".
>
> I'll be thankful for any help.
>
> Sincerely
> Ehsan
>
> ______________________________ _________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/ mailman/listinfo/ncl-talk
> <http://mailman.ucar.edu/mailman/listinfo/ncl-talk>
>
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180723/bf372556/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Interpolating_ESMF.ncl
Type: application/octet-stream
Size: 7309 bytes
Desc: not available
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20180723/bf372556/attachment.obj>


More information about the ncl-talk mailing list