[ncl-talk] issues interpolating data from NCEP to WRF coordinates

David Brown dbrown at ucar.edu
Tue Jun 9 21:50:37 MDT 2015


The missing values occur along the line of zero longitude and are
actually a result of this being the edge of the lat/lon rectangular
input grid. A solution is to add an extra wrap-around column of
longitude values to the input grid. This is the same thing that the
"gsnAddCyclic" resource does behind the scenes to eliminate the "seam"
when plotting global grids.

Unfortunately, in this case, you need to do it manually. You need to
create a new array with one extra longitude column, making the last
column equal to the first column. I am attaching a modified version of
your script that does this and draws a plot of the result. There may
be better ways to do this using ESMF regridding, but this demonstrates
that you can make rgrid2rcm work as well. I tried to orient the plot
to show clearly that the missing data resulting from the original
script falls along the 0 longitude line.
  -dave

On Tue, Jun 9, 2015 at 8:38 PM, Dennis Shea <shea at ucar.edu> wrote:
>
>
> Unfortunately (for you) we are teaching the NCL WKshop this week. Hence, we
> are quite busy.
>
> I did look  ...
>
> The rgrid2rcm uses a very simple brute force algorithm. *All* coordinates
> are required to be monotonically increasing.
> However, after the  'where' statement,   if you print the 'lon2d' you will
> see the issue.
>
>
> (row,col)
> [snip]
> (58,40) 352.3439
> (58,41) 355.4963
> (58,42) 358.3603
>   --------------------->  not monotonic
> (58,43) 0.9611969
> (58,44) 3.324268
> (58,45) 5.473709
> (58,46) 7.431938
>
> The reason for the gap in your plot is that in the "seam" occurs where the
> longitudes go from 3?? to 0 fails (not monotonic). It then 'works' again
> where the longitudes are increasing.
>
> ---
> That said .... I initially thought there is something unusual about the
> source file. There still may be but I just do not have the time to look.
> Sometime ... yes but not now. Sorry.
>
> ---
>
> I randomly took the ESMF example 9 and more or less force fed your file info
> info. It is not working but you can use it as a template. Again, just do not
> have the time.
>
> Good luck
>
>
> On Tue, Jun 9, 2015 at 3:16 PM, Michael Stone <mrstone at colorado.edu> wrote:
>>
>> Hi again,
>>
>> I've continued to investigate the issue and decided to try out using the
>> ESMF regridding package instead. I wrote a script that does a simple
>> interpolation using the same data and grids but using the ESMF
>> regridding/interpolation and ran into the same issue with missing values.
>> This script is attached below and requires the same "geo_em" file in my
>> prior email as well as the data file. I plotted the missing values and they
>> are in the same location.
>>
>> To me, this indicates some issue with how I'm creating the geo_em file but
>> I am having a hard time finding out why that might be. I'm going to continue
>> to work on this and try a different grid to see if I run into the same
>> issue. If anyone has any ideas I would greatly appreciate it.
>>
>> Thanks,
>> Michael
>>
>> On Mon, Jun 8, 2015 at 2:26 PM, Michael Stone <mrstone.colorado at gmail.com>
>> wrote:
>>>
>>> Hi All,
>>>
>>> I'm having issues interpolating data using the rgrid2rcm function from
>>> NCEP to WRF coordinates. After interpolation there is a strip of missing
>>> data and I'm having a very difficult time figuring out exactly why that is.
>>>
>>> Attached you'll find the script I'm running to interpolate the data, a
>>> plot of where the missing values occur, and the location of the lats/lons
>>> that are missing. The NCEP data is just air temperature (although I'm trying
>>> to do many variables) and I put a single year on the NCAR ftp server under
>>> "air.1950.nc". There is also a file "geo_em.d01.nc" that represents the WRF
>>> grid to interpolate to that is necessary for the script to run located on
>>> the ftp.
>>>
>>> ncl -V
>>>
>>> 6.2.0
>>>
>>> uname -a
>>>
>>> Linux vardar.colorado.edu 2.6.32-504.12.2.el6.i686 #1 SMP Sun Feb 1
>>> 12:14:25 EST 2015 i686 i686 i386 GNU/Linux
>>>
>>> Thanks for the help.
>>>
>>> Michael
>>
>>
>>
>> _______________________________________________
>> ncl-talk mailing list
>> ncl-talk at ucar.edu
>> List instructions, subscriber options, unsubscribe:
>> 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 --------------
A non-text attachment was scrubbed...
Name: interp_example-1.ncl
Type: application/octet-stream
Size: 4332 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150609/d5d56a9f/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-interp.png
Type: image/png
Size: 243517 bytes
Desc: not available
Url : http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20150609/d5d56a9f/attachment.png 


More information about the ncl-talk mailing list