[ncl-talk] 3 questions regarding ESMF_regrid

Mary Haley haley at ucar.edu
Fri May 26 16:04:49 MDT 2017


Hi Laura,

The main issue is that your "data" array is ordered lon x lat, and not lat
x lon.  Also, the longitudes go from 0 to 360, while on the destination
grid they go from -180 to 180.

To fix both of these problems, I used transpose and lonFlip:

data = *transpose*(fSrc->precipitationCal)
data = *lonFlip*(data)
printVarSummary(data)

The second issue is that you don't need to officially define your source
grid, because "data" is a rectilinear grid and already has the lat/lon
arrays attached to it.

This means these five lines can be removed:

lonSrc = fSrc->lon
latSrc = fSrc->lat
opt at SrcGridType       = "0.10x0.10" ; destination grid
opt at SrcGridLon        = lonSrc ; source grid lon input.
opt at SrcGridLat        = latSrc ; source grid lat input.

With the destination grid, you are getting one fewer grid point in both the
lat and lon directions because ESMF_regrid is trying to construct the
destination lat/lon grid using this information:

opt at DstGridType       = "0.30x0.30" ; destination grid
opt at DstLLCorner       = (/-89.85d,  0.15d/)
opt at DstURCorner       = (/ 89.85d,359.85d/)

If you instead use the "lat" and "lon" arrays that you calculate yourself,
then you will get the size you expect:

opt at DstGridLon       = lon ; destination grid lon input.
opt at DstGridLat       = lat ; destination grid lat input.

See the attached modified script and two PNG images (from setting MAP_ZOOM
to True or False)

Regarding your third question: you should be able to use the
destination.GPM.to.0.30deg_by_0.30deg.nc file that gets created. Just
simply set opt at SkipDstGrid = True before you call ESMF_regrid. You will
still need to generate the MPAS source file, and the weights file.

--Mary



On Fri, May 26, 2017 at 12:33 PM, Laura Fowler <laura at ucar.edu> wrote:

> Hi:
>
> I have two questions regarding ESMF_regrid:
>
> 1. I would like to use ESMF_regrid to regrid the 0.1 deg. GPM grid
> (3600 x 1800) to a 0.3 deg. grid (1200 x 600), but I get a core dump
> at the very end although the debug file writes "Completed weight
> generation successfully. I can also dump the content of some of the
> variables too.
> Can somebody help me understand why the core file?
>
> The ncl script is in /glade/p/work/laura/DATA/GPM (see
> regrid.GPM.to.0.3deg_0.3deg.ncl).
>
>
> 2. Looking at the destination file, the grid size is 718201 but I was
> expecting 720000 since I decreased the grid resolution by 3. Is there
> a way to have the destination grid size equal to 720000 (or 1200 x
> 600). May that has to do with the fact that I got a core file in the
> end?
>
>
> 3.  Finally, I would like to regrid outputs from my MPAS runs so that
> my regridded outputs are on exactly the same grid as the regridded GPM
> outputs. Is there a way that I can use information from the GPM
> destination file?
>
>
> Thanks for your help.
> Laura
>
>
> --
> !-----------------------------------------------------------
> --------------------------------------------------
> Laura D. Fowler
> Mesoscale and Microscale Meteorology Division (MMM)
> National Center for Atmospheric Research
> P.O. Box 3000, Boulder CO 80307-3000
>
> e-mail: laura at ucar.edu
> phone: 303-497-1628
>
> !-----------------------------------------------------------
> --------------------------------------------------
> _______________________________________________
> 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/20170526/d547d53c/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GPM_to_0.3deg_zoom.png
Type: image/png
Size: 249630 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170526/d547d53c/attachment-0002.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: GPM_to_0.3deg.png
Type: image/png
Size: 429884 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170526/d547d53c/attachment-0003.png 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: regrid.GPM.to.0.3deg_0.3deg_MOD.ncl
Type: application/octet-stream
Size: 4571 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170526/d547d53c/attachment-0001.obj 


More information about the ncl-talk mailing list