gtool5 Fortran 90/95 Library 1.0.0-rc5
日本語
Loading...
Searching...
No Matches
dcdatetimemax.f90 File Reference

Go to the source code of this file.

Functions/Subroutines

type(dc_datetime) function dcdatetime_max_tt (time1, time2)
 User defined function "max".
type(dc_difftime) function dcdatetime_max_ff (diff1, diff2)

Function/Subroutine Documentation

◆ dcdatetime_max_ff()

type(dc_difftime) function dcdatetime_max_ff ( type(dc_difftime), intent(in) diff1,
type(dc_difftime), intent(in) diff2 )

Return the larger of two DC_DIFFTIME values

Compare two time difference values and return the larger one.

Parameters
[in]diff1First time difference to compare
[in]diff2Second time difference to compare
Returns
The time difference that is larger

Definition at line 77 of file dcdatetimemax.f90.

78
79 use dc_date_generic, only: operator(>)
82 implicit none
83 type(DC_DIFFTIME):: result
84 type(DC_DIFFTIME), intent(in):: diff1, diff2
85continue
86 if ( diff1 > diff2 ) then
87 result = diff1
88 else
89 result = diff2
90 end if
91 call dcdate_nondimcheck('dc_date#max', diff1, diff2, result)
Interface declarations for procedures provided from dc_date.
Internal module for dc_date.
subroutine, public dcdate_nondimcheck(opr, diff1, diff2, rslt)
Derived types and parameters for date and time.

References dc_date_internal::dcdate_nondimcheck().

Here is the call graph for this function:

◆ dcdatetime_max_tt()

type(dc_datetime) function dcdatetime_max_tt ( type(dc_datetime), intent(in) time1,
type(dc_datetime), intent(in) time2 )

User defined function "max".

Author
Yasuhiro MORIKAWA

This file contains implementation procedures of "max" function for dc_date_types#DC_DATETIME and dc_date_types#DC_DIFFTIME.

Return the later of two DC_DATETIME values

Compare two datetime values and return the one that is later.

Parameters
[in]time1First datetime to compare
[in]time2Second datetime to compare
Returns
The datetime that is later

Definition at line 43 of file dcdatetimemax.f90.

44
45 use dc_date_generic, only: operator(>)
47 implicit none
48 type(DC_DATETIME):: result
49 type(DC_DATETIME), intent(in):: time1, time2
50continue
51 if ( time1 > time2 ) then
52 result = time1
53 else
54 result = time2
55 end if