JURASSIC
Functions
interpolate.c File Reference

Interpolate atmospheric data to another spatial grid. More...

#include "jurassic.h"

Go to the source code of this file.

Functions

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

Detailed Description

Interpolate atmospheric data to another spatial grid.

Definition in file interpolate.c.

Function Documentation

◆ main()

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

Definition at line 27 of file interpolate.c.

29 {
30
31 static atm_t atm_in, atm_pts;
32 static ctl_t ctl;
33
34 double k[NW], q[NG];
35
36 /* Interpolate atmospheric data... */
37
38 /* Check arguments... */
39 if (argc < 5)
40 ERRMSG("Give parameters: <ctl> <atm_in> <atm_pts> <atm_out>");
41
42 /* Read control parameters... */
43 read_ctl(argc, argv, &ctl);
44
45 /* Read atmospheric data... */
46 read_atm(NULL, argv[2], &ctl, &atm_in);
47 read_atm(NULL, argv[3], &ctl, &atm_pts);
48
49 /* Interpolate atmospheric data... */
50 for (int ip = 0; ip < atm_pts.np; ip++) {
51 intpol_atm(&ctl, &atm_in, atm_pts.z[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 /* Save interpolated data... */
60 write_atm(NULL, argv[4], &ctl, &atm_pts);
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 data.
Definition: jurassic.c:5339
void read_ctl(int argc, char *argv[], ctl_t *ctl)
Read forward model control parameters.
Definition: jurassic.c:4550
void intpol_atm(const ctl_t *ctl, const atm_t *atm, const double z, double *p, double *t, double *q, double *k)
Interpolate atmospheric data.
Definition: jurassic.c:3685
void read_atm(const char *dirname, const char *filename, const ctl_t *ctl, atm_t *atm)
Read atmospheric data.
Definition: jurassic.c:4445
#define ERRMSG(...)
Print error message and quit program.
Definition: jurassic.h:237
#define NG
Maximum number of emitters.
Definition: jurassic.h:358
#define NW
Maximum number of spectral windows.
Definition: jurassic.h:378
Atmospheric data.
Definition: jurassic.h:488
double k[NW][NP]
Extinction [km^-1].
Definition: jurassic.h:515
double t[NP]
Temperature [K].
Definition: jurassic.h:509
int np
Number of data points.
Definition: jurassic.h:491
double z[NP]
Altitude [km].
Definition: jurassic.h:497
double q[NG][NP]
Volume mixing ratio [ppv].
Definition: jurassic.h:512
double p[NP]
Pressure [hPa].
Definition: jurassic.h:506
Forward model control parameters.
Definition: jurassic.h:541
int nw
Number of spectral windows.
Definition: jurassic.h:556
int ng
Number of emitters.
Definition: jurassic.h:544
Here is the call graph for this function: