There are a couple of methods for the time. I do not
have a gfs file but ...
--
Generally, a variable will have
f = addfile(...)
x = f->X
printVarSummary(X) ; <- always look at variable
float x ( :, : )
[snip]
forecast_time : 24
forecast_time_units : hours
initial_time : 11/11/2008 (00:00)
In your script use x@forecast and/or x@initial_time
--
Use setfileoption in various modes.
http://www.ncl.ucar.edu/Document/Functions/Built-in/setfileoption.shtml
Try and see what you get
setfileoption(...)
f = addfile(...)
x = f->X
printVarSummary(x)
Try
setfileoption("grib","SingleElementDimensions", "Initial_time")
or
setfileoption("grib","SingleElementDimensions", "Forecast_time")
or
setfileoption("grib","SingleElementDimensions", (/"Initial_time",
"Forecast_time"/))
The latter may look like:
float x ( initial_time0_hours, forecast_time1, lat_3, lon_3 )
There will be several 'time variables'
========
A more efficient method for looking at the files
is ncl_filedump via options
%> ncl_filedump gfs.grb | less
%> ncl_filedump -itime gfs.grb | less
%> ncl_filedump -ftime gfs.grb | less
%> ncl_filedump -itime -ftime gfs.grb | less
Good luck
On 12/12/12 7:38 AM, Jonas Kaufmann wrote:
> Hello,
>
> I am using NCL to create plots from the GFS grib files. Now I am
> trying to display a label with the current forecast time on the map. I
> have already positioned my text label with gsn_text_ndc, but I could
> not find a method to get the current forecast time. Which variable do
> I have to use for this?
>
> grib_file=filename
> fin = addfile(grib_file,"r")
> lat2d = fin->gridlat_0
> lon2d = fin->gridlon_0
> wind_u = fin->UGRD_P0_L103_GLC0(:,:)
> wind_v = fin->VGRD_P0_L103_GLC0(:,:)
>
>
> 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 Thu Dec 13 00:03:44 2012
This archive was generated by hypermail 2.1.8 : Wed Dec 12 2012 - 19:07:01 MST