最新nco常用命令及高级玩法.doc





《最新nco常用命令及高级玩法.doc》由会员分享,可在线阅读,更多相关《最新nco常用命令及高级玩法.doc(11页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、精品资料nco常用命令及高级玩法.NNco command:注意:nc文件中的文件名最好不要用数字开头,1.ncdumph nc文件名查看nc文件的信息2.ncrcat 2001.nc 2002.nc 2003.nc out.ncn个nc文件按时间顺序合并3.ncks:ncks -d time,624,635 nswrs.mon.mean.kang.nc nswrs.month.00.nc将时次624到635的资料从nswrs.mon.mean.kang.nc中分割出来放在nswrs.month.00.nc中ncks -A -v uavg,vavg in.nc out.nc将in.nc中的ua
2、vg,vavg变量添加到out.nc中去,同时in.nc和out中的cordinate variable name重复,in.nc中的cordinate variable替换out.nc 中的coordinate variablencks -O -x -v US in.nc out.nc : Remove US variable from in.nc, that is, the out.nc contains all variables of in.nc except USncks O d lon,12 in.nc out.nc: subset variables with lon(12)nc
3、ks O d lon,12. in.nc out.nc: subset variables with lon=12.4.ncea d time,0,2 d lat,0,36 85.nc 86.nc 87.nc ave.nc,对前面多个文件在规定的维数范围内求平均,放在后面一个文件里面。5.ncl_convert2nc a.grb,将grb文件转化成为nc文件6. ncl_filedump c a.grb7.8、ncatted:比较简单,但是也比较容易出错,最好参考教材ncatted -O -a units,y_T,o,c,nounits oda_test_restore.nc为变量y_T的un
4、its属性修改为字符型属性nounitsncatted -O -a cartesian_axis,grid_y_T,c,c,Y oda_test_restore.nc为变量grid_y_T增加属性cartesian_axis”Y” ncatted -a case,global,m,c,fwf fwf.cpl.r.1941-01-01-00000.nc : change global attributes.ncatted -a missing_value,temp,m,f,36 oda_sub_kang.nc将变量的缺省值修改为36.0,注意,修改的不仅是metadata,而且也修改了temp变
5、量里面缺省值的值为36.0,注意,此时最好_Fill_Value最好不要出现ncatted -O -a filename,global,m,c,temp_sfc_restore.nc oda_test_restore.nc修改oda_test_restore.nc中global attributes下面filename的值为temp_sfc_restore.ncncatted -a TITLE,global,c,c,OUTPUT FROM WRF V3.3 MODEL wrf.d01.nc ncatted -O -a calendar,time,d,u10_07sep1_08mar2.nc删除
6、time的calendar属性9、ncrename:ncrenamev temp,tem in.nc给变量改名ncrenamed lat1,lat in.nc给坐标改名10、ncap2(ncap):必须要两个文件名:in.nc out.ncncap usually loses the attribute while ncap2 keeps attribute.ncap2 -O -s anomaly_2hour_outchange=temp-temp_restore in.nc out.nc两个变量相减生成第三个变量ncap2 -O -s temp_oda=float(temp_oda) in.
7、nc out.nc将in.nc中的变量temp_oda转变成float类型ncap2Oslon_latlon,lat=lat+lonin.nc out.nclat和lon分别是一维数组,产生一个二维数组lon_lat(lon,lat)11、ncpdq:ncpdq -a -lat oda_sub_kang.nc out.nc改变lat的排列方向ncpdq -a T,Z,Y,X -v temp temperature_jccom.nc out.nc改变变量temp的排放顺序为temp(t,z,y,x)ncpdq -a zt,TIME regrid_3d.nc out.ncchange the re
8、cord dimension from TIME to ztncpdq in.nc out.nc all variable to nc_shortncpdq U in.nc out.nc unpack all variable to float12、ncrancra -d TIME,0,30,1 u_10.nc u.nc对u_10.nc的第一个月求平均值13、ncwa: Note: only valid in one dimension average.ncwaOa lon in.nc out.ncstore the zonal mean of in.nc in out.nc14ncbonee
9、d only 3 files.ncbo-O -op_typ=add/sub/mlt/dvd in1.nc in2.nc out.nc“ncbo performs binary operations(addition subtraction multiplication division, file1+-*/file2=out.nc) on variables in file1 and corresponding variables(those with the same name) in file2 and stores the results in file315ncflintncflint
10、 -O -C -v prs_sfc -w 0.01,0.0 in.nc in.nc out.nc -C,which causesNCOtonot automatically add coordinates to the variables appearing in the output-file.Rescale the dimensional units of the surface pressure prs_sfc from Pascals to hectopascals(millibars)含nc文件的fortran编译命令ifort -o fortran.exe fortran1.f90
11、 -I/usr/local/include -L/usr/local/liblnetcdf17上用32位编译:xlf90 layer.f90 -I/gpfs/fs4/kangxb/software/software.32bit/include -L /gpfs/fs4/kangxb/software/software.32bit/lib -lnetcdfXlf90c a.f90只编译不链接Segmentation fault:堆栈不够的标志,此时尝试用-q64编译,如果还不行,就只好修改程序,减少堆栈GRADS: 1、grads二进制文件转换成为nc文件: lats4d -i test.ctl
12、 -o test.nc -ftype ctl -vars clfmi2、命令行执行lats4d: gradsc-lbclats4d-v-q-imodel-oex1CDO./configure CC=pgcc -prefix=/global/u2/k/kang/software/cdo-1.4.3 -with-netcdf=/opt/cray/netcdf/4.0.1.0/netcdf-pgi/ -with-hdf5=/opt/cray/hdf5/1.8.3.0/hdf5-pgi/ -with-szlib=/usr/common/usg/szip/2.1/pgi/./configure CC=p
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 最新 nco 常用命令 高级 玩法

限制150内