Find retrieval results for given location.
More...
Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
|
Find retrieval results for given location.
Definition in file select_ret.c.
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 28 of file select_ret.c.
30 {
31
33
34
35 if (argc < 3)
36 ERRMSG(
"Give parameters: <ctl> [<airs1.nc> <airs2.c> ...]");
37
38
39 const double lon0 =
40 (int)
scan_ctl(argc, argv,
"SELECT_LON0", -1,
"-180", NULL);
41 const double lon1 =
42 (int)
scan_ctl(argc, argv,
"SELECT_LON1", -1,
"180", NULL);
43 const double lat0 =
44 (int)
scan_ctl(argc, argv,
"SELECT_LAT0", -1,
"-90", NULL);
45 const double lat1 =
46 (int)
scan_ctl(argc, argv,
"SELECT_LAT1", -1,
"90", NULL);
47
48
49 for (int i = 2; i < argc; i++) {
50
51
53
54
55 if (ret.
lon[ret.
nds / 2][0] >= lon0
56 && ret.
lon[ret.
nds / 2][0] <= lon1
57 && ret.
lat[ret.
nds / 2][0] >= lat0 && ret.
lat[ret.
nds / 2][0] <= lat1)
58 printf(
"select: %s %.2f %g %g\n", argv[i], ret.
time[ret.
nds / 2][0],
60 }
61
62 return EXIT_SUCCESS;
63}
double scan_ctl(int argc, char *argv[], const char *varname, int arridx, const char *defvalue, char *value)
Search control parameter file for variable entry.
#define ERRMSG(...)
Print error message and quit program.
void read_retr(char *filename, ret_t *ret)
Read AIRS retrieval data.
double lat[NDS][NPG]
Latitude [deg].
int nds
Number of data sets.
double time[NDS][NPG]
Time (seconds since 2000-01-01T00:00Z).
double lon[NDS][NPG]
Longitude [deg].