AIRS Code Collection
doy2day.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 day, mon;
33
34 /* Check arguments... */
35 if (argc < 3)
36 ERRMSG("Give parameters: <year> <doy>");
37
38 /* Read arguments... */
39 const int year = atoi(argv[1]);
40 const int doy = atoi(argv[2]);
41
42 /* Convert... */
43 doy2day(year, doy, &mon, &day);
44 printf("%d %d %d\n", year, mon, day);
45
46 return EXIT_SUCCESS;
47}
int main(int argc, char *argv[])
Definition: doy2day.c:28
#define ERRMSG(...)
Print error message and quit program.
Definition: jurassic.h:237
void doy2day(int year, int doy, int *mon, int *day)
Get date from day of year.
Definition: libairs.c:324
AIRS Code Collection library declarations.