[ncl-talk] reading certain HRRR netdf variables causes errors

Dennis Shea shea at ucar.edu
Fri Nov 24 19:29:59 MST 2017


When you post, it is best to include the version of NCL you are using.

==
That said ... I doubt is is a version issue.

When NCL sees
      y=file1->u-component_of_wind_height_above_ground
it interprets it as

      y= file1->u    ... minus ...(component_of_wind_height_above_ground)

The minus sign [ - ] is the issue. The same for

       z=file1->VAR0-3-198_FROM_59-0--1

       z= file1->VAR0 minus 3 -198_FROM_59 minus 0 mimus-minus 1
===
This is eaplined in the reference manual

To read these variables, enclose a string within $ syntax

      y=file1->$"u-component_of_wind_height_above_ground"$
      z=ile1->$"VAR0-3-198_FROM_59-0--1"$


Good luck



On Fri, Nov 24, 2017 at 5:31 PM, Ian Wittmeyer <iwittmeyer at gmail.com> wrote:

> Hi,
>
>
> I am successful reading most variables from HRRR netcdf files with an NCL
> script, but reading a few variables causes errors.
> The HRRR netcdf files were downloaded from the NCAR thredds-jumbo server
> with use of the netcdf subset service.
>
>
>
> The following line works fine:
>
> x=file1->Relative_humidity_height_above_ground
>
>
> The following line generates an error:
>
> y=file1->u-component_of_wind_height_above_ground
>
> here’s the ncl error:
>
> fatal:Either file (file1) isn't defined or variable (u) is not a variable
> in the file
> fatal:["Execute.c":8575]:Execute: Error occurred at or near line 28 in
> file a.ncl
>
>
>
> The following line generates a different error:
>
> z=file1->VAR0-3-198_FROM_59-0–1_msl
>
> here’s the ncl error:
>
> fatal:syntax error: line 27 in file a.ncl before or near _FROM_59
>    mslp=file1->VAR0-3-198_FROM_59
> -------------------------------^
>
> fatal:Syntax Error in block, block not executed
> fatal:error at line 29 in file a.ncl
>
>
>
> Relevant header information from the netcdf file:
>
>        float Relative_humidity_height_above_ground(time4,
> height_above_ground6, y, x) ;
>                Relative_humidity_height_above_ground:long_name =
> "Relative humidity @ Specified height level above ground" ;
>                Relative_humidity_height_above_ground:units = "%" ;
>                Relative_humidity_height_above_ground:Grib_Variable_Id =
> "VAR_0-1-1_L103" ;
>                Relative_humidity_height_above_ground:Grib2_Parameter = 0,
> 1, 1 ;
>                Relative_humidity_height_above_ground:Grib2_Parameter_Discipline
> = "Meteorological products" ;
>                Relative_humidity_height_above_ground:Grib2_Parameter_Category
> = "Moisture" ;
>                Relative_humidity_height_above_ground:Grib2_Parameter_Name
> = "Relative humidity" ;
>                Relative_humidity_height_above_ground:Grib2_Level_Type =
> 103 ;
>                Relative_humidity_height_above_ground:Grib2_Level_Desc =
> "Specified height level above ground" ;
>                Relative_humidity_height_above_ground:Grib2_Generating_Process_Type
> = "Forecast" ;
>                Relative_humidity_height_above_ground:coordinates =
> "reftime time4 height_above_ground6 y x " ;
>                Relative_humidity_height_above_ground:grid_mapping =
> "LambertConformal_1059X1799-38p51N-97p49W" ;
>        float u-component_of_wind_height_above_ground(time6,
> height_above_ground2, y, x) ;
>                u-component_of_wind_height_above_ground:long_name =
> "u-component of wind @ Specified height level above ground" ;
>                u-component_of_wind_height_above_ground:units = "m/s" ;
>                u-component_of_wind_height_above_ground:Grib_Variable_Id =
> "VAR_0-2-2_L103" ;
>                u-component_of_wind_height_above_ground:Grib2_Parameter =
> 0, 2, 2 ;
>                u-component_of_wind_height_above_ground:Grib2_Parameter_Discipline
> = "Meteorological products" ;
>                u-component_of_wind_height_above_ground:Grib2_Parameter_Category
> = "Momentum" ;
>                u-component_of_wind_height_above_ground:Grib2_Parameter_Name
> = "u-component of wind" ;
>                u-component_of_wind_height_above_ground:Grib2_Level_Type =
> 103 ;
>                u-component_of_wind_height_above_ground:Grib2_Level_Desc =
> "Specified height level above ground" ;
>                u-component_of_wind_height_above_ground:Grib2_Generating_Process_Type
> = "Forecast" ;
>                u-component_of_wind_height_above_ground:coordinates =
> "reftime time6 height_above_ground2 y x " ;
>                u-component_of_wind_height_above_ground:grid_mapping =
> "LambertConformal_1059X1799-38p51N-97p49W" ;
>        float VAR0-3-198_FROM_59-0--1_msl(time4, y, x) ;
>                VAR0-3-198_FROM_59-0--1_msl:long_name = "Unknown Parameter
> 0-3-198 @ Mean sea level" ;
>                VAR0-3-198_FROM_59-0--1_msl:units = "" ;
>                VAR0-3-198_FROM_59-0--1_msl:Grib_Variable_Id =
> "VAR_0-3-198_L101" ;
>                VAR0-3-198_FROM_59-0--1_msl:Grib2_Parameter = 0, 3, 198 ;
>                VAR0-3-198_FROM_59-0--1_msl:Grib2_Parameter_Discipline =
> "Meteorological products" ;
>                VAR0-3-198_FROM_59-0--1_msl:Grib2_Parameter_Category =
> "Mass" ;
>                VAR0-3-198_FROM_59-0--1_msl:Grib2_Level_Type = 101 ;
>                VAR0-3-198_FROM_59-0--1_msl:Grib2_Level_Desc = "Mean sea
> level" ;
>                VAR0-3-198_FROM_59-0--1_msl:Grib2_Generating_Process_Type
> = "Forecast" ;
>                VAR0-3-198_FROM_59-0--1_msl:coordinates = "reftime time4 y
> x " ;
>                VAR0-3-198_FROM_59-0--1_msl:grid_mapping =
> "LambertConformal_1059X1799-38p51N-97p49W” ;
>
>
> Any idea why I am getting these errors?
>
> Thank you,
>
> Ian Wittmeyer
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20171124/66973be1/attachment.html>


More information about the ncl-talk mailing list