This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
>From: Matt Fearon <address@hidden> >Organization: Desert Research Institute >Keywords: 199909202052.OAA24442 >Steve, > >I am performing some calculations in gempak and then >displaying in grads. > >After obtaining the eta grib data via ftp, I am converting the >grib to gempak grid format. Then I am performing some >calculations using gempak programs. > >After performing calculations and having a single gempak >grid file, I was wondering if there is a way to re-convert >the gempak grid file back to grib? Supposedly I can then >read the grib file into grads. Or a shorter way, if it is possilbe, >may be to read the gempak grid file straight into grads w/o >re-converting to grib? > >The reason I start in gempak is that I can perform certain >calculations easier in gempak than in grads, but for the >final product graphical display, in this case, I prefer grads. > >If you have any ideas, please let me know. >Thank you, >Matt Fearon >address@hidden > > > > Matt, I do not have any way of converting a Gempak file back to grib. In general, you would need some information for generating the grib product that is not stored in the Gempak file when it is decoded. You could create a program to convert the Gempak file to the grads format if you know the requirements there. Reading a gempak grid file is generally straight forward when using the gemlib.a library routines- IN_BDTA initiallizes the gempak interfaces GD_OPNF opens the gempak grid file GD_NGRD determines the number of grids in the file GD_GGRD returns a grid given its number in the file (eg from 1 to number of grids) returns the grid times, levels, vertical coordinate, parameter name, number of x,y gridpoints, the nagigation information and the grid array. Once you have the gempak grid read in from the file, you can decide how to output the grid into the grads file. If you need help creating the stub to read the gempak grid, I can create that for you. Let me know. Steve Chiswell Unidata User support GD_GIDN obtains the grid information (level, coordinate, parameter)