Convert file format of meteo data files.
More...
Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
|
Convert file format of meteo data files.
Definition in file met_conv.c.
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 27 of file met_conv.c.
29 {
30
32
34
36
37
38 if (argc < 6)
39 ERRMSG(
"Give parameters: <ctl> <met_in> <met_in_type>"
40 " <met_out> <met_out_type>");
41
42
45
46
48
49
51
52
54 if (!
read_met(argv[2], &ctl, clim, met))
55 ERRMSG(
"Cannot open file!");
56
57
60
61
62 free(clim);
63 free(met);
64
65 return EXIT_SUCCESS;
66}
int write_met(const char *filename, ctl_t *ctl, met_t *met)
Writes meteorological data to a binary file.
void read_clim(ctl_t *ctl, clim_t *clim)
Reads various climatological data and populates the given climatology structure.
void read_ctl(const char *filename, int argc, char *argv[], ctl_t *ctl)
Reads control parameters from a configuration file and populates the given structure.
int read_met(const char *filename, ctl_t *ctl, clim_t *clim, met_t *met)
Reads meteorological data from a file and populates the provided structures.
#define ERRMSG(...)
Print an error message with contextual information and terminate the program.
#define ALLOC(ptr, type, n)
Allocate memory for a pointer with error handling.
int met_type
Type of meteo data files (0=netCDF, 1=binary, 2=pck, 3=zfp, 4=zstd, 5=cms).