29 {
30
31 static atm_t atm_in, atm_pts;
33
35
36
37
38
39 if (argc < 5)
40 ERRMSG(
"Give parameters: <ctl> <atm_in> <atm_pts> <atm_out>");
41
42
44
45
46 read_atm(NULL, argv[2], &ctl, &atm_in);
47 read_atm(NULL, argv[3], &ctl, &atm_pts);
48
49
50 for (
int ip = 0; ip < atm_pts.
np; ip++) {
52 &atm_pts.
p[ip], &atm_pts.
t[ip], q, k);
53 for (
int ig = 0; ig < ctl.
ng; ig++)
54 atm_pts.
q[ig][ip] = q[ig];
55 for (
int iw = 0; iw < ctl.
nw; iw++)
56 atm_pts.
k[iw][ip] = k[iw];
57 }
58
59
61
62 return EXIT_SUCCESS;
63}
void write_atm(const char *dirname, const char *filename, const ctl_t *ctl, const atm_t *atm)
Write atmospheric profile data to a text file.
void read_ctl(int argc, char *argv[], ctl_t *ctl)
Read model control parameters from command-line and configuration input.
void intpol_atm(const ctl_t *ctl, const atm_t *atm, const double z, double *p, double *t, double *q, double *k)
Interpolate atmospheric state variables at a given altitude.
void read_atm(const char *dirname, const char *filename, const ctl_t *ctl, atm_t *atm)
Read atmospheric profile data from an ASCII file.
#define ERRMSG(...)
Print an error message with contextual information and terminate the program.
#define NG
Maximum number of emitters.
#define NW
Maximum number of spectral windows.
Atmospheric profile data.
double k[NW][NP]
Extinction [km^-1].
double t[NP]
Temperature [K].
int np
Number of data points.
double z[NP]
Altitude [km].
double q[NG][NP]
Volume mixing ratio [ppv].
double p[NP]
Pressure [hPa].
int nw
Number of spectral windows.
int ng
Number of emitters.