登录后查看更多精彩内容~
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
各位大佬:大家好,很抱歉打扰到大家。我在将降水月数据转为年数据是报了以下错误
fatal:Variable (nyrs) is undefined
fatal:["Execute.c":8637]:Execute: Error occurred at or near line 10551 in file /usr/local/ncarg/lib/ncarg/nclscripts/csm/contributed.ncl
fatal:["Execute.c":8637]:Execute: Error occurred at or near line 9 in file annual_v2c
但是我查看源文件发现也没有nyrs这个变量,源文件变量如图1所示
与大多数降水资料相比这套数据多了time_bands变量,这个变量在从月数据转换为年数据的过程中,应该怎么处理呢?
我的代码如下所示:(请各位大佬不吝指教,先在此谢谢各位大佬了)
begin
f=addfile("F:/prate.mon.mean.nc","r")
a=f->prate(:,:,:)
pr=month_to_annual(a,1)
pr!0="time"
pr!1="lat"
pr!2="lon"
time_pts=(/1851, 1852, 1853, 1854, 1855, 1856, 1857, 1858, 1859, 1860, 1861, 1862, 1863, 1864, 1865, 1866, 1867, 1868, 1869, 1870, 1871, 1872, 1873, 1874, 1875, 1876, 1877, 1878, 1879, 1880, 1881, 1882, 1883, 1884, 1885, 1886, 1887, 1888, 1889, 1890, 1891, 1892, 1893, 1894, 1895, 1896, 1897, 1898, 1899, 1900, 1901, 1902, 1903, 1904, 1905, 1906, 1907, 1908, 1909, 1910, 1911, 1912, 1913, 1914, 1915, 1916, 1917, 1918, 1919, 1920, 1921, 1922, 1923, 1924, 1925, 1926, 1927, 1928, 1929, 1930, 1931, 1932, 1933, 1934, 1935, 1936, 1937, 1938, 1939, 1940, 1941, 1942, 1943, 1944, 1945, 1946, 1947, 1948, 1949, 1950, 1951, 1952, 1953, 1954, 1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007,2008,2009,2010,2011,2012,2013,2014/)
pr&time=time_pts
pr&lon=f&lon
pr&lat=f&lat
printVarSummary(pr)
fout = addfile("F:/prate.annual.nc","c")
fout->pr=pr
end
再次感谢各位大佬
|