- 积分
- 65
- 贡献
-
- 精华
- 在线时间
- 小时
- 注册时间
- 2014-4-11
- 最后登录
- 1970-1-1
|
登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
$ ncl regrid01.ncl
Copyright (C) 1995-2013 - All Rights Reserved
University Corporation for Atmospheric Research
NCAR Command Language Version 6.1.2
The use of this software is governed by a License Agreement.
See http://www.ncl.ucar.edu/ for more details.
fatal:Eq: Dimension size, for dimension number 0, of operands does not match, can't continue
fatal:["Execute.c":8128]:Execute: Error occurred at or near line 1341 in file $NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl
fatal:["Execute.c":8128]:Execute: Error occurred at or near line 3566 in file $NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl
fatal:["Execute.c":8128]:Execute: Error occurred at or near line 3674 in file $NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl
fatal:["Execute.c":8128]:Execute: Error occurred at or near line 55 in file regrid01.ncl
---------------------------------------------------------------------------
以上为报错内容,
以下是regrid01.ncl的脚本内容:
;======================================================================
; Concepts illustrated:
; - Interpolating from one grid to another using ESMF_regrid
; - Interpolating data from a CMIP5 grid to a 1X1 degree rectilinear grid
;======================================================================
; This example is identical to ESMF_all_6.ncl, except it does the
; regridding in one call to "ESMF_regrid". See ESMF_wgts_6.ncl
; for a faster example of regridding using an existing weights file.
;======================================================================
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_code.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/gsn_csm.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
load "$NCARG_ROOT/lib/ncarg/nclscripts/esmf/ESMF_regridding.ncl"
begin
;---Interpolation methods
methods = "bilinear" ;"patch","conserve"
;---Input file
srcFileName = "tos_Omon_ACCESS1-0_rcp85_r1i1p1_200601-210012.nc"
;---Output file
dstFileName = "test.nc"
;---Get data and lat/lon grid from CMIP5 Grid
sfile = addfile(srcFileName,"c")
wgtFile = "CMIP5_2_World_" + methods + ".nc"
tos = sfile->tos(:,:,:)
tos@lat2d = sfile->lat
tos@lon2d = sfile->lon
Opt = True
Opt@SrcFileName = "CMIP5_SCRIP.nc" ; source file name
Opt@DstFileName = "World1deg_SCRIP.nc" ; destination file name
Opt@ForceOverwrite = True
Opt@SrcGridCornerLat = sfile->lat_vertices ; corners are necessary
Opt@SrcGridCornerLon = sfile->lon_vertices ; for "conserve" method
Opt@SrcMask2D = where(.not.ismissing(tos),1,0)
Opt@DstGridType = "1x1" ; Destination grid
Opt@DstTitle = "World Grid 1-degree Resolution"
Opt@DstLLCorner = (/-89.75d, 0.00d /)
Opt@DstURCorner = (/ 89.75d, 359.75d /)
;;Opt@PrintTimings = True
;;Opt@Debug = True
Opt@WgtFileName = wgtFile
Opt@InterpMethod = methods
;----------------------------------------------------------------------
; Interpolate data from CMIP5 to World 1-degree grid.
;----------------------------------------------------------------------
tos_regrid = ESMF_regrid(tos,Opt)
; printVarSummary(tos_regrid)
;---------------------------------------------------------------------
; write regrided netcdf
;---------------------------------------------------------------------
system("/bin/rm -f "+dstFileName)
out = addfile(dstFileName,"c")
fatt = True
fatt@title = srcFileName+" regrid data"
fatt@source_file = srcFileName
fatt@Conventions = "None"
fatt@creation_data = systemfunc("date")
fileattdef(out,fatt)
filedimdef(out,"time",-1,True)
out->tos = tos_regrid
end
|
|