Perform kernel calculations in a single directory.
101 {
102
105
106
107 read_obs(wrkdir, obsfile, ctl, &obs);
108
109
110 read_atm(wrkdir, atmfile, ctl, &atm);
111
112
113 const size_t n =
atm2x(ctl, &atm, NULL, NULL, NULL);
114 const size_t m =
obs2y(ctl, &obs, NULL, NULL, NULL);
115
116
117 if (n == 0)
118 ERRMSG(
"No state vector elements!");
119 if (m == 0)
120 ERRMSG(
"No measurement vector elements!");
121
122
123 gsl_matrix *k = gsl_matrix_alloc(m, n);
124
125
126 kernel(ctl, &atm, &obs, k);
127
128
129 write_matrix(wrkdir, kernelfile, ctl, k, &atm, &obs,
"y",
"x",
"r");
130
131
132 gsl_matrix_free(k);
133}
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.
Observation geometry and radiance data.