![]() |
libTheSky
Routines to compute sky positions of Sun, Moon, planets and more
|
Date and time procedures. More...
Functions/Subroutines | |
| subroutine | set_date_and_time (year, month, day, hour, minute, second) |
| Set global date/time variables (year, month, ..., minute, second in TheSky_local) to specified values. | |
| subroutine | get_date_and_time (year, month, day, hour, minute, second) |
| Retrieve the current global date/time variables (year, month, ..., minute, second, stored in TheSky_local) | |
| subroutine | set_date_and_time_to_system_clock (ut) |
| Set global date/time variables (year, month, ..., minute, second in TheSky_local) to system clock. | |
| subroutine | ut2lt_ymdhms (year, month, dy, hour, minute, second, tz, tz0, dsttp) |
| Convert date/time in ymdhms from UT to local time. | |
| subroutine | set_date_and_time_to_jd2000 () |
| Set global date/time variables (year, month, ..., minute, second in TheSky_local) to JD2000.0. | |
| subroutine | calctime (ut, jd, jde) |
| Compute UT, JD, JDE, DeltaT and TZ, using the date and (local) time and TZ stored in the module TheSky_local. | |
| real(double) function | calc_gmst (jd, deltat) |
| Calculate Greenwich Mean Sidereal Time for any instant, in radians. | |
| real(double) function | gmst_meeus (jd) |
| Calculate Greenwich Mean Sidereal Time for any instant, in radians, using Meeus. | |
| subroutine | localtime2jd (jd) |
| Computes JD, DeltaT and TZ, from date/time variables in module TheSky_local. | |
| real(double) function | calc_deltat (jd, force_recompute) |
| Compute DeltaT for a given JD. | |
| real(double) function | calc_deltat_ymd (y, m, d, force_recompute) |
| Compute DeltaT for given y,m,d. | |
| real(double) function | find_deltat_in_range (y, y0) |
| Find a precise value for DeltaT through linear interpolation of the two adjacent tabulated values. | |
| real(double) function | calc_deltat_approx (jd) |
| Compute DeltaT for given JD, using a simple parabolic approximation. | |
| subroutine | jd2dtm (jd, yy, mm, d, h, m, s) |
| Convert a Julian day (UT) to LOCAL date and time (h,m,s) | |
| subroutine | jd2dthm (jd, yy, mm, d, h, m) |
| Convert a Julian day (UT) to LOCAL date and time (h,m - no seconds) | |
| real(double) function | jd2ltime (jd0) |
| Convert a Julian day (UT) to a local time (LT, h) | |
| subroutine | printdate (jd, jde) |
| Prints date/time of a given Julian day (UT) to standard output. | |
| subroutine | printdate1 (jd, jde) |
| Prints date/time of a given Julian day (UT) to standard output, but without a newline. | |
| subroutine | dls (yr, jdb, jde) |
| Find the two Julian days of the beginning and the end of daylight-savings time in the EU for a given year. | |
| real(double) function | gettz (jd, tz0, dsttp) |
| Returns time zone: tz0 (standard time) or tz0+1 (daylight-savings time) | |
| subroutine | print_date_time_and_location (op, nlbef, nlaf, ut, jd, jde, locname, tzname) |
| Display a banner with date, time and location of calculation. Computes and returns UT, JD and JDE. | |
| integer function | dow (jd0) |
| Calculates day of week (0 - Sunday, ..., 6=Saturday) | |
| integer function | woy (jd) |
| Calculate the week-of-year number. | |
| subroutine | easter_gauss (year, month, day) |
| Calculate the date of Easter using Gauss' method. | |
| subroutine | passover_gauss (year, month, day) |
| Calculate the date of Passover or Pesach (Jewish Easter) using Gauss' method. | |
Date and time procedures.
| real(double) function thesky_datetime::calc_deltat | ( | real(double), intent(in) | jd, |
| logical, intent(in), optional | force_recompute ) |
Compute DeltaT for a given JD.
| jd | Julian day |
| force_recompute | Force recomputation of DeltaT, even if the year is the same as in the last call (done in calc_deltat_ymd()) |
| calc_deltat | Delta T (s) |
Definition at line 351 of file date_time.f90.
References calc_deltat(), calc_deltat_ymd(), thesky_local::day, thesky_constants::deltat_forced, thesky_local::month, and thesky_local::year.
Referenced by calc_deltat(), thesky_planets::jupiterphys(), thesky_moon::moonpos_la(), thesky_planets::planet_position(), thesky_planets::planetelements(), and thesky_sun::sunpos_la().

| real(double) function thesky_datetime::calc_deltat_approx | ( | real(double), intent(in) | jd | ) |
Compute DeltaT for given JD, using a simple parabolic approximation.
| jd | Julian day for computation |
| deltat | The value for DeltaT (= TDT-UT) in seconds. |
Definition at line 520 of file date_time.f90.
References calc_deltat_approx(), and thesky_constants::jd1820.
Referenced by calc_deltat_approx().

| real(double) function thesky_datetime::calc_deltat_ymd | ( | integer, intent(in) | y, |
| integer, intent(in) | m, | ||
| real(double), intent(in) | d, | ||
| logical, intent(in), optional | force_recompute ) |
Compute DeltaT for given y,m,d.
| y | Year |
| m | Month |
| d | Day |
| force_recompute | Force recomputation of DeltaT, even if the year is the same as in the last call |
| calc_deltat_ymd | Delta T (s) |
Definition at line 407 of file date_time.f90.
References calc_deltat_ymd(), thesky_constants::deltat_0, thesky_constants::deltat_accel, thesky_constants::deltat_change, thesky_constants::deltat_forced, thesky_constants::deltat_maxyr, thesky_constants::deltat_minyr, thesky_constants::deltat_values, thesky_constants::deltat_years, and find_deltat_in_range().
Referenced by calc_deltat(), calc_deltat_ymd(), calctime(), and localtime2jd().

| real(double) function thesky_datetime::calc_gmst | ( | real(double), intent(in) | jd, |
| real(double), intent(in), optional | deltat ) |
Calculate Greenwich Mean Sidereal Time for any instant, in radians.
| jd | Julian day of computation |
| DeltaT | ΔT (s) (optional - default: use DelTaT from TheSky_local) |
| calc_gmst | Greenwich Mean Sidereal Time (radians) |
Definition at line 252 of file date_time.f90.
References calc_gmst(), and thesky_local::deltat.
Referenced by calc_gmst(), thesky_visibility::limmag_zenith_jd(), thesky_moon::moonpos_la(), thesky_planets::planet_position(), print_date_time_and_location(), and thesky_sun::sunpos_la().

| subroutine thesky_datetime::calctime | ( | real(double), intent(out) | ut, |
| real(double), intent(out) | jd, | ||
| real(double), intent(out) | jde ) |
Compute UT, JD, JDE, DeltaT and TZ, using the date and (local) time and TZ stored in the module TheSky_local.
| ut | Universal time (output) |
| jd | Julian date (output) |
| jde | Julian date (output) |
Definition at line 212 of file date_time.f90.
References calc_deltat_ymd(), thesky_local::day, thesky_local::deltat, gettz(), thesky_local::hour, thesky_local::minute, thesky_local::month, thesky_local::second, thesky_local::tz, and thesky_local::year.
Referenced by print_date_time_and_location().

| subroutine thesky_datetime::dls | ( | integer, intent(in) | yr, |
| real(double), intent(out) | jdb, | ||
| real(double), intent(out) | jde ) |
Find the two Julian days of the beginning and the end of daylight-savings time in the EU for a given year.
| yr | Year (CE) |
| jdb | Julian day of beginning of DST (output) |
| jde | Julian day of end of DST (output) |
Definition at line 777 of file date_time.f90.
References dow().

| integer function thesky_datetime::dow | ( | real(double), intent(in) | jd0 | ) |
Calculates day of week (0 - Sunday, ..., 6=Saturday)
| jd0 | Julian day (UT) |
| dow | The day of week (0=Sunday, ..., 6=Saturday) |
Definition at line 1006 of file date_time.f90.
References dow(), and thesky_local::tz.
Referenced by dls(), dow(), gettz(), print_date_time_and_location(), and woy().

| subroutine thesky_datetime::easter_gauss | ( | integer, intent(in) | year, |
| integer, intent(out) | month, | ||
| integer, intent(out) | day ) |
Calculate the date of Easter using Gauss' method.
| year | Julian/Gregorian year to compute date of Easter for. |
| month | Julian/Gregorian month of year of Easter Sunday. |
| day | Julian/Gregorian day of month of Easter Sunday. |
Definition at line 1062 of file date_time.f90.
| real(double) function thesky_datetime::find_deltat_in_range | ( | integer, intent(in) | y, |
| real(double), intent(in) | y0 ) |
Find a precise value for DeltaT through linear interpolation of the two adjacent tabulated values.
| y | Current year |
| y0 | Current date, as fractional year |
| find_deltat_in_range | Delta T (s) |
Definition at line 485 of file date_time.f90.
References thesky_constants::deltat_n, thesky_constants::deltat_values, thesky_constants::deltat_years, and find_deltat_in_range().
Referenced by calc_deltat_ymd(), and find_deltat_in_range().

| subroutine thesky_datetime::get_date_and_time | ( | integer, intent(out) | year, |
| integer, intent(out) | month, | ||
| integer, intent(out) | day, | ||
| integer, intent(out) | hour, | ||
| integer, intent(out) | minute, | ||
| real(double), intent(out) | second ) |
Retrieve the current global date/time variables (year, month, ..., minute, second, stored in TheSky_local)
| year | Year (output) |
| month | Month (output) |
| day | Day (output) |
| hour | Hour (output) |
| minute | Minute (output) |
| second | Second (output) |
Definition at line 97 of file date_time.f90.
References thesky_local::day, thesky_local::hour, thesky_local::minute, thesky_local::month, thesky_local::second, and thesky_local::year.
| real(double) function thesky_datetime::gettz | ( | real(double), intent(in) | jd, |
| real(double), intent(in), optional | tz0, | ||
| integer, intent(in), optional | dsttp ) |
Returns time zone: tz0 (standard time) or tz0+1 (daylight-savings time)
| jd | Julian day (UT?) |
| tz0 | Default time zone for the current location ('winter time') |
| dsttp | Daylight-savings time rules to use: 0: no DST (e.g. UT), 1: EU, 2: USA/Canada |
| gettz | The time zone (h; positive east of Greenwich) |
Definition at line 820 of file date_time.f90.
References dow(), thesky_local::dsttp, gettz(), thesky_local::tz, and thesky_local::tz0.
Referenced by thesky_riset::best_obs_date(), thesky_visibility::best_planet_xsmag(), calctime(), gettz(), localtime2jd(), print_date_time_and_location(), and ut2lt_ymdhms().

| real(double) function thesky_datetime::gmst_meeus | ( | real(double), intent(in) | jd | ) |
Calculate Greenwich Mean Sidereal Time for any instant, in radians, using Meeus.
| jd | Julian day of computation |
| gmst_meeus | Greenwich Mean Sidereal Time in radians |
Definition at line 287 of file date_time.f90.
References gmst_meeus().
Referenced by gmst_meeus().

| subroutine thesky_datetime::jd2dthm | ( | real(double), intent(in) | jd, |
| integer, intent(out) | yy, | ||
| integer, intent(out) | mm, | ||
| integer, intent(out) | d, | ||
| integer, intent(out) | h, | ||
| integer, intent(out) | m ) |
Convert a Julian day (UT) to LOCAL date and time (h,m - no seconds)
| jd | Julian day (UT) |
| yy | Year (CE, LT) (output) |
| mm | Month (LT) (output) |
| d | Day (LT) (output) |
| h | Hour (LT) (output) |
| m | Minute (LT) (output) |
Definition at line 616 of file date_time.f90.
References thesky_local::tz.
| subroutine thesky_datetime::jd2dtm | ( | real(double), intent(in) | jd, |
| integer, intent(out) | yy, | ||
| integer, intent(out) | mm, | ||
| integer, intent(out) | d, | ||
| integer, intent(out) | h, | ||
| integer, intent(out) | m, | ||
| real(double), intent(out) | s ) |
Convert a Julian day (UT) to LOCAL date and time (h,m,s)
| jd | Julian day (UT) |
| yy | Year (CE, LT) (output) |
| mm | Month (LT) (output) |
| d | Day (LT) (output) |
| h | Hour (LT) (output) |
| m | Minute (LT) (output) |
| s | Second (+ fraction, LT) (output) |
Definition at line 547 of file date_time.f90.
References thesky_local::tz.
| real(double) function thesky_datetime::jd2ltime | ( | real(double), intent(in) | jd0 | ) |
Convert a Julian day (UT) to a local time (LT, h)
| jd0 | Julian day (UT) |
| jd2ltime | Local time (h) |
Definition at line 674 of file date_time.f90.
References jd2ltime(), and thesky_local::tz.
Referenced by jd2ltime().

| subroutine thesky_datetime::localtime2jd | ( | real(double), intent(out) | jd | ) |
Computes JD, DeltaT and TZ, from date/time variables in module TheSky_local.
| JD | Julian date (output) |
Definition at line 317 of file date_time.f90.
References calc_deltat_ymd(), thesky_local::day, thesky_local::deltat, gettz(), thesky_local::hour, thesky_local::minute, thesky_local::month, thesky_local::second, thesky_local::tz, and thesky_local::year.

| subroutine thesky_datetime::passover_gauss | ( | integer, intent(in) | year, |
| integer, intent(out) | month, | ||
| integer, intent(out) | day ) |
Calculate the date of Passover or Pesach (Jewish Easter) using Gauss' method.
| year | Julian/Gregorian year to compute date of Passover for. |
| month | Julian/Gregorian month of year of the DAY of Passover. |
| day | Julian/Gregorian day of month of the DAY of Passover. |
Definition at line 1124 of file date_time.f90.
| subroutine thesky_datetime::print_date_time_and_location | ( | integer, intent(in), optional | op, |
| integer, intent(in), optional | nlbef, | ||
| integer, intent(in), optional | nlaf, | ||
| real(double), intent(out), optional | ut, | ||
| real(double), intent(out), optional | jd, | ||
| real(double), intent(out), optional | jde, | ||
| character, dimension(*), intent(in), optional | locname, | ||
| character, dimension(*), intent(in), optional | tzname ) |
Display a banner with date, time and location of calculation. Computes and returns UT, JD and JDE.
| op | Output unit (optional, default 6) |
| nlbef | Number of newlines before output (optional, default 0) |
| nlaf | Number of newlines after output (optional, default 0) |
| ut | UT: Universal Time (optional) |
| jd | JD: Julian day (optional) |
| jde | JDE: Apparent Julian day (optional) |
| locname | Location name (optional) |
| tzname | Time-zone name (optional) |
Definition at line 932 of file date_time.f90.
References calc_gmst(), calctime(), thesky_local::day, thesky_local::deltat, dow(), gettz(), thesky_local::height, thesky_local::hour, thesky_local::lat0, thesky_local::lon0, thesky_local::minute, thesky_local::month, thesky_local::second, thesky_local::tz, and thesky_local::year.

| subroutine thesky_datetime::printdate | ( | real(double), intent(in) | jd, |
| real(double), intent(in), optional | jde ) |
Prints date/time of a given Julian day (UT) to standard output.
| jd | Julian day (UT) |
| jde | Julian day ephemeris time (dynamical time) |
Definition at line 706 of file date_time.f90.
References printdate1().

| subroutine thesky_datetime::printdate1 | ( | real(double), intent(in) | jd, |
| real(double), intent(in), optional | jde ) |
Prints date/time of a given Julian day (UT) to standard output, but without a newline.
| jd | Julian day (UT) |
| jde | Julian day ephemeris time (dynamical time) |
Definition at line 728 of file date_time.f90.
Referenced by thesky_moonroutines::moon_phase_next(), and printdate().
| subroutine thesky_datetime::set_date_and_time | ( | integer, intent(in) | year, |
| integer, intent(in) | month, | ||
| integer, intent(in) | day, | ||
| integer, intent(in) | hour, | ||
| integer, intent(in) | minute, | ||
| real(double), intent(in) | second ) |
Set global date/time variables (year, month, ..., minute, second in TheSky_local) to specified values.
| year | Year |
| month | Month |
| day | Day |
| hour | Hour |
| minute | Minute |
| second | Second |
Definition at line 66 of file date_time.f90.
References thesky_local::day, thesky_local::hour, thesky_local::minute, thesky_local::month, thesky_local::second, and thesky_local::year.
Referenced by set_date_and_time_to_jd2000().
| subroutine thesky_datetime::set_date_and_time_to_jd2000 |
Set global date/time variables (year, month, ..., minute, second in TheSky_local) to JD2000.0.
Definition at line 188 of file date_time.f90.
References set_date_and_time().

| subroutine thesky_datetime::set_date_and_time_to_system_clock | ( | logical, intent(in), optional | ut | ) |
Set global date/time variables (year, month, ..., minute, second in TheSky_local) to system clock.
| ut | Return UT instead of local system time (optional). |
Definition at line 123 of file date_time.f90.
References thesky_local::day, thesky_local::hour, thesky_local::minute, thesky_local::month, thesky_local::second, thesky_local::tz, and thesky_local::year.
| subroutine thesky_datetime::ut2lt_ymdhms | ( | integer, intent(inout) | year, |
| integer, intent(inout) | month, | ||
| integer, intent(inout) | dy, | ||
| integer, intent(inout) | hour, | ||
| integer, intent(inout) | minute, | ||
| real(double), intent(inout) | second, | ||
| real(double), intent(out) | tz, | ||
| real(double), intent(in) | tz0, | ||
| integer, intent(in) | dsttp ) |
Convert date/time in ymdhms from UT to local time.
| year | Year CE: input: UT, output: LT (I/O) |
| month | Month of year: input: UT, output: LT (I/O) |
| dy | Day of month: input: UT, output: LT (I/O) |
| hour | Hour of day: input: UT, output: LT (I/O) |
| minute | Minute of time: input: UT, output: LT (I/O) |
| second | Second of time: input: UT, output: LT (I/O) |
| tz | Timezone of date (output) |
| tz0 | Default timezone for date/time |
| dsttp | Timezone type for date/time |
Definition at line 162 of file date_time.f90.
References gettz().

| integer function thesky_datetime::woy | ( | real(double), intent(in) | jd | ) |
Calculate the week-of-year number.
| jd | Julian day |
| woy | Week number in the year |
Definition at line 1033 of file date_time.f90.
Referenced by woy().
