Calculate PSC temperatures.
More...
Go to the source code of this file.
|
| void | usage (void) |
| | Print command-line help. More...
|
| |
| int | main (int argc, char *argv[]) |
| |
Calculate PSC temperatures.
Definition in file tnat.c.
◆ usage()
Print command-line help.
Definition at line 70 of file tnat.c.
71 {
72
73 printf("\nMPTRAC tnat tool.\n\n");
74 printf("Calculate PSC formation temperatures.\n");
75 printf("\n");
76 printf("Usage:\n");
77 printf(" tnat <p> <h2o> <hno3>\n");
78 printf("\n");
79 printf("Arguments:\n");
80 printf(" <p> Pressure [hPa].\n");
81 printf(" <h2o> Water vapor volume mixing ratio [ppv].\n");
82 printf(" <hno3> Nitric acid volume mixing ratio [ppv].\n");
83 printf("\nFurther information:\n");
84 printf(" Manual: https://slcs-jsc.github.io/mptrac/\n");
85}
◆ main()
| int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 39 of file tnat.c.
41 {
42
43
45
46
47 if (argc < 3)
48 ERRMSG(
"Missing or invalid command-line arguments.\n\n"
49 "Usage: tnat <p> <h2o> <hno3>\n\n" "Use -h for full help.");
50
51
52 const double p = atof(argv[1]);
53 const double h2o = atof(argv[2]);
54 const double hno3 = atof(argv[3]);
55
56
57 printf(" p= %g hPa\n", p);
58 printf(" q_H2O= %g ppv\n", h2o);
59 printf("q_HNO3= %g ppv\n", hno3);
60 printf(
" T_dew= %g K\n",
TDEW(p, h2o));
61 printf(
" T_ice= %g K\n",
TICE(p, h2o));
63
64 return EXIT_SUCCESS;
65}
double nat_temperature(const double p, const double h2o, const double hno3)
Calculates the nitric acid trihydrate (NAT) temperature.
#define ERRMSG(...)
Print an error message with contextual information and terminate the program.
#define USAGE
Print usage information on -h or --help.
#define TICE(p, h2o)
Calculate frost point temperature (WMO, 2018).
#define TDEW(p, h2o)
Calculate dew point temperature.