|
◆ timedelta_init()
subroutine datetime_class::timedelta_init |
( |
type(timedelta), intent(inout) |
this, |
|
|
integer, intent(in), optional |
year, |
|
|
integer, intent(in), optional |
month, |
|
|
integer, intent(in), optional |
day, |
|
|
integer, intent(in), optional |
hour, |
|
|
integer, intent(in), optional |
minute, |
|
|
integer, intent(in), optional |
sec, |
|
|
integer, intent(in), optional |
msec, |
|
|
character(len=*), intent(in), optional |
isodate, |
|
|
character(len=*), intent(in), optional |
simpledate, |
|
|
character(len=12), intent(in), optional |
oraclesimdate |
|
) |
| |
|
private |
Costruisce un oggetto timedelta con i parametri opzionali forniti.
Se non viene passato nulla lo inizializza a intervallo di durata nulla. L'intervallo ottenuto � pari alla somma dei valori di tutti i parametri forniti, ovviamente non fornire un parametro equivale a fornirlo =0.
- Parametri
-
[in,out] | this | oggetto da inizializzare |
[in] | year | anni, se presente l'oggetto diventa "popolare" |
[in] | month | mesi, se presente l'oggetto diventa "popolare" |
[in] | day | giorni |
[in] | hour | ore |
[in] | minute | minuti |
[in] | sec | secondi |
[in] | msec | millisecondi |
[in] | isodate | inizializza l'oggetto ad un intervallo nel formato AAAAMMGGGG hh:mm:ss.msc , ignorando tutti gli altri parametri, se AAAA o MM sono diversi da 0 l'oggetto diventa "popolare" |
[in] | simpledate | inizializza l'oggetto ad un intervallo nel formato GGGGGGGGhhmmmsc , ignorando tutti gli altri parametri, da preferire rispetto a oraclesimdate |
[in] | oraclesimdate | inizializza l'oggetto ad un intervallo nel formato GGGGGGGGhhmm , ignorando tutti gli altri parametri |
Definizione alla linea 1555 del file datetime_class.F90.
1559 lndays = lndays - n*d400 1561 n = min(lndays/d100, 3) 1562 lndays = lndays - n*d100 1565 lndays = lndays - n*d4 1567 n = min(lndays/d1, 3) 1568 lndays = lndays - n*d1 1572 IF (lndays < ianno(imm+1,n)) EXIT 1574 igg = lndays+1-ianno(imm,n) 1576 END SUBROUTINE ndyin 1579 integer elemental FUNCTION ndays(igg,imm,iaa) 1596 INTEGER, intent(in) :: igg, imm, iaa 1598 INTEGER :: lmonth, lyear 1601 lmonth = modulo(imm-1, 12) + 1 1602 lyear = iaa + (imm - lmonth)/12 1603 ndays = igg+ianno(lmonth, bisextilis(lyear)) 1604 ndays = ndays-1 + 365*(lyear-year0) + (lyear-year0)/4 - (lyear-year0)/100 + & 1610 elemental FUNCTION bisextilis(annum) 1611 INTEGER, INTENT(in) :: annum 1612 INTEGER :: bisextilis 1614 IF (mod(annum,4) == 0 .AND. (mod(annum,400) == 0 .EQV. mod(annum,100) == 0)) THEN 1619 END FUNCTION bisextilis 1622 ELEMENTAL FUNCTION cyclicdatetime_eq(this, that) RESULT(res) 1623 TYPE(cyclicdatetime), INTENT(IN) :: this, that 1627 if (this%minute /= that%minute) res=.false. 1628 if (this%hour /= that%hour) res=.false. 1629 if (this%day /= that%day) res=.false. 1630 if (this%month /= that%month) res=.false. 1631 if (this%tendaysp /= that%tendaysp) res=.false. 1633 END FUNCTION cyclicdatetime_eq 1636 ELEMENTAL FUNCTION cyclicdatetime_datetime_eq(this, that) RESULT(res) 1637 TYPE(cyclicdatetime), INTENT(IN) :: this 1638 TYPE(datetime), INTENT(IN) :: that 1641 integer :: minute,hour,day,month 1643 call getval(that,minute=minute,hour=hour,day=day,month=month) 1646 if (c_e(this%minute) .and. this%minute /= minute) res=.false. 1647 if (c_e(this%hour) .and. this%hour /= hour) res=.false. 1648 if (c_e(this%day) .and. this%day /= day) res=.false. 1649 if (c_e(this%month) .and. this%month /= month) res=.false. 1650 if (c_e(this%tendaysp)) then 1651 if ( this%tendaysp /= min(((day-1)/10) +1,3)) res=.false. 1654 END FUNCTION cyclicdatetime_datetime_eq 1657 ELEMENTAL FUNCTION datetime_cyclicdatetime_eq(this, that) RESULT(res) 1658 TYPE(datetime), INTENT(IN) :: this 1659 TYPE(cyclicdatetime), INTENT(IN) :: that 1662 integer :: minute,hour,day,month 1664 call getval(this,minute=minute,hour=hour,day=day,month=month) 1667 if (c_e(that%minute) .and. that%minute /= minute) res=.false. 1668 if (c_e(that%hour) .and. that%hour /= hour) res=.false. 1669 if (c_e(that%day) .and. that%day /= day) res=.false. 1670 if (c_e(that%month) .and. that%month /= month) res=.false. 1672 if (c_e(that%tendaysp)) then 1673 if ( that%tendaysp /= min(((day-1)/10) +1,3)) res=.false. 1677 END FUNCTION datetime_cyclicdatetime_eq 1679 ELEMENTAL FUNCTION c_e_cyclicdatetime(this) result (res) 1680 TYPE(cyclicdatetime), INTENT(in) :: this 1683 res = .not. this == cyclicdatetime_miss 1685 end FUNCTION c_e_cyclicdatetime
|