Re: meteogram from grib2 file

From: Mary Haley <haley_at_nyahnyahspammersnyahnyah>
Date: Fri Sep 06 2013 - 11:20:12 MDT

Hi Luis,

Your script is one that assumes you have a WRF-ARW file. The GRIB2 file you attached doesn't have any file attribute information on it, so I'm not sure it is a proper WRF-ARW file.

Usually, with WRF-ARW files, you have all kinds of file attributes, like MAP_PROJ, GRID_TYPE, DX, DY, TITLE, START_DATE, etc.

Some of the wrf_user_xxxx functions depend on these global attributes in order to get the map projection information.

You are trying to use "wrf_user_ll_to_ij", which depends on this attribute information, but can't find it.

Also, you are trying read "Times" off the file, which doesn't exist on the file.

Rule #1: Look at your data:

        ncl_filedump grid_WRF_20130904-060000_ECOLOMBIA_F00080000_Pideam_R4km.grb2

This file does not have 2-dimensional lat/lon, but rather 1-dimensional lat/lon coordinate arrays. You shouldn't even need to use wrf_user_ll_to_jj. You can simply use lat/lon coordinate arrays:

  t2_point = t2({lat},{lon}) ; extract a time series at a point
  pres_point = pres({lat},{lon})
  tc_point = tc({lat},{lon})
  u_point = umet({lat},{lon})
  v_point = vmet({lat},{lon})

However, the other issue is your "lon" value is not in the range of the longitude values on the file. They go from 0 to 360, and you are using a lon of -74.15. Add 360 to this, and it should work.

  lon = 285.85 ; -74.15 + 360

This script still has issues, because you are referencing variables as if they are WRF ARW variables with "bottom_top" dimensions, which doesn't exist on this file. Therefore, this part of the script fails as well:

; Swap the dimensions as we want to plot time on the X axis later
  tt = tc_point(bottom_top|:,Time|:)
  ugrid = u_point(bottom_top|:,Time|:)
  vgrid = v_point(bottom_top|:,Time|:)

I don't have time to try to get this code working, so please try to debug some of these issues yourself.

You may want to consider using a "generic" meteogram code, instead of a WRF-ARW one. See the example at:

http://www.ncl.ucar.edu/Applications/meteo.shtml

--Mary

On Sep 5, 2013, at 9:13 PM, Luis Fernando Montana Roa wrote:

> Hi, I'm trying to plot a meteogram from GRIB2 files (such as attached).
> When I run the script, shows the following errors:
> ...
> warning:Attempt to reference attribute (MAP_PROJ) which is undefined
> warning:Attempt to reference attribute (TRUELAT1) which is undefined
> warning:Attempt to reference attribute (TRUELAT2) which is undefined
> warning:Attempt to reference attribute (STAND_LON) which is undefined
> warning:Attempt to reference attribute (DX) which is undefined
> warning:Attempt to reference attribute (DY) which is undefined
> fatal:The result of the conditional expression yields a missing value. NCL can not determine branch, see ismissing function
> fatal:["Execute.c":8128]:Execute: Error occurred at or near line 2262 in file $NCARG_ROOT/lib/ncarg/nclscripts/wrf/WRFUserARW.ncl
>
> fatal:["Execute.c":8128]:Execute: Error occurred at or near line 21 in file meteogram02.ncl
>
> Any suggestions?
>
> Thanks,
>
> -- Fernando
> <meteogram02.ncl><grid_WRF_20130904-060000_ECOLOMBIA_F00080000_Pideam_R4km.grb2>_______________________________________________
> 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 Sep 6 11:20:22 2013

This archive was generated by hypermail 2.1.8 : Mon Sep 16 2013 - 13:43:52 MDT