MPTRAC
tnat.c
Go to the documentation of this file.
1/*
2 This file is part of MPTRAC.
3
4 MPTRAC is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8
9 MPTRAC is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with MPTRAC. If not, see <http://www.gnu.org/licenses/>.
16
17 Copyright (C) 2013-2023 Forschungszentrum Juelich GmbH
18*/
19
25#include "mptrac.h"
26
27int main(
28 int argc,
29 char *argv[]) {
30
31 /* Check arguments... */
32 if (argc < 3)
33 ERRMSG("Give parameters: <p> <h2o> <hno3>");
34
35 /* Get varibles... */
36 double p = atof(argv[1]);
37 double h2o = atof(argv[2]);
38 double hno3 = atof(argv[3]);
39
40 /* Write output... */
41 printf(" p= %g hPa\n", p);
42 printf(" q_H2O= %g ppv\n", h2o);
43 printf("q_HNO3= %g ppv\n", hno3);
44 printf(" T_dew= %g K\n", TDEW(p, h2o));
45 printf(" T_ice= %g K\n", TICE(p, h2o));
46 printf(" T_NAT= %g K\n", nat_temperature(p, h2o, hno3));
47
48 return EXIT_SUCCESS;
49}
double nat_temperature(const double p, const double h2o, const double hno3)
Calculates the nitric acid trihydrate (NAT) temperature.
Definition: mptrac.c:4191
MPTRAC library declarations.
#define ERRMSG(...)
Print an error message with contextual information and terminate the program.
Definition: mptrac.h:1901
#define TICE(p, h2o)
Calculate frost point temperature (WMO, 2018).
Definition: mptrac.h:1605
#define TDEW(p, h2o)
Calculate dew point temperature.
Definition: mptrac.h:1580
int main(int argc, char *argv[])
Definition: tnat.c:27