繁体   English   中英

使用 cdo(气候数据运算符)在每日时间步长中存储的变量的月度总和

[英]Monthly sum of of a variable stored at daily timesteps using cdo (Climate Data Operators)

我有一个 40 年的 nc 文件,用于以每日时间分辨率记录的变量。 我想按月对这些进行总结,并尝试了以下方法:

cdo monsum inputfile.nc outputfile.nc

虽然这运行没有错误,但我在输出文件中只得到一帧。 我希望有一个更大的文件。

我认为这可能是输入文件中的时间问题。

ncdump-h input file复制信息:

dimensions:
       time = UNLIMITED ; // (14975 currently)
       longitude = 40 ;
       latitude = 66 ;
variables:
       double time(time) ;
               time:standard_name = "time" ;
               time:units = "days since 1979-1-1 00:00:00" ;
               time:calendar = "proleptic_gregorian" ;
               time:axis = "T" ;
       double longitude(longitude) ;
               longitude:standard_name = "projection_x_coordinate" ;
               longitude:long_name = "longitude" ;
               longitude:units = "degrees_east" ;
               longitude:axis = "X" ;
       double latitude(latitude) ;
               latitude:standard_name = "projection_y_coordinate" ;
               latitude:long_name = "latitude" ;
               latitude:units = "degrees_north" ;
               latitude:axis = "Y" ;
       int crs ;
               crs:proj4 = "+proj=longlat +datum=WGS84" ;
       float variable(time, latitude, longitude) ;
               variable :grid_mapping = "crs" ;
               variable :_FillValue = -3.4e+38f ;
               variable :missing_value = -3.4e+38f ;
               variable :proj4 = "+proj=longlat +datum=WGS84" ;
               variable :min = 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0., 0. ;
               variable :max = 6.5701843261719, 8.62581787109377, 6.24334106445315, 8.29082641601565, 7.59359130859377, 10.0182434082031, 9.76052246093752, 9.95830688476565, 10.3648010253906, 12.8482604980469, 13.1276489257813, 13.1267333984375, 10.9829345703125, 9.82497558593752, 10.1014953613281, 11.8195434570313, 13.9579711914063, 10.0517211914063, 9.37850341796877, 11.3964782714844, 13.0114074707031, 14.4672180175781, 11.4755798339844, 10.6639953613281, 11.3891540527344, 11.9616943359375, 13.7388854980469, 5.56426391601565, 7.07705078125002, 7.64479980468752, 8.25527343750002 ; // global attributes:
               :CDI = "Climate Data Interface version 1.9.10 (https://mpimet.mpg.de/cdi)" ;
               :Conventions = "CF-1.4" ;
               :created_by = "R, packages ncdf4 and raster (version 3.4-10)" ;
               :date = "2021-10-06 11:52:06" ;
               :history = "Mon Oct 18 13:50:40 2021: cdo setreftime,1979-01-01,00:00:00 kdd_AR_1979_2019.nc kdd_AR_1979_2019_adj.nc\n",

非常感谢帮助。 很抱歉没有提供一个简单的可重复示例。 如果需要,我可以通过 we-transfer 或类似方式共享数据。 谢谢!

CDO 使用属性 proj_params 来标识 proj 参数。 您文件中的相应属性是 proj4。 您需要重命名此属性以自动应用 proj 参数:

ncrename -a crs@proj4,proj_params file.nc

我从 Uwe Schulzweida 找到了这个答案

完成后,我希望您可以使用 cdo 正确处理文件,让我知道它是否有效。

感谢 Adrian Tompkins 直接引导我找到答案。 我必须修复此处用作输入的合并文件的时间轴。 这可以使用settaxis operator

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM