Generate and return .true.
if the hour in the current or the input time zone (-720 : +840)
is Ante Meridiem (before noon).
- Parameters
-
[in] | zone | : The input scalar or array of arbitrary shape of type integer of default kind IK containing the time zone of interest in units of minutes.
(optional, default = the current local time zone.) |
[in] | julianDay | : The input scalar or array of arbitrary shape of type real of default kind RK containing the (possibly proleptic) Julian Day.
(optional, default = the current locale Julian Day.) |
- Returns
isMorning
: The output scalar or array of the same rank as input array-like arguments, of type logical
of default kind LK. It is .true.
if and only if the current time or the time corresponding to the input zone
or julianDay
or both represents represents morning.
Possible calling interfaces ⛓
real(RK) :: julianDay
logical(LK) :: morning
integer(IK) :: zone
!
Generate and return .true. if the hour in the current or the input time zone (-720 : +840) is Ante Me...
This module contains classes and procedures for computing, manipulating, and styling dates and times.
- Warning
- The
pure
procedure(s) documented herein become impure
when the ParaMonte library is compiled with preprocessor macro CHECK_ENABLED=1
.
By default, these procedures are pure
in release
build and impure
in debug
and testing
builds. The procedures under this generic interface are always impure
when there is no input argument.
-
The conditions
-12 * 60 < zone
and zone < +14 * 60
must hold for the corresponding input arguments.
This condition is verified only if the library is built with the preprocessor macro CHECK_ENABLED=1
.
- See also
- getMillisecond
getSecond
getMinute
getHour12
getHour
getZone
getZoneAbbr
getDay
getMonth
getYear
isLeapYear
Example usage ⛓
10 type(display_type) :: disp
16 call disp%show(
"isMorning() ! is it morning at local time?")
21 call disp%show(
"isMorning(0) ! is it morning at UTC?")
26 call disp%show(
"isMorning(60 * [-12, 3, 14]) ! is it morning in the specified timezones with respect to UTC?")
31 call disp%show(
"isMorning(-0.5_RK) ! November 24, -4713, start of the day (just after midnight)")
36 call disp%show(
"isMorning(-0.3_RK) ! November 24, -4713, start of the day (after midnight, before noon)")
41 call disp%show(
"isMorning(0._RK) ! November 24, -4713, noon (start of JD in Gregorian Calendar)")
46 call disp%show(
"isMorning(0.5_RK) ! November 25, -4713, start of the day (just after midnight)")
51 call disp%show(
"isMorning(0.5_RK, zone = -6 * 60) ! November 25, -4713, start of the UTC day (just after midnight) but at timezone -6 (Texas) where it is still afternoon")
56 call disp%show(
"isMorning([2440587.5_RK, 2440587.9_RK, 2444239.49999_RK]) ! morning immediately after midnight, morning before noon, afternoon right before midnight")
61 call disp%show(
"isMorning([2440587.5_RK, 2440587.9_RK, 2444239.49999_RK], zone = 60 * [-1, +14, -12]) ! afternoon near midnight, afternoon the day before UTC, morning right before none at time zone -720")
62 call disp%show(
isMorning([
2440587.5_RK,
2440587.9_RK,
2444239.49999_RK], zone
= 60 * [
-1,
+14,
-12]) )
Generate and return the current or the requested date and time as an integer-valued array of size 8 o...
This is a generic method of the derived type display_type with pass attribute.
This is a generic method of the derived type display_type with pass attribute.
This module contains classes and procedures for input/output (IO) or generic display operations on st...
type(display_type) disp
This is a scalar module variable an object of type display_type for general display.
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
integer, parameter RK
The default real kind in the ParaMonte library: real64 in Fortran, c_double in C-Fortran Interoperati...
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
integer, parameter SK
The default character kind in the ParaMonte library: kind("a") in Fortran, c_char in C-Fortran Intero...
Generate and return an object of type display_type.
Example Unix compile command via Intel ifort
compiler ⛓
3ifort -fpp -standard-semantics -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
Example Windows Batch compile command via Intel ifort
compiler ⛓
2set PATH=..\..\..\lib;%PATH%
3ifort /fpp /standard-semantics /O3 /I:..\..\..\include main.F90 ..\..\..\lib\libparamonte*.lib /exe:main.exe
Example Unix / MinGW compile command via GNU gfortran
compiler ⛓
3gfortran -cpp -ffree-line-length-none -O3 -Wl,-rpath,../../../lib -I../../../inc main.F90 ../../../lib/libparamonte* -o main.exe
Example output ⛓
3+2024,
+11,
+14,
-360,
+22,
+15,
+22,
+356
36isMorning([
2440587.5_RK,
2440587.9_RK,
2444239.49999_RK])
40isMorning([
2440587.5_RK,
2440587.9_RK,
2444239.49999_RK], zone
= 60 * [
-1,
+14,
-12])
- Test:
- test_pm_dateTime
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.
-
If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
-
If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.
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.
- Copyright
- Computational Data Science Lab
- Author:
- Amir Shahmoradi, January 30, 2021, 5:36 AM, Dallas, TX
Definition at line 3873 of file pm_dateTime.F90.