You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

无法用R或CDO打开从ESGF下载的CMIP6 nc文件求助

问题:CMIP6数据下载后无法用CDO或R打开

我通过R代码从ESGF网站下载GFDL-ESM4模式的ScenarioMIP/ssp245逐日降水数据,代码执行后显示文件已成功下载,但后续操作遇到问题:

  • 用CDO打开时提示:open failed and no such file or directory
  • 用R读取时报错:Error in ncatt_get(ncfile):Error, first passed argument must be an object of class ncdf4

批量下载代码

###########################################################################
    rm(list=ls())
    library("epwshiftr")
    
    # 索引模式信息
    test = init_cmip6_index(
        activity = "ScenarioMIP",
        variable = c("pr"),
        frequency = "day",
        experiment = c("ssp245"),
        source = c("GFDL-ESM4"),
        variant = "r1i1p1f1",
        replica = FALSE,
        latest = TRUE,
        resolution = c("100 km"),
        limit = 10000L,
        data_node = NULL,
        years = NULL,
        save = FALSE
    )
    # 打印唯一模型
    unique(test$source_id)
    test$file_url
    
    fileurl <- test$file_url
    directory <- file.path(setwd("E:/New_Future/GFDL-ESM4/SSP245/"),fsep = .Platform$file.sep)
    
    lapply(fileurl, function(url) download.file(url, file.path(directory, basename(url))))
###########################################################################

单个文件测试代码

directory <- file.path(setwd("E:/New_Future/GFDL-ESM4/SSP245/"),fsep = .Platform$file.sep)
download.file("http://esgdata.gfdl.noaa.gov/thredds/fileServer/gfdl_dataroot4/ScenarioMIP/NOAA-GFDL/GFDL-ESM4/ssp245/r1i1p1f1/
              day/pr/gr1/v20180701/pr_day_GFDL-ESM4_ssp245_r1i1p1f1_gr1_20150101-20341231.nc",
              file.path(directory, basename("pr_day_GFDL-ESM4_ssp245_r1i1p1f1_gr1_20150101-20341231.nc")))

想请教:出现这种情况是代码有问题,还是我遗漏了必要步骤?

内容的提问来源于stack exchange,提问作者Yon Balcha

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.15 20:50:32