Conference Presentations
AGU 2019 Fall Meeting: User-Friendly R-Code for Data Extraction from CMIP6 outputs.
AGU 2019 Fall Meeting: Multi-model analysis of bias corrected and non-bias corrected RCM simulations for the assessment of uncertainties and representation of orographic impacts in Mediterranean Region.
7th International Conference on Time Series and Forecasting: https://doi.org/10.3390/engproc2021005048
User-Friendly R-Code for Data Extraction from CMIP6 outputs
How_to_use_the_netcdf2xlsx (R-code) to_extract_data_from_RCM_and_GCM_models_(video)
To cite this study: User-Friendly R-Code for Data Extraction from CMIP6 outputs (AGU 2019)
You can add a comment below ! (e-mail and other informations are not necessary)
November 15, 2020
The first CMIP6 netCDF file I attempted to process with this script failed.
http://cmip.bcc.cma.cn/thredds/fileServer/cmip6_data/AerChemMIP/BCC/BCC-ESM1/ssp370/r1i1p1f1/SImon/siconc/gn/v20200219/siconc_SImon_BCC-ESM1_ssp370_r1i1p1f1_gn_201501-205512.nc
I am not a proficient R programmer, but as far as I can deduce, the R script appears to have problems with:
1) the latitude grid spacing in the input netCDF is not uniform – latitudes are more dense near the equator compared to the poles.;
2) the input netCDF file does not have “rlat” and “rlon” variables;
3) the R script fails to recognize that the time value units = “days since 2015-01-01”
Kind regards,
David
Dear David,
The answer the questions are as follows:
1) The code consider the closest grid available in CMIP model to your coordinates; therefore, grid spacing is not an issue. Namely, whether the grids are closely spaced or not, the code would extract the nearest grid.
2) The code works only for the model with rotated coordinates. This issue is also explained in video.
3)I do not understand why it fails. Can you send an e-mail about the error? For my models, I can extract the data up to 2100.
Best Wishes,
Burak
Dear sir,
I have use the same script provided in your website, however, I have following error. How can I correct it?
dataext(direct,calender,coordexcel,parameter)
Loading required package: sp
[1] “vobjtovarid4: error #F: I could not find the requsted var (or dimvar) in the file!”
[1] “var (or dimvar) name: rlat”
[1] “file name: pr_Amon_CNRM-CM5_historical_r1i1p1_185001-189912.nc”
Error in vobjtovarid4(nc, varid, verbose = verbose, allowdimvar = TRUE) :
Variable not found
Thank you.
dataext(direct,calender,coordexcel,parameter)
Loading required package: sp
[1] “vobjtovarid4: error #F: I could not find the requsted var (or dimvar) in the file!”
[1] “var (or dimvar) name: rlat”
[1] “file name: pr_Amon_CNRM-CM5_historical_r1i1p1_185001-189912.nc”
Error in vobjtovarid4(nc, varid, verbose = verbose, allowdimvar = TRUE) :
Variable not found
*** In my “file name: pr_Amon_CNRM-CM5_historical_r1i1p1_185001-189912.nc”, there are no “rlat” and “rlon” as viewed in panoply. How can i work with this?
[1] “vobjtovarid4: error #F: I could not find the requsted var (or dimvar) in the file!”
[1] “var (or dimvar) name: rlat”
[1] “file name: pr_day_MPI-ESM1-2-HR_ssp245_r1i1p1f1_gn_20400101-20441231.nc”
Error in vobjtovarid4(nc, varid, verbose = verbose, allowdimvar = TRUE) :
Variable not found
Hello,
Unfortunately, this code only works for the models used rlat and rlon as coordinates. You should try another model.
Regards
Hello,
Please make sure that your model includes rlat and rlon variables.
Regards