Downloading CMIP6 data for a specific area

930 Views Asked by At

By default, the CMIP6 netcdf data downloaded from any of the different ESGF portals cover the entire globe. Is there a way to download CMIP6 for a box (e.g., with bounds 20°W,20°E and 15°S,25°N) encompassing a particular region of the world?

2

There are 2 best solutions below

0
On

As a modification to Robert's anwer, if you don't want to calculate the i and j indices, I think you can specify the lat lon range directly using a decimal point:

ncks -d lat,-15.,25. -d lon,340.,20. http://aims3.llnl.gov/thredds/dodsC/css03_data/CMIP6/CMIP/MOHC/UKESM1-0-LL/historical/r1i1p1f2/Omon/tos/gn/v20190406/tos_Omon_UKESM1-0-LL_historical_r1i1p1f2_gn_185001-194912.nc outfile.nc

Be careful with how you specify the longitude when you have wrapped coordinates across lon=0, as specified in this answer to Robert's own question here. :-)

0
On

This can be done using the opendap options available over ESGF. This can be cropped easily on the command line using NCO. An example, for a different region, is below:

ncks -d i,260,305 -d j,240,290 http://aims3.llnl.gov/thredds/dodsC/css03_data/CMIP6/CMIP/MOHC/UKESM1-0-LL/historical/r1i1p1f2/Omon/tos/gn/v20190406/tos_Omon_UKESM1-0-LL_historical_r1i1p1f2_gn_185001-194912.nc outfile.nc

CMIP6 grids are in no way consistent, so you will need to create a different NCO call (or xarray or whatever you choose to use). If you are working with a lot of different models, this might take some time.

If you already have urls for downloading, you should be able to convert them to opendap urls as follows:

ff.replace("fileServer","dodsC")

where ff is the url.