From d0fe41ac3ee78cb4e879eb055bc422d27846f09f Mon Sep 17 00:00:00 2001 From: aho Date: Fri, 27 Oct 2023 17:35:48 +0200 Subject: [PATCH 1/3] Update the data path --- inst/doc/tutorial/PATC2023/handson_1-data-loading.md | 2 +- inst/doc/tutorial/PATC2023/handson_1-data-loading_ans.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/inst/doc/tutorial/PATC2023/handson_1-data-loading.md b/inst/doc/tutorial/PATC2023/handson_1-data-loading.md index 1a61862..48bd86a 100644 --- a/inst/doc/tutorial/PATC2023/handson_1-data-loading.md +++ b/inst/doc/tutorial/PATC2023/handson_1-data-loading.md @@ -170,7 +170,7 @@ even "time" is not explicitly specified in the Start() call. path_obs <- '/esarchive/recon/ecmwf/era5/monthly_mean/$var$_f1h-r1440x721cds/$var$_$syear$.nc' #---------------------------------------------------------------------- # Run these two lines if you're on Marenostrum4 and log in with training account - prefix <- '/gpfs/scratch/bsc32/bsc32734/bsc_training_2023/R_handson/' + prefix <- '/gpfs/scratch/nct01/nct01001/d2_handson_R/' path_obs <- paste0(prefix, path_obs) #---------------------------------------------------------------------- diff --git a/inst/doc/tutorial/PATC2023/handson_1-data-loading_ans.md b/inst/doc/tutorial/PATC2023/handson_1-data-loading_ans.md index d0d4b07..39e5451 100644 --- a/inst/doc/tutorial/PATC2023/handson_1-data-loading_ans.md +++ b/inst/doc/tutorial/PATC2023/handson_1-data-loading_ans.md @@ -28,7 +28,7 @@ Understand the following script, run it, and check the result. path_exp <- "/esarchive/exp/meteofrance/system7c3s/monthly_mean/$var$_f6h/$var$_$syear$.nc" #---------------------------------------------------------------------- # Run these two lines if you're on Marenostrum4 and log in with training account - prefix <- '/gpfs/scratch/bsc32/bsc32734/bsc_training_2023/R_handson/' + prefix <- '/gpfs/scratch/nct01/nct01001/d2_handson_R/' path_exp <- paste0(prefix, path_exp) #---------------------------------------------------------------------- -- GitLab From 9318c7f1f17e96375a3d9204dc0b8e71f3d0beda Mon Sep 17 00:00:00 2001 From: aho Date: Mon, 30 Oct 2023 13:02:36 +0100 Subject: [PATCH 2/3] correct obs path and last time comparison --- inst/doc/tutorial/PATC2023/handson_1-data-loading.md | 5 +++-- inst/doc/tutorial/PATC2023/handson_1-data-loading_ans.md | 7 +++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/inst/doc/tutorial/PATC2023/handson_1-data-loading.md b/inst/doc/tutorial/PATC2023/handson_1-data-loading.md index 48bd86a..149f036 100644 --- a/inst/doc/tutorial/PATC2023/handson_1-data-loading.md +++ b/inst/doc/tutorial/PATC2023/handson_1-data-loading.md @@ -28,7 +28,7 @@ Understand the following script, run it, and check the result. path_exp <- "/esarchive/exp/meteofrance/system7c3s/monthly_mean/$var$_f6h/$var$_$syear$.nc" #---------------------------------------------------------------------- # Run these two lines if you're on Marenostrum4 and log in with training account - prefix <- '/gpfs/scratch/bsc32/bsc32734/bsc_training_2023/R_handson/' + prefix <- '/gpfs/scratch/nct01/nct01001/d2_handson_R/' path_exp <- paste0(prefix, path_exp) #---------------------------------------------------------------------- @@ -242,5 +242,6 @@ identical(____, ____) all.equal(____, ____) # time: only compare year and month -identical(format(hcst_time, '%Y%m'), format(obs_time, '%Y%m')) +hcst_time_corrected <- attributes(hcst)$Variables$common$time +identical(format(hcst_time_correct, '%Y%m'), format(obs_time, '%Y%m')) ``` diff --git a/inst/doc/tutorial/PATC2023/handson_1-data-loading_ans.md b/inst/doc/tutorial/PATC2023/handson_1-data-loading_ans.md index 39e5451..84099cd 100644 --- a/inst/doc/tutorial/PATC2023/handson_1-data-loading_ans.md +++ b/inst/doc/tutorial/PATC2023/handson_1-data-loading_ans.md @@ -182,7 +182,7 @@ even "time" is not explicitly specified in the Start() call. path_obs <- '/esarchive/recon/ecmwf/era5/monthly_mean/$var$_f1h-r1440x721cds/$var$_$syear$.nc' #---------------------------------------------------------------------- # Run these two lines if you're on Marenostrum4 and log in with training account - prefix <- '/gpfs/scratch/bsc32/bsc32734/bsc_training_2023/R_handson/' + prefix <- '/gpfs/scratch/nct01/nct01001/d2_handson_R/' path_obs <- paste0(prefix, path_obs) #---------------------------------------------------------------------- @@ -257,6 +257,8 @@ Use `identical()` or `all.equal()` to check if the values are consistent. ```r identical(obs_lat, hcst_lat) [1] TRUE +all.equal(obs_lat, hcst_lat) +[1] TRUE identical(obs_lon, hcst_lon) [1] TRUE identical(fcst_lat, hcst_lat) @@ -264,6 +266,7 @@ identical(fcst_lat, hcst_lat) identical(fcst_lon, hcst_lon) [1] TRUE -identical(format(hcst_time, '%Y%m'), format(obs_time, '%Y%m')) +hcst_time_corrected <- attributes(hcst)$Variables$common$time +identical(format(hcst_time_corrected, '%Y%m'), format(obs_time, '%Y%m')) [1] TRUE ``` -- GitLab From c67746c16a9beb4d86135329070c2cd3990e882f Mon Sep 17 00:00:00 2001 From: aho Date: Mon, 30 Oct 2023 14:05:39 +0100 Subject: [PATCH 3/3] check file by ncdump before Start() call --- inst/doc/tutorial/PATC2023/handson_1-data-loading.md | 5 +++++ inst/doc/tutorial/PATC2023/handson_1-data-loading_ans.md | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/inst/doc/tutorial/PATC2023/handson_1-data-loading.md b/inst/doc/tutorial/PATC2023/handson_1-data-loading.md index 149f036..0741780 100644 --- a/inst/doc/tutorial/PATC2023/handson_1-data-loading.md +++ b/inst/doc/tutorial/PATC2023/handson_1-data-loading.md @@ -21,6 +21,11 @@ We're going to analyze the near-surface temperature (short name: tas) for season ### 1.a Hindcast data +Check one netCDF file to see the data structure. +``` +ncdump -h /gpfs/scratch/nct01/nct01001/d2_handson_R/esarchive/exp/meteofrance/system7c3s/monthly_mean/tas_f6h/tas_19931101.nc |less +``` + Understand the following script, run it, and check the result. ```r diff --git a/inst/doc/tutorial/PATC2023/handson_1-data-loading_ans.md b/inst/doc/tutorial/PATC2023/handson_1-data-loading_ans.md index 84099cd..41d4a8b 100644 --- a/inst/doc/tutorial/PATC2023/handson_1-data-loading_ans.md +++ b/inst/doc/tutorial/PATC2023/handson_1-data-loading_ans.md @@ -21,6 +21,11 @@ We're going to analyze the near-surface temperature (short name: tas) for season ### 1.a Hindcast data +Check one netCDF file to see the data structure. +``` +ncdump -h /gpfs/scratch/nct01/nct01001/d2_handson_R/esarchive/exp/meteofrance/system7c3s/monthly_mean/tas_f6h/tas_19931101.nc |less +``` + Understand the following script, run it, and check the result. ```r -- GitLab