Go to the source code of this file.
Functions/Subroutines | |
| subroutine | dccalparseunit1 (unit_str, unit_sym, err) |
| Parse units. | |
| subroutine dccalparseunit1 | ( | character(*), intent(in) | unit_str, |
| integer, intent(out) | unit_sym, | ||
| logical, intent(out), optional | err ) |
Parse units.
Procedures described in this file are provided from "dc_calendar" module.
Parse character variable of units into integer symbol
Parse a character variable of units of date unit_str, and return an integer variable of units of date unit_sym. Valid strings as unit_str are as follows.
| String constants | Description |
|---|---|
| dc_calendar_types#UNIT_SEC | Units of second |
| dc_calendar_types#UNIT_MIN | Units of minute |
| dc_calendar_types#UNIT_HOUR | Units of hour |
| dc_calendar_types#UNIT_DAY | Units of day |
| dc_calendar_types#UNIT_MONTH | Units of month |
| dc_calendar_types#UNIT_YEAR | Units of year |
When a valid string is specified, an integer corresponding one of following variables is returned to unit_sym.
| Symbol constants | Description |
|---|---|
| dc_calendar_types#UNIT_SYMBOL_SEC | Units of second |
| dc_calendar_types#UNIT_SYMBOL_MIN | Units of minute |
| dc_calendar_types#UNIT_SYMBOL_HOUR | Units of hour |
| dc_calendar_types#UNIT_SYMBOL_DAY | Units of day |
| dc_calendar_types#UNIT_SYMBOL_MONTH | Units of month |
| dc_calendar_types#UNIT_SYMBOL_YEAR | Units of year |
If an invalid string is specified an error is caused.
| [in] | unit_str | Character variable of date units |
| [out] | unit_sym | Integer variable of date units (symbol) |
| [out] | err | Exception handling flag. By default, when error occur in this procedure, the program aborts. If this err argument is given, .true. is substituted to err and the program does not abort. |
Definition at line 98 of file dccalparseunit.f90.
References dc_trace::beginsub(), dc_error::dc_ebadunit, dc_error::dc_noerr, dc_calendar_internal::dccaldate_str2usym(), dc_trace::endsub(), dc_error::storeerror(), dc_types::string, and dc_calendar_types::unit_symbol_err.