From 89c6478818113e520a8229e37d00e22e629ff4b9 Mon Sep 17 00:00:00 2001 From: Victoria Agudetse Roures Date: Fri, 3 Feb 2023 13:20:38 +0100 Subject: [PATCH 1/2] Make grid consistency check a bit more lax --- modules/Loading/Loading.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/Loading/Loading.R b/modules/Loading/Loading.R index 53d41cc2..a6b185d2 100644 --- a/modules/Loading/Loading.R +++ b/modules/Loading/Loading.R @@ -291,7 +291,7 @@ load_datasets <- function(recipe) { # Check for consistency between hcst and obs grid if (!(recipe$Analysis$Regrid$type == 'none')) { - if (!identical(as.vector(hcst$lat), as.vector(obs$lat))) { + if (!isTRUE(all.equal(as.vector(hcst$lat), as.vector(obs$lat)))) { lat_error_msg <- paste("Latitude mismatch between hcst and obs.", "Please check the original grids and the", "regrid parameters in your recipe.") @@ -304,7 +304,7 @@ load_datasets <- function(recipe) { info(recipe$Run$logger, obs_lat_msg) stop("hcst and obs don't share the same latitudes.") } - if (!identical(as.vector(hcst$lon), as.vector(obs$lon))) { + if (!isTRUE(all.equal(as.vector(hcst$lon), as.vector(obs$lon)))) { lon_error_msg <- paste("Longitude mismatch between hcst and obs.", "Please check the original grids and the", "regrid parameters in your recipe.") -- GitLab From 2fa629ef6f2675c12784909228d4836bd351439e Mon Sep 17 00:00:00 2001 From: Victoria Agudetse Roures Date: Thu, 9 Feb 2023 12:39:31 +0100 Subject: [PATCH 2/2] Add latlon check fix to decadal --- modules/Loading/Loading_decadal.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/Loading/Loading_decadal.R b/modules/Loading/Loading_decadal.R index 0a95d9a4..e3677e1d 100644 --- a/modules/Loading/Loading_decadal.R +++ b/modules/Loading/Loading_decadal.R @@ -387,7 +387,7 @@ load_datasets <- function(recipe) { # lat and lon attributes if (!(recipe$Analysis$Regrid$type == 'none')) { - if (!identical(as.vector(hcst$lat), as.vector(obs$lat))) { + if (!isTRUE(all.equal(as.vector(hcst$lat), as.vector(obs$lat)))) { lat_error_msg <- paste("Latitude mismatch between hcst and obs.", "Please check the original grids and the", "regrid parameters in your recipe.") @@ -401,7 +401,7 @@ load_datasets <- function(recipe) { stop("hcst and obs don't share the same latitudes.") } - if (!identical(as.vector(hcst$lon), as.vector(obs$lon))) { + if (!isTRUE(all.equal(as.vector(hcst$lon), as.vector(obs$lon)))) { lon_error_msg <- paste("Longitude mismatch between hcst and obs.", "Please check the original grids and the", "regrid parameters in your recipe.") -- GitLab