nco常用命令及高级玩法资料

上传人:f****u 文档编号:109066298 上传时间:2019-10-26 格式:DOC 页数:9 大小:138.91KB
返回 下载 相关 举报
nco常用命令及高级玩法资料_第1页
第1页 / 共9页
nco常用命令及高级玩法资料_第2页
第2页 / 共9页
nco常用命令及高级玩法资料_第3页
第3页 / 共9页
nco常用命令及高级玩法资料_第4页
第4页 / 共9页
nco常用命令及高级玩法资料_第5页
第5页 / 共9页
点击查看更多>>
资源描述

《nco常用命令及高级玩法资料》由会员分享,可在线阅读,更多相关《nco常用命令及高级玩法资料(9页珍藏版)》请在金锄头文库上搜索。

1、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中的uavg,vavg变量添加到out.n

2、c中去,同时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)ncks O d lon,12. in

3、.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的units属性修改为字符型属性noun

4、itsncatted -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变量里面缺省值的值为36.0,注意,

5、此时最好_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删除time的calendar属性9、

6、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.nc out.nc将in.nc中的

7、变量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 record dimension fr

8、om 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.nc14ncboneed only 3 files.nc

9、bo-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 -O -C -v prs_sfc

10、 -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 -I/usr/local/inc

11、lude -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 -o test.nc -ftyp

12、e 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=pgcc -prefix=/glob

13、al/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.5.0/hdf5-pgi/-with-szlib=/usr/common/usg/szip/2.1/pgi/on evergreen:./configure -prefix=/homes/xkang/software/cdo -with-netcdf=/cell_root/software/netcdf/4.1.1/intel400 CC=icc -with-hdf5=/cel

14、l_root/software/hdf/1.8.6/intel/sys/includeLIBS=-lcurl./configure -prefix=/homes/xkang/software/cdo -with-netcdf=/cell_root/software/netcdf/4.1.1/intel400 CC=icc LIBS=-lcurl -lgssapi_krb5 -lssl -lcrypto -ldl -lidn -ldes425 -lkrb5 -lk5crypto -lcom_err -lkrb5support -lresolv1. binary - nc /global/u2/k

15、/kang/software/cdo-1.4.3/bin/cdo -f nc import_binary in.ctl out.nc2. nc - grib : https:/code.zmaw.de/boards/1/topics/2907operator strategies:1、specifying large number files :nc file name = alphanumeric_prefix+numeric_suffix+.+filetype #ncea/ncecat/ncra/ncrcatn file_number,digit_number,numeric_increment#where digit number is the fixed number of numeric digits comprising the numeric_suffix, as the following example:digit_number is 2, no alphanumeric_prefix, if digit_n

展开阅读全文
相关资源
相关搜索

当前位置:首页 > 学术论文 > 其它学术论文

电脑版 |金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号