29 {
30
34
35
36 if (argc < 5)
37 ERRMSG(
"Give parameters: <ctl> <obs> <atm> <kernel>");
38
39
41
42
44
45
47
48
50
51
52 const size_t n =
atm2x(&ctl, &atm, NULL, NULL, NULL);
53 const size_t m =
obs2y(&ctl, &obs, NULL, NULL, NULL);
54
55
56 if (n == 0)
57 ERRMSG(
"No state vector elements!");
58 if (m == 0)
59 ERRMSG(
"No measurement vector elements!");
60
61
62 gsl_matrix *k = gsl_matrix_alloc(m, n);
63
64
65 kernel(&ctl, &atm, &obs, k);
66
67
68 write_matrix(NULL, argv[4], &ctl, k, &atm, &obs,
"y",
"x",
"r");
69
70
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.
void read_atm(const char *dirname, const char *filename, const ctl_t *ctl, atm_t *atm)
Read atmospheric data.
void read_obs(const char *dirname, const char *filename, const ctl_t *ctl, obs_t *obs)
Read observation data.
size_t obs2y(const ctl_t *ctl, const obs_t *obs, gsl_vector *y, int *ida, int *ira)
Compose measurement vector.
size_t atm2x(const ctl_t *ctl, const atm_t *atm, gsl_vector *x, int *iqa, int *ipa)
Compose state vector or parameter vector.
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.
void kernel(ctl_t *ctl, atm_t *atm, obs_t *obs, gsl_matrix *k)
Compute Jacobians.
#define ERRMSG(...)
Print error message and quit program.
Forward model control parameters.
int write_matrix
Write matrix file (0=no, 1=yes).
Observation geometry and radiance data.