JURASSIC
Functions
atmfmt.c File Reference

Convert atmospheric data files. More...

#include "jurassic.h"

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Detailed Description

Convert atmospheric data files.

Definition in file atmfmt.c.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 39 of file atmfmt.c.

41 {
42
43 ctl_t ctl;
44
45 static atm_t atm;
46
47 /* Print usage information... */
48 USAGE;
49
50 /* Check arguments... */
51 if (argc < 6)
52 ERRMSG("Missing or invalid command-line arguments.\n\n"
53 "Usage: atmfmt <ctl> <atm_in> <atmfmt_in> <atm_out> <atmfmt_out> [KEY VALUE ...]\n\n"
54 "Use -h for full help.");
55
56 /* Read control parameters... */
57 read_ctl(argc, argv, &ctl);
58
59 /* Read profile indices... */
60 int prof_in = (int) scan_ctl(argc, argv, "PROF_IN", -1, "0", NULL);
61 int prof_out = (int) scan_ctl(argc, argv, "PROF_OUT", -1, "0", NULL);
62
63 /* Read atmospheric data... */
64 ctl.atmfmt = atoi(argv[3]);
65 read_atm(NULL, argv[2], &ctl, &atm, prof_in);
66
67 /* Write atmospheric data... */
68 ctl.atmfmt = atoi(argv[5]);
69 write_atm(NULL, argv[4], &ctl, &atm, prof_out);
70
71 return EXIT_SUCCESS;
72}
void write_atm(const char *dirname, const char *filename, const ctl_t *ctl, const atm_t *atm, int profile)
Write atmospheric data to a file.
Definition: jurassic.c:7307
void read_ctl(int argc, char *argv[], ctl_t *ctl)
Read model control parameters from command-line and configuration input.
Definition: jurassic.c:5516
void read_atm(const char *dirname, const char *filename, const ctl_t *ctl, atm_t *atm, int profile)
Read atmospheric input data from a file.
Definition: jurassic.c:5193
double scan_ctl(int argc, char *argv[], const char *varname, const int arridx, const char *defvalue, char *value)
Scan control file or command-line arguments for a configuration variable.
Definition: jurassic.c:6612
#define ERRMSG(...)
Print an error message with contextual information and terminate the program.
Definition: jurassic.h:1325
#define USAGE
Print usage information on -h or --help.
Definition: jurassic.h:1206
Atmospheric profile data.
Definition: jurassic.h:1375
Control parameters.
Definition: jurassic.h:1428
int atmfmt
Atmospheric data file format (1=ASCII, 2=binary, 3=netCDF).
Definition: jurassic.h:1485
Here is the call graph for this function: