From 1b89cc87a3ce71acb493123b4e70c9c4f7d6366b Mon Sep 17 00:00:00 2001 From: allabres Date: Thu, 13 Jun 2024 12:11:56 +0200 Subject: [PATCH 1/2] updated archive and added ensemble synonim --- conf/archive.yml | 6 +++--- modules/Loading/R/load_seasonal.R | 13 +++++++------ modules/Loading/R/load_tas_tos.R | 4 ++-- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/conf/archive.yml b/conf/archive.yml index 61f62be2..fcf6b38f 100644 --- a/conf/archive.yml +++ b/conf/archive.yml @@ -92,7 +92,7 @@ esarchive: name: "JMA System 2" institution: "European Centre for Medium-Range Weather Forecasts" src: "exp/jma/system2c3s/" - monthly_mean: {"tas":"monthly_mean/tas_f6h/", "prlr":"monthly_mean/prlr_f6h/", + monthly_mean: {"tas":"monthly_mean/tas_f6h/", "prlr":"monthly_mean/prlr_f24h/", "tasmax":"monthly_mean/tasmax_f6h/", "tasmin":"monthly_mean/tasmin_f6h/"} nmember: fcst: 10 @@ -117,7 +117,7 @@ esarchive: institution: "European Centre for Medium-Range Weather Forecasts" src: "exp/ukmo/glosea6_system600-c3s/" monthly_mean: {"tas":"monthly_mean/tas_f6h/", "tasmin":"monthly_mean/tasmin_f24h/", - "tasmax":"monthly_mean/tasmax_f24h/", "prlr":"monthly_mean/prlr_f24h/"} + "tasmax":"monthly_mean/tasmax_f24h/", "prlr":"monthly_mean/prlr_s0-24h/"} nmember: fcst: 62 hcst: 28 @@ -128,7 +128,7 @@ esarchive: name: "NCEP CFSv2" institution: "NOAA NCEP" #? src: "exp/ncep/cfs-v2/" - monthly_mean: {"tas":"monthly_mean/tas_f6h/", "prlr":"monthly_mean/prlr_f6h/", + monthly_mean: {"tas":"monthly_mean/tas_f6h/", "prlr":"monthly_mean/prlr_f24h/", "tasmax":"monthly_mean/tasmax_f6h/", "tasmin":"monthly_mean/tasmin_f6h/"} nmember: fcst: 20 diff --git a/modules/Loading/R/load_seasonal.R b/modules/Loading/R/load_seasonal.R index 42b74b16..4993929a 100644 --- a/modules/Loading/R/load_seasonal.R +++ b/modules/Loading/R/load_seasonal.R @@ -31,14 +31,14 @@ load_seasonal <- function(recipe) { recipe$Analysis$Time$ftime_min, recipe$Analysis$Time$ftime_max, time_freq=store.freq) - + if (!(is.null(sdates$fcst))) { idxs$fcst <- get_timeidx(sdates$fcst, recipe$Analysis$Time$ftime_min, recipe$Analysis$Time$ftime_max, time_freq=store.freq) } - + ## TODO: Examine this verifications part, verify if it's necessary # stream <- verifications$stream # sdates <- verifications$fcst.sdate @@ -97,9 +97,10 @@ load_seasonal <- function(recipe) { } else { split_multiselected_dims = FALSE } - + # Load hindcast #------------------------------------------------------------------- + hcst <- Start(dat = hcst.path, var = variable, var_dir = var_dir_exp, @@ -116,7 +117,7 @@ load_seasonal <- function(recipe) { transform_vars = c('latitude', 'longitude'), synonims = list(latitude = c('lat', 'latitude'), longitude = c('lon', 'longitude'), - ensemble = c('member', 'ensemble')), + ensemble = c('member', 'ensemble', 'lev')), ensemble = indices(1:hcst.nmember), metadata_dims = 'var', # change to just 'var'? return_vars = list(latitude = 'dat', @@ -124,7 +125,7 @@ load_seasonal <- function(recipe) { time = 'file_date'), split_multiselected_dims = split_multiselected_dims, retrieve = TRUE) - + stop('here') # Remove var_dir dimension if ("var_dir" %in% names(dim(hcst))) { hcst <- Subset(hcst, along = "var_dir", indices = 1, drop = "selected") @@ -180,7 +181,7 @@ load_seasonal <- function(recipe) { transform_vars = c('latitude', 'longitude'), synonims = list(latitude = c('lat', 'latitude'), longitude = c('lon', 'longitude'), - ensemble = c('member', 'ensemble')), + ensemble = c('member', 'ensemble', 'lev')), ensemble = indices(1:fcst.nmember), metadata_dims = 'var', return_vars = list(latitude = 'dat', diff --git a/modules/Loading/R/load_tas_tos.R b/modules/Loading/R/load_tas_tos.R index ea231b56..49b7df33 100644 --- a/modules/Loading/R/load_tas_tos.R +++ b/modules/Loading/R/load_tas_tos.R @@ -103,7 +103,7 @@ load_tas_tos <- function(recipe) { longitude_reorder = circularsort, synonims = list(latitude = c('lat', 'latitude'), longitude = c('lon', 'longitude'), - ensemble = c('member', 'ensemble')), + ensemble = c('member', 'ensemble', 'lev')), ensemble = indices(1:hcst.nmember), metadata_dims = 'var', # change to just 'var'? return_vars = list(latitude = 'dat', @@ -184,7 +184,7 @@ load_tas_tos <- function(recipe) { longitude_reorder = circularsort, synonims = list(latitude = c('lat', 'latitude'), longitude = c('lon', 'longitude'), - ensemble = c('member', 'ensemble')), + ensemble = c('member', 'ensemble', 'lev')), ensemble = indices(1:fcst.nmember), metadata_dims = 'var', return_vars = list(latitude = 'dat', -- GitLab From 367d4dcfc3ef0c97c3f2639f0b8a3feefbea5d70 Mon Sep 17 00:00:00 2001 From: vagudets Date: Fri, 14 Jun 2024 09:49:47 +0200 Subject: [PATCH 2/2] Remove call to stop() --- modules/Loading/R/load_seasonal.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/Loading/R/load_seasonal.R b/modules/Loading/R/load_seasonal.R index 4993929a..7b7619cc 100644 --- a/modules/Loading/R/load_seasonal.R +++ b/modules/Loading/R/load_seasonal.R @@ -125,7 +125,7 @@ load_seasonal <- function(recipe) { time = 'file_date'), split_multiselected_dims = split_multiselected_dims, retrieve = TRUE) - stop('here') + # Remove var_dir dimension if ("var_dir" %in% names(dim(hcst))) { hcst <- Subset(hcst, along = "var_dir", indices = 1, drop = "selected") -- GitLab