JURASSIC
Functions
hydrostatic.c File Reference

Recalculate pressure based on hydrostatic equilibrium. More...

#include "jurassic.h"

Go to the source code of this file.

Functions

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

Detailed Description

Recalculate pressure based on hydrostatic equilibrium.

Definition in file hydrostatic.c.

Function Documentation

◆ main()

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

Definition at line 39 of file hydrostatic.c.

41 {
42
43 static atm_t atm;
44 static ctl_t ctl;
45
46 /* Print usage information... */
47 USAGE;
48
49 /* Check arguments... */
50 if (argc < 4)
51 ERRMSG("Missing or invalid command-line arguments.\n\n"
52 "Usage: hydrostatic <ctl> <atm_in> <atm_hyd> [KEY VALUE ...]\n\n"
53 "Use -h for full help.");
54
55 /* Read control parameters... */
56 read_ctl(argc, argv, &ctl);
57
58 /* Check reference height... */
59 if (ctl.hydz < 0)
60 ERRMSG("Set HYDZ>=0!");
61
62 /* Read atmospheric data... */
63 read_atm(NULL, argv[2], &ctl, &atm, 0);
64
65 /* Build atmosphere based on hydrostatic equilibrium... */
66 hydrostatic(&ctl, &atm);
67
68 /* Write atmospheric data... */
69 write_atm(NULL, argv[3], &ctl, &atm, 0);
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
void hydrostatic(const ctl_t *ctl, atm_t *atm)
Adjust pressure profile using the hydrostatic equation.
Definition: jurassic.c:3903
#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
double hydz
Reference height for hydrostatic pressure profile (-999 to skip) [km].
Definition: jurassic.h:1494
Here is the call graph for this function: