MPTRAC
Functions
tnat.c File Reference

Calculate PSC temperatures. More...

#include "mptrac.h"

Go to the source code of this file.

Functions

void usage (void)
 Print command-line help. More...
 
int main (int argc, char *argv[])
 

Detailed Description

Calculate PSC temperatures.

Definition in file tnat.c.

Function Documentation

◆ usage()

void usage ( void  )

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 /* Print usage information... */
44 USAGE;
45
46 /* Check arguments... */
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 /* Get varibles... */
52 const double p = atof(argv[1]);
53 const double h2o = atof(argv[2]);
54 const double hno3 = atof(argv[3]);
55
56 /* Write output... */
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));
62 printf(" T_NAT= %g K\n", nat_temperature(p, h2o, hno3));
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.
Definition: mptrac.c:6721
#define ERRMSG(...)
Print an error message with contextual information and terminate the program.
Definition: mptrac.h:2102
#define USAGE
Print usage information on -h or --help.
Definition: mptrac.h:1909
#define TICE(p, h2o)
Calculate frost point temperature (WMO, 2018).
Definition: mptrac.h:1796
#define TDEW(p, h2o)
Calculate dew point temperature.
Definition: mptrac.h:1771
Here is the call graph for this function: