On Jul 28, 2005, at 2:59 PM, MUHTARJAN osman wrote:
> Hello,
> I am wondering how to set dimension information for a seconadry
> variable in Lambert Conformal Native Grid . My program is like this:
> ......
>
> gridx_221 = 277
> gridy_221 = 349
>
> diri="/remote/beautemps/raid1/users/mjosman/NARR/NC/"
>
> f=addfile(diri+"narrmon-a_221_20031001.nc","r")
> LAT2d = f->gridlat_221
> LON2d = f->gridlon_221
>
> lon2d=LON2d(gridy_221|:,gridx_221|:)
> lat2d=LAT2d(gridy_221|:,gridx_221|:)
>
> P=f->PRMSL_221_MSL_113
> p = P(gridy_221|:,gridx_221|:)
> delete(P)
>
> Q=f->PRATE_221_SFC_113
> q = Q(gridy_221|:,gridx_221|:)
> delete(Q)
>
> ccr = escorc(p(50,100),q) ;***1-pt correlation***
>
>
> Now, if I want to plot "ccr", how should I set the lat and lon
> information so that it can be plotted properly. I tried something like
> this, but it failed:
>
> ccr!0="lat"
> ccr@lat=lat2d
> ccr!1="lon"
> ccr@lon=lon2d
>
Hi Muhtarjan,
I think what you want, instead of the above four lines, is the
following:
ccr@lat2d = lat2d
ccr@lon2d = lon2d
> I aslo have these settings before plotting:
>
> res@mpLimitMode = "Corners" ; choose range of map
> res@mpLeftCornerLatF = lat2d@corners(0)
> res@mpLeftCornerLonF = lon2d@corners(0)
> res@mpRightCornerLatF = lat2d@corners(2)
> res@mpRightCornerLonF = lon2d@corners(2)
> res@mpProjection = "LambertConformal"
> res@mpLambertParallel1F = lat2d@Latin1 ; ncl adds from grib file
> res@mpLambertParallel2F = lat2d@Latin2 ; ncl adds from grib file
> res@mpLambertMeridianF = lat2d@Lov ; ncl adds from grib file
> res@pmTickMarkDisplayMode = "Always"
>
>
> But when I run it, the program complains there's no lat/lon
> information for plotting. And there are also warning messages like:
>
> warning:mpProjection is not a valid resource in
> slpMA_prcp_NARR_contour at this time
> warning:mpLimitMode is not a valid resource in slpMA_prcp_NARR_contour
> at this time
You didn't mention which plotting routine you are calling, but these
errors look like you are calling a non-map routine, like
gsn_csm_contour.
This would cause you to get error messages about your map resources not
being valid. You probably want to call something like
gsn_csm_contour_map.
Also, it is important to note that if your data is native to a lambert
conformal projection, you should also set:
res@tfDoNDCOverlay = True
This tells NCL to *not* apply a transformation to the data to get it
into a lambert conformal projection, since
with native grids, the transformation has already been applied. You
can go to:
http://www.ncl.ucar.edu/Applications/lcnative.shtml
to see some examples of generating contours on a lambert conformal
projection. This page also talks
a bit about native grids.
--Mary
> warning:mpLeftCornerLonF is not a valid resource in
> slpMA_prcp_NARR_contour at this time
> warning:mpRightCornerLonF is not a valid resource in
> slpMA_prcp_NARR_contour at this time
> warning:mpLeftCornerLatF is not a valid resource in
> slpMA_prcp_NARR_contour at this time
> warning:mpRightCornerLatF is not a valid resource in
> slpMA_prcp_NARR_contour at this time
> warning:mpLambertMeridianF is not a valid resource in
> slpMA_prcp_NARR_contour at this time
> warning:mpLambertParallel1F is not a valid resource in
> slpMA_prcp_NARR_contour at this time
> warning:mpLambertParallel2F is not a valid resource in
> slpMA_prcp_NARR_contour at this time
>
>
> By the way, the information of my data file is following:
>
> ~>ncdump -h narrmon-a_221_20031001.nc
>
> netcdf narrmon-a_221_20031001 {
> dimensions:
> gridx_221 = 277 ;
> gridy_221 = 349 ;
>
> variables:
> float gridlon_221(gridx_221, gridy_221) ;
> gridlon_221:corners = -145.5f, -68.320045f,
> -2.5698934f, 148.64182f ;
> gridlon_221:GridType = "Lambert Conformal Secant or
> Tangent, Conical or bipolar" ;
> gridlon_221:units = "degrees_east" ;
> gridlon_221:Latin2 = 50.f ;
> gridlon_221:Latin1 = 50.f ;
> gridlon_221:Dy = 32463.f ;
> gridlon_221:Dx = 32463.f ;
> gridlon_221:Lov = -107.f ;
> gridlon_221:Lo1 = -145.5f ;
> gridlon_221:La1 = 1.f ;
> float gridlat_221(gridx_221, gridy_221) ;
> gridlat_221:corners = 1.0000008f, 0.89794505f,
> 46.354397f, 46.634327f ;
> gridlat_221:GridType = "Lambert Conformal Secant or
> Tangent, Conical or bipolar" ;
> gridlat_221:units = "degrees_north" ;
> gridlat_221:Latin2 = 50.f ;
> gridlat_221:Latin1 = 50.f ;
> gridlat_221:Dy = 32463.f ;
> gridlat_221:Dx = 32463.f ;
> gridlat_221:Lov = -107.f ;
> gridlat_221:Lo1 = -145.5f ;
> gridlat_221:La1 = 1.f ;
> float PRATE_221_SFC_113(gridx_221, gridy_221) ;
> PRATE_221_SFC_113:sub_center = "The North American
> Regional Reanalysis (NARR) Project" ;
> PRATE_221_SFC_113:center = "US National Weather Service
> - NCEP (WMC)" ;
> PRATE_221_SFC_113:long_name = "Precipitation rate" ;
> PRATE_221_SFC_113:units = "kg/m^2/s" ;
> PRATE_221_SFC_113:_FillValue = -999.f ;
> PRATE_221_SFC_113:coordinates = "gridlat_221
> gridlon_221" ;
> PRATE_221_SFC_113:level_indicator = 1 ;
> PRATE_221_SFC_113:grid_number = 221 ;
> PRATE_221_SFC_113:parameter_number = 59 ;
> PRATE_221_SFC_113:model = "North American Regional
> Reanalysis (NARR)" ;
> PRATE_221_SFC_113:forecast_time = 0 ;
> PRATE_221_SFC_113:initial_time = "10/01/2003 (00:00)" ;
> float PRMSL_221_MSL_113(gridx_221, gridy_221) ;
> PRMSL_221_MSL_113:sub_center = "The North American
> Regional Reanalysis (NARR) Project" ;
> PRMSL_221_MSL_113:center = "US National Weather Service
> - NCEP (WMC)" ;
> PRMSL_221_MSL_113:long_name = "Pressure reduced to MSL"
> ;
> PRMSL_221_MSL_113:units = "Pa" ;
> PRMSL_221_MSL_113:_FillValue = -999.f ;
> PRMSL_221_MSL_113:coordinates = "gridlat_221
> gridlon_221" ;
> PRMSL_221_MSL_113:level_indicator = 102 ;
> PRMSL_221_MSL_113:grid_number = 221 ;
> PRMSL_221_MSL_113:parameter_number = 2 ;
> PRMSL_221_MSL_113:model = "North American Regional
> Reanalysis (NARR)" ;
> PRMSL_221_MSL_113:forecast_time = 0 ;
> PRMSL_221_MSL_113:initial_time = "10/01/2003 (00:00)" ;
> }
>
>
> Thank you.
>
> Regards,
>
> Muhtarjan Osman
> ASGG
> LAWR
> UC Davis
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk@ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
_______________________________________________
ncl-talk mailing list
ncl-talk@ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
This archive was generated by hypermail 2b29 : Thu Jul 28 2005 - 15:38:55 MDT