diff --git a/inst/doc/tutorial/PATC2023/handson_1-data-loading.md b/inst/doc/tutorial/PATC2023/handson_1-data-loading.md index 1a61862021d3e37ff4dec5427233f1cbb4b43322..0741780b3b7e07a11b8720ab8b13eff2ce9ab7eb 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 @@ -28,7 +33,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) #---------------------------------------------------------------------- @@ -170,7 +175,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) #---------------------------------------------------------------------- @@ -242,5 +247,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 d0d4b07697449908e4f18c49dc5da1b8df059d52..41d4a8ba7c2fc264a0fe25b07f7d075b1c45ebcf 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 @@ -28,7 +33,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) #---------------------------------------------------------------------- @@ -182,7 +187,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 +262,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 +271,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 ```