使用print(data_nc.variables['U'])获取该变量的信息: float32 U(Time, bottom_top, south_north, west_east_stag) FieldType: 104 MemoryOrder: XYZ description: x-wind component units: m s-1 stagger: X coordinates: XLONG_U XLAT_U XTIME unlimited dimensions: Time current shape = (73, 36, 69, 70) filling on, default _FillValue of 9.969209968386869e+36 used float32 V(Time, bottom_top, south_north_stag, west_east) FieldType: 104 MemoryOrder: XYZ description: y-wind component units: m s-1 stagger: Y coordinates: XLONG_V XLAT_V XTIME unlimited dimensions: Time current shape = (73, 36, 70, 69) filling on, default _FillValue of 9.969209968386869e+36 used ************************************************************* # u是有36层 u = wrf.getvar(data_nc, 'U', timeidx=1) print(u.shape) 结果:(36, 69, 70) # 海平面气压slp,只有一层海平面高度 u = wrf.getvar(data_nc, 'slp', timeidx=1) print(u.shape) 结果:(69, 69) # U10即10米高度的风,只有一层即10米高度 u = wrf.getvar(data_nc, 'U10', timeidx=1) print(u.shape) 结果:(69, 69)