JURASSIC
Functions
kernel.c File Reference

Calculate kernel functions. More...

#include "jurassic.h"

Go to the source code of this file.

Functions

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

Detailed Description

Calculate kernel functions.

Definition in file kernel.c.

Function Documentation

◆ main()

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

Definition at line 27 of file kernel.c.

29 {
30
31 static atm_t atm;
32 static ctl_t ctl;
33 static obs_t obs;
34
35 /* Check arguments... */
36 if (argc < 5)
37 ERRMSG("Give parameters: <ctl> <obs> <atm> <kernel>");
38
39 /* Read control parameters... */
40 read_ctl(argc, argv, &ctl);
41
42 /* Set flags... */
43 ctl.write_matrix = 1;
44
45 /* Read observation geometry... */
46 read_obs(NULL, argv[2], &ctl, &obs);
47
48 /* Read atmospheric data... */
49 read_atm(NULL, argv[3], &ctl, &atm);
50
51 /* Get sizes... */
52 const size_t n = atm2x(&ctl, &atm, NULL, NULL, NULL);
53 const size_t m = obs2y(&ctl, &obs, NULL, NULL, NULL);
54
55 /* Check sizes... */
56 if (n == 0)
57 ERRMSG("No state vector elements!");
58 if (m == 0)
59 ERRMSG("No measurement vector elements!");
60
61 /* Allocate... */
62 gsl_matrix *k = gsl_matrix_alloc(m, n);
63
64 /* Compute kernel matrix... */
65 kernel(&ctl, &atm, &obs, k);
66
67 /* Write matrix to file... */
68 write_matrix(NULL, argv[4], &ctl, k, &atm, &obs, "y", "x", "r");
69
70 /* Free... */
71 gsl_matrix_free(k);
72
73 return EXIT_SUCCESS;
74}
void read_ctl(int argc, char *argv[], ctl_t *ctl)
Read forward model control parameters.
Definition: jurassic.c:4547
void read_atm(const char *dirname, const char *filename, const ctl_t *ctl, atm_t *atm)
Read atmospheric data.
Definition: jurassic.c:4442
void read_obs(const char *dirname, const char *filename, const ctl_t *ctl, obs_t *obs)
Read observation data.
Definition: jurassic.c:4697
size_t obs2y(const ctl_t *ctl, const obs_t *obs, gsl_vector *y, int *ida, int *ira)
Compose measurement vector.
Definition: jurassic.c:4174
size_t atm2x(const ctl_t *ctl, const atm_t *atm, gsl_vector *x, int *iqa, int *ipa)
Compose state vector or parameter vector.
Definition: jurassic.c:29
void write_matrix(const char *dirname, const char *filename, const ctl_t *ctl, const gsl_matrix *matrix, const atm_t *atm, const obs_t *obs, const char *rowspace, const char *colspace, const char *sort)
Write matrix.
Definition: jurassic.c:5492
void kernel(ctl_t *ctl, atm_t *atm, obs_t *obs, gsl_matrix *k)
Compute Jacobians.
Definition: jurassic.c:4004
#define ERRMSG(...)
Print error message and quit program.
Definition: jurassic.h:237
Atmospheric data.
Definition: jurassic.h:488
Forward model control parameters.
Definition: jurassic.h:541
int write_matrix
Write matrix file (0=no, 1=yes).
Definition: jurassic.h:661
Observation geometry and radiance data.
Definition: jurassic.h:734
Here is the call graph for this function: