41 {
42
44
46
48
50
51
53
54
55 if (argc < 6)
56 ERRMSG(
"Missing or invalid command-line arguments.\n\n"
57 "Usage: met_conv <ctl> <met_in> <met_in_type> <met_out> <met_out_type>\n\n"
58 "Use -h for full help.");
59
60
61 mptrac_alloc(NULL, NULL, &clim, &met, NULL, NULL, NULL, &dd);
62
63
65
66
68
69
72 ERRMSG(
"Cannot open file!");
73
74
77
78
80
81
82 mptrac_free(NULL, NULL, clim, met, NULL, NULL, NULL, dd);
83
84 return EXIT_SUCCESS;
85}
void mptrac_free(ctl_t *ctl, cache_t *cache, clim_t *clim, met_t *met0, met_t *met1, atm_t *atm, depo_t *depo, dd_t *dd)
Frees memory resources allocated for MPTRAC.
void mptrac_read_clim(const ctl_t *ctl, clim_t *clim)
Reads various climatological data and populates the given climatology structure.
void mptrac_alloc(ctl_t **ctl, cache_t **cache, clim_t **clim, met_t **met0, met_t **met1, atm_t **atm, depo_t **depo, dd_t **dd)
Allocates and initializes memory resources for MPTRAC.
int mptrac_read_met(const char *filename, const ctl_t *ctl, const clim_t *clim, met_t *met, dd_t *dd)
Reads meteorological data from a file, supporting multiple formats and MPI broadcasting.
void mptrac_read_ctl(const char *filename, int argc, char *argv[], ctl_t *ctl)
Reads control parameters from a configuration file and populates the given structure.
void mptrac_write_met(const char *filename, const ctl_t *ctl, met_t *met)
Writes meteorological data to a file, supporting multiple formats and compression options.
#define ERRMSG(...)
Print an error message with contextual information and terminate the program.
#define USAGE
Print usage information on -h or --help.
#define PRINT_TIMERS
Print the current state of all timers.
int met_type
Type of meteo data files (0=netCDF, 1=binary, 2=pck, 3=ZFP, 4=ZSTD, 5=cms, 6=grib,...
Domain decomposition data structure.