Re: curvilinear to rectilinear

From: David Brown <dbrown_at_nyahnyahspammersnyahnyah>
Date: Fri Apr 12 2013 - 15:43:35 MDT

You need to create 2d lat and lon coordinate variables from the third and fourth columns.
Assuming your ascii file contains only numbers and has one row for each grid point (11000 points in all), and as it appears, the longitude values vary fastest,
you could do it like this:

filename = "< whatever the name of your text file is >"
coords = asciiread(filename,(/100,110,4/),"float")
lat2d = coords(:,:,2)
lon2d = coords(:,:,3)

You will not need to use the rotated coordinates (the first 2 columns) at all.
Once you have the coordinates read in correctly you can use an example such #5 on the ESMF regridding page to regrid the data to a regular lat/lon grid.

 -dave

On Apr 12, 2013, at 2:59 PM, Alexander Semenov <asemenov@alaska.edu> wrote:

> Hello,
>
> I am looking for a way to interpolate modeling data from curvilinear
> rotated grid coordinates from a regional model into normal rectilinear
> lat-lon coordinates.
>
> The model output files contains:
> dimensions:
> lon = 110 ;
> lat = 100 ;
> record = UNLIMITED ; // (31 currently)
> variables:
> float mslp(record, lat, lon) ;
> mslp:WMO = 1 ;
> mslp:LTYP = 103 ;
> mslp:ALEV = 0.f ;
> float u10(record, lat, lon) ;
> u10:WMO = 33 ;
> u10:LTYP = 105 ;
> u10:ALEV = 10.f ;
> float v10(record, lat, lon) ;
> v10:WMO = 34 ;
> v10:LTYP = 105 ;
> v10:ALEV = 10.f ;
>
> I also have a text file that links rotated model coordinates (lats and
> lons) and their equivalents on a normal latitude and longitude grid.
> The text file looks like this, where the first column is a rotated
> lat, column - a rotated longitude, third and the 4th are equivalent
> lats and lons on a normal grid respectively.
> -25.00 -27.50 53.50 -44.72
> -25.00 -27.00 53.85 -44.23
> -25.00 -26.50 54.20 -43.74
> -25.00 -26.00 54.55 -43.23
> -25.00 -25.50 54.89 -42.71
> -25.00 -25.01 55.22 -42.19
>
> Thanks,
> Alex
> _______________________________________________
> ncl-talk mailing list
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Fri Apr 12 15:43:47 2013

This archive was generated by hypermail 2.1.8 : Mon Apr 15 2013 - 20:12:25 MDT