Contact: zegraph  @  yahoo.com      Last update: June 2020

Ungrib Library

GRIB-1

Function Parameter Type Remark
grib1(callback, fname) string, string

Opens a GRIB-1 file named as fname, scans the file content, and calls the callback function with an array, in which "nlat" is the number of latitude grid, "lat1" the first latitude, "lat2" the last latitude, "dlat" the latitude step, "nlon" the number of longitude grid, "lon1" the first longitude, "lon2" the last longitude, "dlon" the longitude step, "scan" the scan mode, "olon" the longitude grid orientation of polar stereographic projection, "xlen" and "ylen" the x- and y-direction grid length in meter, "projection" the projection flag, "grid_type" the grid type id, "parameter" the parameter id, "level_tyoe" the lavel type id, "level1" and "level2" the lavel parameter values, "P1" and "P2" the interval parameters values, and paraemters having obvious meanings: "forecast_unit" , "range_indicator" "year", "month", "day", "hour", and "minute".

GRIB-2

Function Parameter Type Remark
grib2(callback, fname) string, string

Opens a GRIB-2 file named as fname, scans the file content, and calls the allback function with a number of parameters. If the first parameters is "is", the second is the pointer size, and the third is the pointer to integer values of the identification section. If the first parameters is "gds", the second is the pointer size, and the third is the pointer to integer values of the template of the grid definition section. If the first parameters is "pds", the second is the pointer size, the third is the pointer to integer values of the template of the product definition section, and the forth is the template number. If the first parameters is "data", the second is the pointer size, the third is the pointer to float values of a parameter, and the forth is the template number.

GRID

Function Parameter Type Remark
q2regular(ptr,region,out) user, integer, user Converts data in ptr (float pointer) on quasi-regular grid to regular 1.25x1.25 grid (out, 73x73 float pointer).
g2regular(ptr, out, y, nr, nc, flag) user, user, user, integer, integer, boolean Converts data in ptr (nr*nc float pointer) on Guassian regular grid (y, nr double pointer) to regular grid (out, (nr+1)*nc float pointer). The flag indicates whether the input is a wind vector or not.
e2regular(ptr, nl, nr, nc, out, NL, NR, NC[, flag]) user, integer, integer, integer, user, integer, integer, integer, boolean Converts data in ptr (nl*nr*nc float pointer) on eta grid to regular grid (out, NL*NR*NC float pointer). The optional flag indicates whether the input is a wind vector or not.