AIRS Code Collection
day2doy.c
Go to the documentation of this file.
1/*
2 This file is part of the AIRS Code Collection.
3
4 the AIRS Code Collections is free software: you can redistribute it
5 and/or modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation, either version 3 of
7 the License, or (at your option) any later version.
8
9 The AIRS Code Collection is distributed in the hope that it will be
10 useful, but WITHOUT ANY WARRANTY; without even the implied warranty
11 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with the AIRS Code Collection. If not, see
16 <http://www.gnu.org/licenses/>.
17
18 Copyright (C) 2019-2025 Forschungszentrum Juelich GmbH
19*/
20
26#include "libairs.h"
27
28int main(
29 int argc,
30 char *argv[]) {
31
32 int doy;
33
34 /* Check arguments... */
35 if (argc < 4)
36 ERRMSG("Give parameters: <year> <mon> <day>");
37
38 /* Read arguments... */
39 const int year = atoi(argv[1]);
40 const int mon = atoi(argv[2]);
41 const int day = atoi(argv[3]);
42
43 /* Convert... */
44 day2doy(year, mon, day, &doy);
45 printf("%d %d\n", year, doy);
46
47 return EXIT_SUCCESS;
48}
int main(int argc, char *argv[])
Definition: day2doy.c:28
#define ERRMSG(...)
Print error message and quit program.
Definition: jurassic.h:237
void day2doy(int year, int mon, int day, int *doy)
Get day of year from date.
Definition: libairs.c:304
AIRS Code Collection library declarations.