updated top-level README and version_decl for V4.5 (#1847)
[WRF.git] / external / io_grib_share / gridnav.h
blob754867fd51df9847d854233493573a6dfe93eac2
1 /*****************************************************************************
2 * Todd Hutchinson
3 * WSI Corporation
4 * Billerica, MA
5 *****************************************************************************/
7 /* This header contains the public interface to the GridNav API. */
9 typedef struct {
10 float central_lat;
11 float central_lon;
12 int map_proj;
13 float truelat1;
14 float truelat2;
15 } Projection;
17 typedef struct {
18 int num_columns;
19 int num_rows;
20 float dx;
21 float dy;
22 float lat_origin;
23 float lon_origin;
24 float origin_column;
25 float origin_row;
26 } GridStruct;
28 typedef struct {
29 double parm1;
30 double parm2;
31 double parm3;
32 double parm4;
33 double parm5;
34 double parm6;
35 double parm7;
36 } ProjTransform;
38 typedef struct {
39 Projection proj;
40 GridStruct grid;
41 ProjTransform proj_transform;
42 } GridNav;
45 /* Public Interface */
47 int GRID_init(float center_lat, float center_lon, int projection,
48 float truelat1, float truelat2, int num_columns,
49 int num_rows, float dx, float dy, float lat_origin,
50 float lon_origin, float origin_column, float origin_row,
51 GridNav *gridnav);
52 int GRID_to_latlon(GridNav *gridnav, float column, float row, float *lat,
53 float *lon);
54 int GRID_from_latlon(GridNav *gridnav, float lat, float lon, float *column,
55 float *row);
56 int GRID_rotate_from_earth_coords(GridNav *gridnav, float lon, float u_earth,
57 float v_earth, float *u_grid, float *v_grid);
58 int GRID_rotate_to_earth_coords(GridNav *gridnav, float lon, float u_grid,
59 float v_grid, float *u_earth, float *v_earth);
61 #define GRID_LATLON 0
62 #define GRID_MERCATOR 1
63 #define GRID_LAMCON 3
64 #define GRID_POLSTR 5