52 ERRMSG(
"Missing or invalid command-line arguments.\n\n"
53 "Usage: atm_conv <ctl> <atm_in> <atm_in_type> <atm_out> <atm_out_type>\n\n"
54 "Use -h for full help.");
65 ERRMSG(
"Cannot open file!");
94 printf(
"\nMPTRAC atm_conv tool.\n\n");
95 printf(
"Convert atmospheric particle data between file formats.\n");
99 (
" atm_conv <ctl> <atm_in> <atm_in_type> <atm_out> <atm_out_type>\n");
101 printf(
"Arguments:\n");
102 printf(
" <ctl> Control file.\n");
103 printf(
" <atm_in> Atmospheric input file.\n");
104 printf(
" <atm_in_type> Input format: 0=ASCII, 1=binary, 2=netCDF,\n");
106 (
" 3=CLaMS trajectory/position netCDF, 4=CLaMS position netCDF.\n");
107 printf(
" <atm_out> Atmospheric output file.\n");
108 printf(
" <atm_out_type> Output format: 0=ASCII, 1=binary, 2=netCDF,\n");
110 (
" 3=CLaMS trajectory/position netCDF, 4=CLaMS position netCDF.\n");
111 printf(
"\nFurther information:\n");
112 printf(
" Manual: https://slcs-jsc.github.io/mptrac/\n");
int main(int argc, char *argv[])
void usage(void)
Print command-line help.
void mptrac_write_atm(const char *filename, const ctl_t *ctl, const atm_t *atm, const double t)
Writes air parcel data to a file in various formats.
int mptrac_read_atm(const char *filename, const ctl_t *ctl, atm_t *atm)
Reads air parcel data from a specified file into the given atmospheric structure.
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.
MPTRAC library declarations.
#define ERRMSG(...)
Print an error message with contextual information and terminate the program.
#define USAGE
Print usage information on -h or --help.
#define ALLOC(ptr, type, n)
Allocate memory for a pointer with error handling.
int atm_type
Type of atmospheric data files (0=ASCII, 1=binary, 2=netCDF, 3=CLaMS_traj, 4=CLaMS_pos).
int atm_type_out
Type of atmospheric data files for output (-1=same as ATM_TYPE, 0=ASCII, 1=binary,...
double t_stop
Stop time of simulation [s].
double t_start
Start time of simulation [s].