爱气象,爱气象家园! 

气象家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博登陆

只需一步, 快速开始

搜索
查看: 150|回复: 1

[其他] 使用ESMF_regrid报错。

[复制链接]

新浪微博达人勋

发表于 2024-6-27 15:04:30 | 显示全部楼层 |阅读模式

登录后查看更多精彩内容~

您需要 登录 才可以下载或查看,没有帐号?立即注册 新浪微博登陆

x
使用NCL的ESMF_regrid将CESM不规则网格数据插值到1°*1°出现如下报错
fatal:Could not create (source_grid_file.nc)
warning:FileSetFileOption: invalid file or format
fatal:["Execute.c":8637]:Execute: Error occurred at or near line 1646 in file /NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl

fatal:["Execute.c":8637]:Execute: Error occurred at or near line 3882 in file /NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl

fatal:["Execute.c":8637]:Execute: Error occurred at or near line 4010 in file /NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl

fatal:["Execute.c":8637]:Execute: Error occurred at or near line 88 in file TEMP_global_annual.ncl


运行代码如下:
TEMP4=new((/1032,180,360/),"double")

    ; read variables with multi-files
    ;in = addfiles(file_names(0:1), "r")
    do i=1,file_num-1

        in = addfile (file_names(i), "r")

        type1 = systemfunc("aa="+file_names(i) +" ; echo ${aa#*g16.}")
        type2 = systemfunc("aa="+type1+" ; echo ${aa%.pop*}")

       if i .eq. 0 then
          TEMP    = in ->TEMP(840:,0,:,:)
          time    = in->time(840:)
       else
          TEMP    = in ->TEMP(:,0,:,:)
          time    = in->time
       end if
        printVarSummary(TEMP)

         lat_in = in->TLAT
         lon_in = in->TLONG

         lev = in->z_t

         delete(in)


        lon  = lonGlobeF(360, "lon", "longitude", "degrees_east")
        lat  = latGlobeF(180, "lat", "latitude", "degrees_north")

        Opt   = True   
        Opt@DstGridLat      = lat
        Opt@DstGridLon      = lon

        Opt@ForceOverwrite  = True
        Opt@RemoveSrcFile   = True
        Opt@RemoveDstFile   = True
        Opt@RemveoWgtFile   = True
        Opt@RemovePETLog    = True

        Opt@SrcRegional    = False             ; These are necessary
        Opt@DstRegional    = True

        if (typeof(lon_in).eq."double") then
            lat_mid=doubletofloat(lat_in)
            lon_mid=doubletofloat(lon_in)
            copy_VarAtts(lat_in, lat_mid)
            copy_VarAtts(lon_in, lon_mid)

           ; printVarSummary(lon_mid)
            Opt@SrcGridLat := lat_mid
            Opt@SrcGridLon := lon_mid

            delete(lon_mid)
            delete(lat_mid)
        else
            Opt@SrcGridLat := lat_in
            Opt@SrcGridLon := lon_in

        end if

           TEMP1=TEMP(0,:,:)
           printVarSummary(TEMP1)
           Opt@SrcGridMask    = where(.not.ismissing(TEMP1),1,0)   ; use SrcMask2D in NCL V6.2.1 and earlier

           ; Opt@InterpMethod   = "conserve"       ; Default is bilinear
            TEMP4 = ESMF_regrid(TEMP,Opt)   ; Do the regridding 得到TEMP(time,lat,lon)

求大神给看看是什么问题。

密码修改失败请联系微信:mofangbao

新浪微博达人勋

 楼主| 发表于 2024-6-27 15:08:01 | 显示全部楼层
补一个数据情况
Variable: TEMP
Type: float
Total Size: 507248640 bytes
            126812160 values
Number of Dimensions: 3
Dimensions and sizes:   [time | 1032] x [nlat | 384] x [nlon | 320]
Coordinates:
            time: [700831..732190]
Number Of Attributes: 8
  z_t : 500
  long_name :   Potential Temperature
  units :       degC
  coordinates : TLONG TLAT z_t time
  grid_loc :    3111
  cell_methods :        time: mean
  _FillValue :  9.96921e+36
  missing_value :       9.96921e+36

Variable: TEMP1
Type: float
Total Size: 491520 bytes
            122880 values
Number of Dimensions: 2
Dimensions and sizes:   [nlat | 384] x [nlon | 320]
Coordinates:
Number Of Attributes: 9
  time :        700831
  missing_value :       9.96921e+36
  _FillValue :  9.96921e+36
  cell_methods :        time: mean
  grid_loc :    3111
  coordinates : TLONG TLAT z_t time
  units :       degC
  long_name :   Potential Temperature
  z_t : 500
密码修改失败请联系微信:mofangbao
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册 新浪微博登陆

本版积分规则

Copyright ©2011-2014 bbs.06climate.com All Rights Reserved.  Powered by Discuz! (京ICP-10201084)

本站信息均由会员发表,不代表气象家园立场,禁止在本站发表与国家法律相抵触言论

快速回复 返回顶部 返回列表