![]() |
ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation. |
Generate and return the ordinal day, also knowns as Day of Year (DOY), i.e., the number of days since the beginning of the input year
until and including the input Gregorian Calendar date [year, month, day]
.
More...
Generate and return the ordinal day, also knowns as Day of Year (DOY), i.e., the number of days since the beginning of the input year
until and including the input Gregorian Calendar date [year, month, day]
.
The day of year is important for forming ISO Ordinal Dates. An Ordinal Date is a simple form for occasions when the arbitrary nature of week and month definitions are more of an impediment than an aid, for instance, when comparing dates from different calendars. The ordinal date is comprised of the year [YYYY]
and the day of that year [DDD]
, from 001
through 365
(366
in leap years). For example, 1981-04-05
corresponds to the ordinal date 1981-095
.
This format is used with simple hardware systems that have a need for a date system, but where including full calendar calculation software may be a significant nuisance. This system is sometimes referred to as Julian Date, but this can cause confusion with the astronomical Julian day, a sequential count of the number of days since day 0 beginning 1 January 4713 BC Greenwich noon, Julian proleptic calendar (or noon on ISO date −4713-11-24
which uses the Gregorian proleptic calendar with a year 0000
).
Returning the correct result requires taking into account the possibility of leap years.
[in] | values | : The input contiguous array of shape (:) , of size 3 or larger, of type integer of default kind IK, containing the [year, month, day] triple of the Gregorian calendar.For the current local date, this triple can be obtained from the Fortran intrinsic date_and_time() or getDateTime().Only the first three elements ( values(1:3) ) are used to compute the output.The ability to pass longer vectors as input is to allow the output values(1:8) of various functionalities of this module to be passed directly to the procedures under this generic interface.(optional. It can be present if and only if all other input arguments are missing.) |
[in] | year | : The input scalar, or array of the same shape as other array-like arguments, of type integer of default kind IK, containing the year of the Gregorian calendar.(optional. It can be present if and only if the input argument values is missing.) |
[in] | month | : The input scalar, or array of the same shape as other array-like arguments, of type integer of default kind IK, containing the month of the Gregorian calendar.(optional. It must be present if and only if the input argument year is present.) |
[in] | day | : The input scalar, or array of the same shape as other array-like arguments, of type integer of default kind IK, containing the day of the Gregorian calendar.(optional. It must be present if and only if the input argument month is present.) |
ordinalDay
: The output scalar of type integer
of default kind IK, containing the ordinal day of the specified Gregorian Calendar date.
Possible calling interfaces ⛓
values(:)
must be at least 3
and at most 8
.year
, month
, and day
must be valid values.month
must be a number between 1
and 12
.day
must be a number between 1
and 31
.CHECK_ENABLED=1
.pure
procedure(s) documented herein become impure
when the ParaMonte library is compiled with preprocessor macro CHECK_ENABLED=1
.pure
in release
build and impure
in debug
and testing
builds. The procedures under this generic interface are always impure
when all input arguments are missing.elemental
. The procedures under this generic interface are non-elemental when all input arguments are missing or only the input argument values(:)
is present.
Example usage ⛓
ifort
compiler ⛓ ifort
compiler ⛓ gfortran
compiler ⛓
Final Remarks ⛓
If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.
This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.
Definition at line 3223 of file pm_dateTime.F90.