Re: Interpolate WRF data on Mercator projection to Cartesian grid

From: Yongxin Zhang <yongxin_at_nyahnyahspammersnyahnyah>
Date: Tue, 31 Jan 2006 11:11:39 -0700

Dear Dennis,

      Thank you very much for your information. What I want to do is
to interpolate WRF variables (u, v, T, hgt, psfc, SST et al.) on
native Mercator projection to the Cartesian system, then the
transformed data will be used as the input data for another model
which uses Cartesian Coordinates. The built-in function, gc_latlon
gives me distance in meters between two points but does not perform
the data conversion so I was wondering if there are any functions or
programs in NCL that can do the data conversion conveniently.

Thank you,
Yongxin

On Jan 30, 2006, at 9:50 PM, Dennis Shea wrote:

>> I need to interpolate WRF data on native Mercator projection
>> to the x, y, z Cartesian coordinates. Please let me know whether
>> or not NCL can do this and how. Thank you.
>>
>
> The question is a bit open-ended.
>
> (1) If you want "cartesian" relative to the plot frame, you
> could use the function "datatondc"
>
> http://www.ncl.ucar.edu/Document/Functions/Built-in/
> datatondc.shtml
>
> However, I do not think this is what you want.
>
> (2) I think the "gc_latlon" function could be used
>
> http://www.ncl.ucar.edu/Document/Functions/Built-in/
> gc_latlon.shtml
>
> The following uses the equator as the "origin"
>
> You could then write the x and y coordinates to a file.
>
> I will request that the gc_latlon function be
> made to operate on arrays. That will speed things up.
>
>
>
> begin
> f = addfile("wrfout_d01_2003-07-13_12:00:00.nc", "r")
>
> lat1d = ndtooned( f->XLAT(0,:,:) )
> lon1d = ndtooned( f->XLONG(0,:,:))
> npts = dimsizes( lat1d )
>
> lato = 0.0 ; origin
> lono = 0.0
>
> x = new ( npts, "float")
> y = new ( npts, "float")
>
> do n=0,npts-1
> x(n) = gc_latlon(lato,lono, lato ,lon1d(n), 2,3) ; x-axis
> y(n) = gc_latlon(lato,lono, lat1d(n),lono , 2,3) ; y-axis
> if (lon1d(n).lt.0) then
> x(n) = -1*x(n)
> end if
> if (lat1d(n).lt.0) then
> y(n) = -1*y(n)
> end if
> print(lat1d(n)+" "+lon1d(n)+" "+x(n)+" "+y(n))
> end do
> end
>
>
> HTH
> D

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Tue Jan 31 2006 - 11:11:39 MST

This archive was generated by hypermail 2.2.0 : Tue Jan 31 2006 - 14:26:26 MST