Interface declarations for procedures provided from dc_date. More...
Data Types | |
| interface | dcdatetimecreate |
| interface | dcdifftimecreate |
| interface | dcdatetimeputline |
| interface | dcdifftimeputline |
| interface | setcaltype |
| interface | setsecofday |
| interface | validcaltype |
| interface | validzone |
| interface | zonetodiff |
| interface | parsetimeunits |
| interface | setzone |
| interface | eval |
| interface | evalday |
| interface | evalhour |
| interface | evalmin |
| interface | evalsec |
| interface | evalnondim |
| interface | evalsclsec |
| interface | evalbyunit |
| interface | tochar |
| interface | tocharcal |
| interface | operator(+) |
| interface | operator(-) |
| interface | operator(*) |
| interface | operator(/) |
| interface | mod |
| interface | operator(==) |
| interface | operator(>) |
| interface | operator(<) |
| interface | operator(>=) |
| interface | operator(<=) |
| interface | max |
| interface | min |
| interface | create |
| interface | putline |
Interface declarations for procedures provided from dc_date.
This module provides interface declarations for procedures in dc_date. See dc_date for module overview.
The following procedures operate on DC_DATETIME or DC_DIFFTIME derived types (which store date/time information).
| Procedure | Description |
|---|---|
| DCDateTimeCreate | Initialize DC_DATETIME type variable |
| DCDiffTimeCreate | Initialize DC_DIFFTIME type variable |
| assignment(=) | Initialize DC_DATETIME/DC_DIFFTIME variables |
| Eval | Get individual date/time components |
| toChar | Convert date/time to character string |
| EvalDay | Get as number of days (real type) |
| EvalHour | Get as number of hours (real type) |
| EvalMin | Get as number of minutes (real type) |
| EvalSec | Get as number of seconds (real type) |
| EvalNondim | Get as nondimensional time (real type) |
| EvalByUnit | Get in specified unit (day/hour/min/sec) |
| operator(+) | Addition (DC_DATETIME and DC_DIFFTIME types) |
| operator(-) | Subtraction (DC_DATETIME and DC_DIFFTIME types) |
| operator(*) | Multiplication (DC_DIFFTIME and numeric types) |
| operator(/) | Division (DC_DIFFTIME and numeric types) |
| mod | Remainder (between DC_DIFFTIME types) |
| operator(==) | Comparison (between DC_DATETIME types) |
| operator(>) | Comparison (between DC_DATETIME types) |
| operator(>=) | Comparison (between DC_DATETIME types) |
| operator(<) | Comparison (between DC_DATETIME types) |
| operator(<=) | Comparison (between DC_DATETIME types) |
| max | Return larger value |
| min | Return smaller value |
| SetZone | Change timezone |
| DCDateTimePutLine | Print DC_DATETIME variable information |
| DCDiffTimePutLine | Print DC_DIFFTIME variable information |
The following procedures modify internal variables in dc_date_types:
| Procedure | Description |
|---|---|
| SetCaltype | Change default calendar type |
| SetSecOfDay | Change default seconds per day |
Other procedures:
| Procedure | Description |
|---|---|
| ValidCaltype | Check if calendar type is valid |
| ValidZone | Check if timezone is valid |
| ZoneToDiff | Convert timezone to DC_DIFFTIME variable |
| ParseTimeUnits | Parse time unit and return unit symbol |
When DCDateTimeCreate subroutine is used on a DC_DATETIME type variable, the time is set. If year/month/day are not specified, current time is set. The set time can be converted to character type with toChar. See dc_string::Printf for Printf subroutine details.
DC_DIFFTIME type variables express time differences. In the example below, variable diff is prepared and set to 25 days + 12 hours + 50 minutes using Create subroutine. By adding DC_DATETIME variable time_before and diff with operator(+), we get time_after which is 25 days + 12 hours + 50 minutes ahead of time_before.
Below is an example program solving dA/dt = -αA (initial value 1, α=0.0001) up to t = 12 (hours) using forward difference. By using DC_DIFFTIME for Δt, data output interval, and calculation time, loop termination and time comparison for data output become easy.