下面是我的代码:
a = addfile("/home/yangyun/data_sets/pi/ne30/ocn/VVEL_regrid_.00101-50201.nc","r")
b = addfile("/home/yangyun/data_sets/pi/ne30/ocn/TEMP_regrid_.00101-50201.nc","r")
;47°-63°N 20°-45°W
VVEL0 = a->VVEL(7512:37512-1,0:19,46:64,314:341)
TEMP0 = b->TEMP(7512:37512-1,0:19,46:64,314:341)
lon = VVEL0&lon ; VVEL0和TEMP0两个nc文件dimsizes是相同的
lat = VVEL0&lat
;DJF
T=month_to_season (TEMP0, "DJF")
V=month_to_season (VVEL0, "DJF")
;dTdX
nlat=19
dlon = (lon(2)-lon(1))*0.0174533 ; convert to radians
; pre-allocate space
dTdX = new ( dimsizes(T), typeof(T), T@_FillValue)
do nl=0,nlat-1 ; loop over each latitude
dX = 6378388.cos(0.0174533lat(nl))*dlon ; constant at this latitude
dTdX(:,:,nl:nl,:) = center_finite_diff_n (T(:,:,nl:nl,:), dX , True,0,3)
end do
报错:
检查一下两个变量的格式,数据类型我看是匹配的,为什么会报错呢?