Functions/Subroutines | |
integer function, public | period_length (sdate, edate) |
integer function, public | day_of_month (year, month) |
integer function, public | numdays_of_year (date) |
subroutine, public | calculate_time_for_model (idt, date) |
subroutine, public | set_timestep_variables (tstep, stepunit, fdate) |
subroutine, public | calculate_timesteps_to_monday (fdate, tstep) |
subroutine, public | get_dayno_from_monthday (datumIn, daysAmount) |
subroutine, public | add_date_to_array (onedate, dim, n, datearray) |
subroutine, public | check_if_date_in_period (dim, n, datearray, begindate, enddate, status) |
Variables | |
integer, parameter | float = KIND(1.0) |
Module contains procedures relating to time calculations.
subroutine, public timeroutines::add_date_to_array | ( | type(datetype), intent(in) | onedate, |
integer, intent(in) | dim, | ||
integer, intent(inout) | n, | ||
type(datetype), dimension(dim), intent(inout) | datearray | ||
) |
Add new date to date-array in order. Already existing dates are not added.
[in] | onedate | date to be added |
[in] | dim | size of array |
[in,out] | n | number of dates in array |
[in,out] | datearray | array of dates |
subroutine, public timeroutines::calculate_time_for_model | ( | integer, intent(in) | idt, |
type(datetype), intent(in) | date | ||
) |
Calculates the time variables available for the model.
Consequences Module modvar variables current_time is set.
[in] | idt | index of current timestep |
[in] | date | current date |
subroutine, public timeroutines::calculate_timesteps_to_monday | ( | type(datetype), intent(in) | fdate, |
integer, intent(out) | tstep | ||
) |
Set Monday time step variable. The first Monday of the simulation will be idt=1+tstep (tstep>0). For negative tstep; the first Monday of the simulation will be idt=1+tstep+timesteps_per_week.
Consequences Module worldvar variable dtmonday is set in calling routine
[in] | fdate | first date of simulation |
[out] | tstep | time steps to first monday |
subroutine, public timeroutines::check_if_date_in_period | ( | integer, intent(in) | dim, |
integer, intent(in) | n, | ||
type(datetype), dimension(dim), intent(in) | datearray, | ||
type(datetype), intent(in) | begindate, | ||
type(datetype), intent(in) | enddate, | ||
logical, intent(inout) | status | ||
) |
Check if dates are within period.
[in] | dim | size of array |
[in] | n | number of elements in array |
[in] | datearray | date array to be checked |
[in] | begindate | begin date of period |
[in] | enddate | end date of period |
[in,out] | status | flag for any date withing period |
integer function, public timeroutines::day_of_month | ( | integer, intent(in) | year, |
integer, intent(in) | month | ||
) |
Calculates the number of days in month during year.
[in] | year | year in format YYYY |
subroutine, public timeroutines::get_dayno_from_monthday | ( | integer, intent(in) | datumIn, |
integer, intent(out) | daysAmount | ||
) |
Calculate daynumber of year from month-day (mmdd)
[in] | datumin | month day (mmdd): 31st of January = 0131 |
[out] | daysamount | Corresponding amount of days since beginning of year |
integer function, public timeroutines::numdays_of_year | ( | type(datetype), intent(in) | date | ) |
Calculates the number of days of year.
integer function, public timeroutines::period_length | ( | type(datetype), intent(in) | sdate, |
type(datetype), intent(in) | edate | ||
) |
Calculates the number of time steps between sdate and edate.
[in] | sdate | start date |
[in] | edate | end date |
subroutine, public timeroutines::set_timestep_variables | ( | integer, intent(in) | tstep, |
character(len=*), intent(in) | stepunit, | ||
type(datetype), intent(in) | fdate | ||
) |
Set time step variables.
Consequences Module modvar variables seconds_per_timestep and timesteps_per_day are set. Module worldvar variable steplen and idtlag are set.
[in] | tstep | time step read from file |
[in] | stepunit | unit of time step read from file |
[in] | fdate | first date of simulation |
|
private |