/* co_seasons.f -- translated by f2c (version 20100827).
   You must link the resulting object file with libf2c:
	on Microsoft Windows system, link with libf2c.lib;
	on Linux or Unix systems, link with .../path/to/libf2c.a -lm
	or, if you install libf2c.a in a standard place, with -lf2c -lm
	-- in that order, at the end of the command line, as in
		cc *.o -lf2c -lm
	Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,

		http://www.netlib.org/f2c/libf2c.zip
*/

#include "f2c.h"

/* Table of constant values */

static integer c__1 = 1;
static integer c__3 = 3;

/* Main program */ int MAIN__(void)
{
    /* Format strings */
    static char fmt_100[] = "(10a)";
    static char fmt_200[] = "(9x,4a)";
    static char fmt_300[] = "(i4,1x,i1,4(7x,i2.2,1x,a5))";

    /* System generated locals */
    integer i__1;

    /* Builtin functions */
    integer s_wsfe(cilist *), e_wsfe(void), do_fio(integer *, char *, ftnlen),
	     s_rsle(cilist *), do_lio(integer *, integer *, char *, ftnlen), 
	    e_rsle(void), s_wsle(cilist *), e_wsle(void);
    /* Subroutine */ int s_stop(char *, ftnlen);

    /* Local variables */
    static integer i__;
    extern /* Subroutine */ int cp_seasons__(integer *, integer *, integer *, 
	    integer *, integer *, char *, char *, char *, char *, ftnlen, 
	    ftnlen, ftnlen, ftnlen);
    static integer ily;
    extern /* Subroutine */ int cp_leap_year__(integer *, integer *);
    static integer iyear, year_1__, year_2__, id_feq__;
    static char ct_feq__[5];
    static integer id_seq__;
    static char ct_seq__[5];
    static integer id_sso__, id_wso__;
    static char ct_sso__[5], ct_wso__[5];

    /* Fortran I/O blocks */
    static cilist io___1 = { 0, 6, 0, fmt_100, 0 };
    static cilist io___2 = { 0, 6, 0, fmt_100, 0 };
    static cilist io___3 = { 0, 6, 0, fmt_100, 0 };
    static cilist io___4 = { 0, 6, 0, fmt_100, 0 };
    static cilist io___5 = { 0, 6, 0, fmt_100, 0 };
    static cilist io___6 = { 0, 6, 0, fmt_100, 0 };
    static cilist io___7 = { 0, 5, 0, 0, 0 };
    static cilist io___10 = { 0, 6, 0, 0, 0 };
    static cilist io___11 = { 0, 6, 0, 0, 0 };
    static cilist io___12 = { 0, 6, 0, 0, 0 };
    static cilist io___13 = { 0, 6, 0, fmt_100, 0 };
    static cilist io___15 = { 0, 6, 0, fmt_200, 0 };
    static cilist io___16 = { 0, 6, 0, fmt_100, 0 };
    static cilist io___17 = { 0, 6, 0, fmt_100, 0 };
    static cilist io___28 = { 0, 6, 0, fmt_300, 0 };
    static cilist io___29 = { 0, 6, 0, fmt_100, 0 };
    static cilist io___30 = { 0, 6, 0, fmt_100, 0 };
    static cilist io___31 = { 0, 6, 0, fmt_100, 0 };



/*     ***************************************************************0** */
/* *   Compute_Seasons: computation of Solstices & equinox */
/* *                    for a list of years */
/*     P. Robert, Jan. 2018 */
/*     ***************************************************************0** */


    s_wsfe(&io___1);
    e_wsfe();
    s_wsfe(&io___2);
    do_fio(&c__1, "************************************************", (ftnlen)
	    48);
    e_wsfe();
    s_wsfe(&io___3);
    do_fio(&c__1, "co_seasons: computation of Solstices & equinoxes", (ftnlen)
	    48);
    e_wsfe();
    s_wsfe(&io___4);
    do_fio(&c__1, "************************************************", (ftnlen)
	    48);
    e_wsfe();
    s_wsfe(&io___5);
    e_wsfe();

/*     id_sso,id_wso : June and december day of summer and */
/*                     winter solstice. */
/*     id_seq,id_feq : same for march and september spring */
/*                     and fall equinoxes. */
/*     ct_sso,ct_wso : June and december time of summer and */
/*                     winter solstice. */
/*     ct_seq,ct_feq : same for march and september spring */
/*                     and fall equinoxes; Cha*5 (hh:mm) */


    s_wsfe(&io___6);
    do_fio(&c__1, "year_1, year_2 ? ex: 1990 2020", (ftnlen)30);
    e_wsfe();
    s_rsle(&io___7);
    do_lio(&c__3, &c__1, (char *)&year_1__, (ftnlen)sizeof(integer));
    do_lio(&c__3, &c__1, (char *)&year_2__, (ftnlen)sizeof(integer));
    e_rsle();
    s_wsle(&io___10);
    do_lio(&c__3, &c__1, (char *)&year_1__, (ftnlen)sizeof(integer));
    do_lio(&c__3, &c__1, (char *)&year_2__, (ftnlen)sizeof(integer));
    e_wsle();
    s_wsle(&io___11);
    e_wsle();
    s_wsle(&io___12);
    e_wsle();
    s_wsfe(&io___13);
    for (i__ = 1; i__ <= 10; ++i__) {
	do_fio(&c__1, "=======", (ftnlen)7);
    }
    e_wsfe();
    s_wsfe(&io___15);
    do_fio(&c__1, "June solstice  ", (ftnlen)15);
    do_fio(&c__1, "dec. solstice  ", (ftnlen)15);
    do_fio(&c__1, "march equinoxe ", (ftnlen)15);
    do_fio(&c__1, "  sept. equinoxe", (ftnlen)16);
    e_wsfe();
    s_wsfe(&io___16);
    do_fio(&c__1, "Year LY", (ftnlen)7);
    for (i__ = 1; i__ <= 4; ++i__) {
	do_fio(&c__1, "      DD hh:mm ", (ftnlen)15);
    }
    e_wsfe();
    s_wsfe(&io___17);
    for (i__ = 1; i__ <= 10; ++i__) {
	do_fio(&c__1, "=======", (ftnlen)7);
    }
    e_wsfe();
    i__1 = year_2__;
    for (iyear = year_1__; iyear <= i__1; ++iyear) {
	cp_leap_year__(&iyear, &ily);
	cp_seasons__(&iyear, &id_sso__, &id_wso__, &id_seq__, &id_feq__, 
		ct_sso__, ct_wso__, ct_seq__, ct_feq__, (ftnlen)5, (ftnlen)5, 
		(ftnlen)5, (ftnlen)5);

	s_wsfe(&io___28);
	do_fio(&c__1, (char *)&iyear, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)&ily, (ftnlen)sizeof(integer));
	do_fio(&c__1, (char *)&id_sso__, (ftnlen)sizeof(integer));
	do_fio(&c__1, ct_sso__, (ftnlen)5);
	do_fio(&c__1, (char *)&id_wso__, (ftnlen)sizeof(integer));
	do_fio(&c__1, ct_wso__, (ftnlen)5);
	do_fio(&c__1, (char *)&id_seq__, (ftnlen)sizeof(integer));
	do_fio(&c__1, ct_seq__, (ftnlen)5);
	do_fio(&c__1, (char *)&id_feq__, (ftnlen)sizeof(integer));
	do_fio(&c__1, ct_feq__, (ftnlen)5);
	e_wsfe();
	if (ily == 1) {
	    s_wsfe(&io___29);
	    for (i__ = 1; i__ <= 10; ++i__) {
		do_fio(&c__1, "-------", (ftnlen)7);
	    }
	    e_wsfe();
	}
    }

    s_wsfe(&io___30);
    e_wsfe();
    s_wsfe(&io___31);
    e_wsfe();
    s_stop("co_seasons: normal termination", (ftnlen)30);
    return 0;
} /* MAIN__ */

/* Main program alias */ int co_seasons__ () { MAIN__ (); return 0; }
