Creates a standardized temporal framework for CDSimX simulations. Supports daily, monthly, and yearly temporal resolutions.

generate_time_index(
  start_date = "1990-01-01",
  end_date = "1999-12-31",
  frequency = "daily",
  calendar = "standard"
)

Arguments

start_date

Character or Date object. Simulation start date. Default = "1990-01-01"

end_date

Character or Date object. Simulation end date. Default = "1999-12-31"

frequency

Temporal resolution:

  • "daily"

  • "monthly"

  • "yearly"

calendar

Calendar type. Currently supports:

  • "standard"

  • "noleap"

Value

A data.frame containing:

START_DATE

Start date

END_DATE

End date

DATE

Date index

Year

Calendar year

Month

Month number

Day

Day of month

DOY

Day of year

Week

Week number

Quarter

Quarter

Season

Climatological season

Frequency

Simulation resolution

Details

This function becomes the backbone of all climate simulations, ensuring that all variables share a synchronized temporal structure.

Examples

daily_index <- generate_time_index(
  start_date = "2000-01-01",
  end_date   = "2000-12-31",
  frequency  = "daily"
)
#> Generated 366 time steps at daily resolution.

monthly_index <- generate_time_index(
  start_date = "1990-01-01",
  end_date   = "2020-12-31",
  frequency  = "monthly"
)
#> Generated 372 time steps at monthly resolution.