Issues with API for downloading CMIP6 datasets

Hello everyone,

I am experiencing difficulties while downloading multiple CMIP6 datasets via the API. I initiated a request that includes the SSP126, SSP245, and SSP585 experiments, as well as the variables for precipitation, maximum, minimum, and mean temperatures, totaling 23 models. To circumvent the error indicating that my request is too large, I reduced the number of models to 10 and limited the data period.

However, despite these adjustments, the downloaded file aggregates all the data in a mixed format, without distinguishing between the different models and variables. What I want is to obtain separate files for each model and variable, for instance, a distinct file fo[quote=“SORO_FERELAHA, post:1, topic:7329, full:true”]
Hello everyone,

I am experiencing difficulties while downloading multiple CMIP6 datasets via the API. I initiated a request that includes the SSP126, SSP245, and SSP585 experiments, as well as the variables for precipitation, maximum, minimum, and mean temperatures, totaling 23 models. To circumvent the error indicating that my request is too large, I reduced the number of models to 10 and limited the data period.

However, despite these adjustments, the downloaded file aggregates all the data in a mixed format, without distinguishing between the different models and variables. What I want is to obtain separate files for each model and variable, for instance, a distinct file for the precipitation variable for each model of SSP126, and so on.

I am sharing the API code to help you see the error I am making. If anyone has suggestions or advice on how to structure my requests to achieve the desired file format, I would greatly appreciate it.

Thank you in advance for your assistance!

[spoiler]import cdsapi

dataset = “projections-cmip6”
request = {
“temporal_resolution”: “daily”,
“experiment”: [
“ssp1_2_6”, “ssp2_4_5”, “ssp5_8_5”
],
“variable”: [
“precipitation”,
“daily_maximum_near_surface_air_temperature”,
“daily_minimum_near_surface_air_temperature”,
“near_surface_air_temperature”
],
“model”: [
“access_cm2”, “awi-cm-1-1-mr”, “bcc-csm2-mr”,
“canesm5”, “cmcc-esm2”, “cnrm-cm6-1”,
“cnrm-esm2-1”, “ec-earth3-cc”, “ec-earth3-veg-lr”,
“fgoals-g3”, “gfdl-esm4”, “inm-cm4-8”,
“inm-cm5-0”, “ipsl-cm6a-lr”, “kace-1-0-g”,
“kiost-esm”, “miroc6”, “miroc-es2l”,
“mpi-esm1-2-lr”, “mri-esm2-0”, “nesm3”,
“noresm2-mm”, “ukesm1-0-ll”
],
“month”: [
“01”, “02”, “03”, “04”, “05”, “06”,
“07”, “08”, “09”, “10”, “11”, “12”
],
“day”: [
“01”, “02”, “03”, “04”, “05”, “06”,
“07”, “08”, “09”, “10”, “11”, “12”,
“13”, “14”, “15”, “16”, “17”, “18”,
“19”, “20”, “21”, “22”, “23”, “24”,
“25”, “26”, “27”, “28”, “29”, “30”,
“31”
],
“year”: [
“2015”, “2016”, “2017”, “2018”, “2019”, “2020”,
“2021”, “2022”, “2023”, “2024”, “2025”, “2026”,
“2027”, “2028”, “2029”, “2030”, “2031”, “2032”,
“2033”, “2034”, “2035”, “2036”, “2037”, “2038”,
“2039”, “2040”, “2041”, “2042”, “2043”, “2044”,
“2045”, “2046”, “2047”, “2048”, “2049”, “2050”,
“2051”, “2052”, “2053”, “2054”, “2055”, “2056”,
“2057”, “2058”, “2059”, “2060”, “2061”, “2062”,
“2063”, “2064”, “2065”, “2066”, “2067”, “2068”,
“2069”, “2070”, “2071”, “2072”, “2073”, “2074”,
“2075”, “2076”, “2077”, “2078”, “2079”, “2080”,
“2081”, “2082”, “2083”, “2084”, “2085”, “2086”,
“2087”, “2088”, “2089”, “2090”, “2091”, “2092”,
“2093”, “2094”, “2095”, “2096”, “2097”, “2098”,
“2099”, “2100”
],
“area”: [11, -7, 8, -5]
}

client = cdsapi.Client()
client.retrieve(dataset, request).download()[/spoiler]