CRPS_clim <- function(obs, memb_dim ='ensemble'){  
  time_dim <- names(dim(obs))
  obs_time_len <- dim(obs)[time_dim]

    ref <- array(data = rep(obs, each = obs_time_len), dim = c(obs_time_len, obs_time_len))
    names(dim(ref)) <- c(time_dim, memb_dim)
    # ref: [sdate, memb]
    # obs: [sdate]
  crps_ref <- s2dv:::.CRPS(exp = ref, obs = obs, time_dim = time_dim, memb_dim = memb_dim,
                      dat_dim = NULL, Fair = FALSE)
    # crps_ref should be [sdate]
  return(mean(crps_ref))
}
