[ncl-talk] Regridding data on unstructured grid with ESMF_Regrid
Dennis Shea
shea at ucar.edu
Fri Aug 22 20:28:18 MDT 2014
The attached works with the bilinear and patch methods. The conserve method
requires 'corner' information. NCL's implementation tries to derive the
corner info but is not always successful. I think that is what is happening
in your case. This will be looked at more when we get a chance.
On Thu, Aug 21, 2014 at 1:52 PM, Peter Watson <watson at atm.ox.ac.uk> wrote:
> Dear fellow NCL users,
>
> I am trying to do conservative regridding of precipitation data from a
> reduced Gaussian grid to a lat-lon grid using the ESMF_Regrid function in
> NCL 6.1.2, but I get an error that I do not understand. My input data is in
> a NetCDF file, with the precip data and the latitudes and longitudes of the
> grid points stored as 1D arrays. An ncdump -h of the input file gives:
>
> dimensions:
> space = 35718 ;
> variables:
> double data(space) ;
> double lon1d(space) ;
> double lat1d(space) ;
>
>
> I use the following lines of NCL, based on the example script at
> http://www.ncl.ucar.edu/Applications/Templates/ESMF_unstruct_to_0.25deg.ncl
> :
>
> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> load "$NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl"
>
> file_in=addfile("regrid_cons_irreg.nc","r")
> data = file_in->data
> lats = file_in->lat1d
> lons = file_in->lon1d
>
> Opt=True
> Opt at SrcGridLat = lats
> Opt at SrcGridLon = lons
> Opt at DstGridType = "5x5"
> Opt at ForceOverwrite = True
> Opt at InterpMethod = "conserve"
> Opt at DstLLCorner = (/-85.0d, 0.0d /)
> Opt at DstURCorner = (/ 85.0d, 355.0d /)
>
> Opt at Debug = True
>
> data_latlon=ESMF_regrid(data,Opt)
>
> This gives the error:
>
> (0) ESMF_regrid_with_weights: retrieving interpolation weights ...
> (0) ESMF_regrid_with_weights: error: source data on the description
> (0) file does not have proper dimensions.
>
> I don't understand why this fails. Is there something wrong with how I am
> reading in the data and coordinates? Are there any conditions that need to
> be satisfied, like the coordinates increasing monotonically (mine do not)?
> If anyone has a script and NetCDF file for which this sort of regridding
> succeeds that they could let me see, then that would be very helpful.
>
> Thanks very much for any help you can give.
>
> Kind regards,
>
> Peter Watson
>
> _______________________________________________
> ncl-talk mailing list
> 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/20140822/4beb55ae/attachment-0001.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: regrid.ncl
Type: application/octet-stream
Size: 3418 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140822/4beb55ae/attachment-0001.obj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ESMF_PeterWatson_patch.png
Type: image/png
Size: 174418 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20140822/4beb55ae/attachment-0001.png
More information about the ncl-talk
mailing list