48 ERRMSG(
"Missing or invalid command-line arguments.\n\n"
49 "Usage: tnat <p> <h2o> <hno3>\n\n" "Use -h for full help.");
52 const double p = atof(argv[1]);
53 const double h2o = atof(argv[2]);
54 const double hno3 = atof(argv[3]);
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));
73 printf(
"\nMPTRAC tnat tool.\n\n");
74 printf(
"Calculate PSC formation temperatures.\n");
77 printf(
" tnat <p> <h2o> <hno3>\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");
double nat_temperature(const double p, const double h2o, const double hno3)
Calculates the nitric acid trihydrate (NAT) temperature.
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 TICE(p, h2o)
Calculate frost point temperature (WMO, 2018).
#define TDEW(p, h2o)
Calculate dew point temperature.
int main(int argc, char *argv[])
void usage(void)
Print command-line help.