Re: Plot from WRF Grib files / renaming variables

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Tue Jul 03 2012 - 07:58:25 MDT

Based upon

   GridType : Lambert Conformal Secant or Tangent, Conical or bipolar
  long_name : latitude
    corners : ( 31.373, 31.37483, 57.37227, 57.36925 )

   GridType : Lambert Conformal Secant or Tangent, Conical or bipolar
  long_name : longitude
    corners : ( -10.177, 29.7688, 42.64273, -23.05522 )

> res1@mpProjection = "Mercator"
> res1@mpLimitMode = "Corners"
> res1@mpLeftCornerLatF = lat2d@corners(0) ; 31.373
> res1@mpLeftCornerLonF = lon2d@corners(0) ; -10.177
> res1@mpRightCornerLatF = lat2d@corners(2) ; 57.37227
> res1@mpRightCornerLonF = lon2d@corners(2) ; 42.6273

should be all that you need. There is no need to set
     mpLimitMode = "LatLon" or mpMinLatF, etc
In fact, I don't think you want to.

Also, it is assumed you set

   wind_speed@lat2d = lat2d
   wind_speed@lon2d = lon2d

On 7/3/12 5:30 AM, Jonas Kaufmann wrote:
> Hello,
>
> I am trying to create a plot based on my WRF run. I am not using the
> direct WRF output files, but the converted Grib files instead and
> convert them again to NetCDF. My WRF domain is set up over Europe and
> I want to plot the area in Mercator projection.
>
> I can successfully plot the whole area with (example only):
>
> fin = addfile(grib_file,"r")
> wind_u = fin->U_GRD_GDS3_HTGL(:,:)
> wind_v = fin->V_GRD_GDS3_HTGL(:,:)
> wind_speed = sqrt(wind_u^2+wind_v^2)
> lat2d = fin->g3_lat_0
> lon2d = fin->g3_lon_1
> [...]
> res1@mpProjection = "Mercator"
> res1@mpLimitMode = "Corners"
> res1@mpLeftCornerLatF = lat2d@corners(0)
> res1@mpLeftCornerLonF = lon2d@corners(0)
> res1@mpRightCornerLatF = lat2d@corners(2)
> res1@mpRightCornerLonF = lon2d@corners(2)
> [...]
> plot = gsn_csm_vector_scalar_map(wks, wind_u, wind_v, wind_speed, res1)
>
> ...however I cannot limit the range of the plot using mpLimitMode =
> "LatLon" and setting mpMinLatF etc. This always gives me the error:
> check_for_y_lat_coord: Warning: Data either does not contain a valid
> latitude coordinate array or doesn't contain one at all.
> [...]
>
> According to the error message FAQ
> (http://www.ncl.ucar.edu/Document/Graphics/error_msg.shtml), I should
> rename the variable names to the automatically found variable names
> like "lat" and "lon". However I do not manage to get this to run
> correctly.
>
> What is the correct syntax to rename the variables and display my plot
> with mpLimitMode = "LatLon"? As an attachment you can find a
> ncl_filedump of the WRF file. Thank you for your help!
>
>
> Best regards,
>
>
> Jonas Kaufmann
>
>
>
> _______________________________________________
> 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 Tue Jul 3 07:58:51 2012

This archive was generated by hypermail 2.1.8 : Tue Jul 03 2012 - 15:40:39 MDT