JURASSIC
tblfmt.c
Go to the documentation of this file.
1/*
2 This file is part of JURASSIC.
3
4 JURASSIC is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8
9 JURASSIC is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with JURASSIC. If not, see <http://www.gnu.org/licenses/>.
16
17 Copyright (C) 2013-2026 Forschungszentrum Juelich GmbH
18*/
19
25#include "jurassic.h"
26
27int main(
28 int argc,
29 char *argv[]) {
30
31 ctl_t ctl;
32
33 /* Check arguments... */
34 if (argc < 6)
35 ERRMSG("Give parameters: <ctl> <tblbase_in> <tblfmt_in>"
36 " <tblbase_out> <tblfmt_out>");
37
38 /* Read control parameters... */
39 read_ctl(argc, argv, &ctl);
40
41 /* Read tables... */
42 sprintf(ctl.tblbase, "%s", argv[2]);
43 ctl.tblfmt = atoi(argv[3]);
44 tbl_t *tbl = read_tbl(&ctl);
45
46 /* Write tables... */
47 sprintf(ctl.tblbase, "%s", argv[4]);
48 ctl.tblfmt = atoi(argv[5]);
49 write_tbl(&ctl, tbl);
50
51 /* Free... */
52 tbl_free(&ctl, tbl);
53
54 return EXIT_SUCCESS;
55}
void tbl_free(const ctl_t *ctl, tbl_t *tbl)
Free lookup table and all internally allocated memory.
Definition: jurassic.c:6648
void read_ctl(int argc, char *argv[], ctl_t *ctl)
Read model control parameters from command-line and configuration input.
Definition: jurassic.c:5450
void write_tbl(const ctl_t *ctl, const tbl_t *tbl)
Write emissivity lookup tables to disk.
Definition: jurassic.c:7976
tbl_t * read_tbl(const ctl_t *ctl)
Read emissivity lookup tables from disk.
Definition: jurassic.c:6106
JURASSIC library declarations.
#define ERRMSG(...)
Print an error message with contextual information and terminate the program.
Definition: jurassic.h:1194
Control parameters.
Definition: jurassic.h:1297
char tblbase[LEN]
Basename for table files and filter function files.
Definition: jurassic.h:1348
int tblfmt
Look-up table file format (1=ASCII, 2=binary, 3=netCDF).
Definition: jurassic.h:1351
Emissivity look-up tables.
Definition: jurassic.h:1657
int main(int argc, char *argv[])
Definition: tblfmt.c:27