Re: interpolate rotated grid to rectangulat

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Mon Apr 22 2013 - 14:27:05 MDT

My guess is that the top plot doesn't have the lat/lon coordinates correctly defined.

Without seeing your script, I'm not sure how to fix the problem.

The way it was done for the script I sent you is that I had set these special attributes:

    SLP@lat2d = lat2d
    SLP@lon2d = lon2d
    U@lat2d = lat2d
    U@lon2d = lon2d
    V@lat2d = lat2d
    V@lon2d = lon2d

The gsn_csm_contour_map scripts will look for the special "lat2d" and "lon2d" attributes and use them when you plot data over a map.

It's also important to set:

   res@gsnAddCyclic = False

if you have regional data.

--Mary

On Apr 22, 2013, at 1:53 PM, igor akkerman wrote:

> I plotted wind (u and v components and wind speed) using NCL and did it for rotated grid and rectilinear.
> In case of rectilinear regridded coordinates the pattern is skewed and looks different.
>
> 2013/4/22 Mary Haley <haley@ucar.edu>
> I don't understand the plots you sent me. These look like ncview plots and not NCL plots.
>
> I don't think ncview knows how to put data over a polar map, which is what I did for you in the last NCL plot.
>
> Can you please compare the plots using NCL, and not ncview?
>
> --Mary
>
> On Apr 22, 2013, at 1:32 PM, igor akkerman wrote:
>
> > Thanks Mary,
> >
> > I rewrote the last part of the code to write the netcdf file. I am not sure if I did it correctly because the fields do not look the same. Maybe that's fine because of the different grid in different files but just to be safe could you please take a quick look at the attached 2 files and say if they are correct. I tried plotting original and regridded data in ncl rather than check it in ncview and again the plots were quite different.
> >
> > Here's how I coded writing variables to the new netcdf file:
> >
> > system("/bin/rm -f atm."+iy+"-"+month+".nc") ; remove any pre-existing file
> > ncdf = addfile("atm."+iy+"-"+month+".nc" ,"c") ; open output netCDF file
> > ncdf->v10 = V_regrid
> > ncdf->u10 = U_regrid
> > ncdf->mslp= SLP_regrid
> >
> > The plots are attached,
> > thanks again
> >
> > 2013/4/22 Mary Haley <haley@ucar.edu>
> > Alex,
> >
> > The ESMF_regrid routines do not write the regridded output to a file.
> >
> > The Rectilinear.nc and WRF_SCRIP.nc files that you see are intermediate files that ESMF needs to create in order to generate the weights files, which are HIRHAM_to_Rect.nc and WRF_to_Rect.nc.
> >
> > If you want to write the regridded variables to a file, you will need to do this yourself. See the attached script, which writes a file called "example.nc".
> >
> > For more information about writing data to a NetCDF file, see:
> >
> > http://www.ncl.ucar.edu/Applications/o-netcdf.shtml
> >
> >
> > --Mary
> >
> >
> >
> >
> > On Apr 22, 2013, at 11:57 AM, igor akkerman wrote:
> >
> > > Thanks Mary,
> > >
> > > The reason I said incorrect was because I can't find the netcdf file with slp, u, v data. I tried ncview'ing all the netcdf files created by the program and none of them had any data on slp, and wind. Where did the program save new interpolated data?
> > >
> > > These are the files that I checked:
> > > Rectilinear.nc, HIRHAM_to_Rect.nc, WRF_SCRIP.nc, WRF_to_Rect.nc
> > >
> > > Thank you again,
> > > Alex
> > >
> > > 2013/4/22 Mary Haley <haley@ucar.edu>
> > > Hi Igor,
> > >
> > > I have your files and am able to run your script. I need more information on why you think the interpolated values are not correct. Please see the attached plots, which I created by modifying your interpolate.ncl script.
> > >
> > > --Mary
> > >
> > >
> > >
> > > On Apr 19, 2013, at 4:04 PM, igor akkerman wrote:
> > >
> > > > Hi
> > > >
> > > > I have modified the code to interpolate the rotated grid onto rectangular lat-lon grid using ESMF function, the code is working but the interpolated it is not correct. I was hoping you could take a look at the files.
> > > >
> > > > I have dumped 3 files onto yout ftp server. Their names are:
> > > > 1) text file: hirham_rot_geo_koor.dat - text file containing info on the rotated grid (1st column - lat, 2nd column - lon) and rectangular equivalent of the grid (3d column - lat, 4th - lon)
> > > > 2) model output file: atm.1961-02.daily.nc
> > > > 3) ncl code: interpolate.ncl
> > > >
> > > > Below is some additional info on the model output grid:
> > > >
> > > > Here is a sketch of the rotated grid (rot.lat, rot.lon)
> > > > (24.5,-27.5) ------ (24.5,27.0)
> > > > | |
> > > > | |
> > > > (-25.0,-27.5) ------ (-25.0,27.0)
> > > > This is a regular grid with uniform resol. of 0.5.
> > > >
> > > > and in geograf. grid (geograf. lat, lon):
> > > > (53.8,-134.6) ------ (54.2,135.1)
> > > > | |
> > > > | |
> > > > (53.5,-44.7) ------ (53.85,44.2)
> > > >
> > > >
> > > > We have 110 (nlon) x 100 (nlat) grid points;
> > > > resolution is ~50 km (i.e. 0.5 deg in rotated grid; DLON=0.5,DLAT=0.5)
> > > > _______________________________________________
> > > > ncl-talk mailing list
> > > > List instructions, subscriber options, unsubscribe:
> > > > http://mailman.ucar.edu/mailman/listinfo/ncl-talk
> > >
> > >
> > >
> >
> >
> >
> > <RECTALINIAR.png><ROTATED.png>
>
>
> <RECTILINEAR.png><ROTATED.png>

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Apr 22 14:27:16 2013

This archive was generated by hypermail 2.1.8 : Tue Apr 23 2013 - 12:54:13 MDT