rich-iannone / splitr

Use the HYSPLIT model from inside R and do more with it
Other
141 stars 60 forks source link

Speed compared to HYSPLIT GUI #14

Closed sean-horvath closed 5 years ago

sean-horvath commented 7 years ago

I'm running SplitR and it takes much much longer to get through simulations that just using the GUI. Did you find this to be true as well? Any ideas how to remedy this? Thanks!

rich-iannone commented 5 years ago

Faster code will fix this. I’m going to introduce some timing functions and work toward reducing the time per complete run.

rich-iannone commented 5 years ago

When all of the met data is already available, the following takes 1m50s on my MacBook Pro (15-in, 2017, 2.9 GHz Core i7, 16 GB 2133 MHz RAM):

traj_model <- 
  create_traj_model() %>%
  add_grid(
    lat = 49.0,
    lon = -123.0,
    range = c(0.8, 0.8),
    division = c(0.2, 0.2)
  ) %>%
  add_params(
    height = 50,
    duration = 6,
    days = seq(
      lubridate::ymd("2012-02-01"),
      lubridate::ymd("2012-02-28"),
      by = "1 day"
    ),
    daily_hours = c(0, 12),
    direction = "backward",
    met_type = "gdas1",
    met_dir = here::here("met"),
    exec_dir = here::here("out")
  ) %>%
  run_model()

I'm not ever going to compare this against the GUI, but, I will try to reduce this amount of of time with better code.