[ncl-talk] Converting grb to netcdf (jra55 reanalysis): No time dimension created

Kevin Hallock hallock at ucar.edu
Fri Dec 8 10:14:51 MST 2017


Hi Lyndz,

The command you provided below will work to simply convert the file. However, in order to assign “forecast time” as a dimension instead of an attribute, it is necessary to use ncl_convert2nc’s “-ftime” flag:
ncl_convert2nc fcst_phy2m125.1979010100.grb -ftime -u -U time

The “-itime” flag also exists for performing the same operation on “initial time” attributes, but given that the file in question is a forecast (“fcst_*.grb”) that might not be necessary or desired in this case:
ncl_convert2nc fcst_phy2m125.1979010100.grb -ftime -itime -u -U time

Since you said that you want your forecast time dimension to be unlimited, you would also want to include “-u forecast_time0” in the ncl_convert2nc command:
ncl_convert2nc fcst_phy2m125.1979010100.grb -ftime -u forecast_time0 -U time

Note: Running “ncl_convert2nc --help” (with both NCL 6.3.0 and 6.4.0) indicates that “-u” implicitly makes “initial_time” dimensions unlimited for GRIB input files; “forecast time” requires the dimension name to be specified. (The web documentation <https://www.ncl.ucar.edu/Document/Tools/ncl_convert2nc.shtml> for “-u” is not as verbose, but I will make sure that this information is added.)

Also, you could theoretically choose to output the file as a NetCDF 4 classic format file by adding the “-nc4c” flag:
ncl_convert2nc fcst_phy2m125.1979010100.grb -ftime -u forecast_time0 -U time -nc4c

I hope this helps,
Kevin

> On Dec 8, 2017, at 4:27 AM, Lyndon Mark Olaguera <olagueralyndonmark429 at gmail.com> wrote:
> 
> Dear NCL experts,
> 
> I am trying to convert a grb file to netcdf using ncl_convert2nc. 
> 
> Attached are the output of ncl_filedump and ncdump -h. The raw file can be accessed 
> here:
> 
> https://www.dropbox.com/s/zcsik2tl8qpgjwi/fcst_phy2m125.1979010100?dl=0 <https://www.dropbox.com/s/zcsik2tl8qpgjwi/fcst_phy2m125.1979010100?dl=0>
> 
> 
> I am converting the file using the following command:
> 
> ncl_convert2nc fcst_phy2m125.1979010100.grb -u -U time
> 
> This is weird because the ncl_filedump has the "initial_time" attibute. Example:
> 
>       float ULWRF_GDS0_SFC_ave3h ( g0_lat_0, g0_lon_1 )
>          sub_center :	241
>          center :	Japanese Meteorological Agency - Tokyo (RSMC)
>          long_name :	Upward long wave radiation flux
>          units :	W/m^2
>          _FillValue :	1e+20
>          level_indicator :	1
>          gds_grid_type :	0
>          parameter_table_version :	200
>          parameter_number :	212
>          forecast_time :	3
>          forecast_time_units :	hours
>          initial_time :	01/01/1979 (00:00)
> 
> It does not give an error but no "unlimited time" dimension is created:
> 
> determining unlimited dimension dynamically
> if   of
> Processing file: fcst_phy2m125.1979010100.grb...
>  Copyright (C) 1995-2017 - All Rights Reserved
>  University Corporation for Atmospheric Research
>  NCAR Command Language Version 6.4.0
>  The use of this software is governed by a License Agreement.
>  See http://www.ncl.ucar.edu/ <http://www.ncl.ucar.edu/> for more details.
> 
> Any suggestion on how to do this correctly?
> 
> I'll appreciate any help.
> 
> Sincerely,
> 
> Lyndz
> <file_dump.out><ncdump.out>_______________________________________________
> 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/20171208/3f32de33/attachment.html>


More information about the ncl-talk mailing list